ITsolutionWizard
asked on
string to actionresult, mvc
I have a piece of information such as data from local storage in javascript. when the page is loaded, i want to send the data into below codes. Is it possible. Please show me in codes. not an experts of mvc and jquery. thanks
public ActionResult AdditionalBondInfo()
{
string x = mydata;
}
public ActionResult AdditionalBondInfo()
{
string x = mydata;
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
How the controller picks up the data?
As a normal post - in other words however your backend framework handles posted data - you would do exactly the same.
ASKER
I don't get it
ASKER
My goal is to take the local storage values to action result below.
public ActionResult AdditionalBondInfo()
{
return View(Method1("CA", "Plan"));
}
public ActionResult AdditionalBondInfo()
{
return View(Method1("CA", "Plan"));
}
I am not familiar with your server code so I cannot give you explicit instructions on how to intercept the data coming in. However, if you imagine that the data was coming in as a result of
<form action="yourscript" method="post">
Then this would be identical.
ASKER
public ActionResult AdditionalBondInfo()
{
return View(Method1("CA", "Plan"));
}
above is my server codes. how can i get the post value inside of action result?
{
return View(Method1("CA", "Plan"));
}
above is my server codes. how can i get the post value inside of action result?
I think I have covered this area - giving me 4 lines of code is not useful to finding a solution.
Please answer this question:
How do you get a post value from a <form> that posts to your script - do you know how to do that.
I am guessing Request.Form('data');
Please answer this question:
How do you get a post value from a <form> that posts to your script - do you know how to do that.
I am guessing Request.Form('data');
ASKER
There is nothing to post because the values are already in local storage
I am referring to your server code.
ASKER