W
W
WowItIsYou20202020-11-28 03:29:29
ASP.NET
WowItIsYou2020, 2020-11-28 03:29:29

How to create and pass an object to OnPost?

Hello. I need to create a SentimentData object and pass it to OnPost.

<form method="post">
    <div>
        <label>Add Text</label>
        <input asp-for=SentimentData.SentimentText class="form-control" />
        <button type="submit" class="btn btn-primary">Save</button>
    </div>
</form>


public void OnPost(SentimentData SentimentData)
        {
            Text = SentimentData.SentimentText;
            Analysis.Evaluate(mlContext, Model, SplitDataView.TestSet);
            Analysis.UseModelWithSingleItem(mlContext, SentimentData, Model, Text);
        }


But i get null object
5fc19950cd45e324314128.png

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question