I am new to mvc , I would like to know how to assign the textbox text to another variable in mvc.
In windows we can use textbox1.text = var body;
How can I do the similar one by using the below code
I want to write the text in textboxfor such that it will invoke the parameter of string postcode of PAF controller Index action?
@Html.TextBoxFor(model => model.PostCode)
**Here we will get : postcode: ------------(Assume Postcode:52345)**
<input type="button" name="postcode" value="check your address" onclick="location.href='@Url.Action("Index", "PAF", new {Postcode = ...... )})'" />
**Here we will get : check your address button**
Here is my PAF controller Index action
public class PAFController : Controller
{
public ActionResult Index(string Postcode)
{
return View();
}
}