Home ASP.Net MVC Usage confusion

ASP.Net MVC Usage confusion

user2218
1#
user2218 Published in March 19, 2018, 1:17 am
 I'm in a situation where I would like to take a value from a page using JQuery, update the model with that value, call a method to update a different value in a model. Then call the controller to return a view with the new model. I'm new to this so I imagine this is the wrong approach. This is the View I have so far: @using Cubic.OSS.SNMPMessageDuggerWebApplication.Models @model SnmpModel @{ ViewBag.Title = "SNMP Message Debugger"; } @section scripts { }

@ViewBag.Title.

Enter SNMP Message:

Result:

 My model looks like this: public class SnmpModel { public string SnmpMessageInput { get; set; } public string SnmpMessageOutout { get; set; } // I Imagine a method would be added here to transform the input }  And this is the controller so far: public class SNMPController : Controller { // GET: SNMP public ActionResult Index() { return View(); } }  What I don't know how to do is: update the model with the returned JQuery, then refresh the page with the new model using the controller. The input would be taken from the input text area, then transformed using code that was written in C# previously. This would be a method in the model I image. I have to use the code written in C# so I can't do the algorithm in js. Thanks.
 You need to login account before you can post.
Processed in 0.245252 second(s) , Gzip On .