Hello All,
I want to take two html helpers textboxes on my master page please tell me what shall I do.I want to pass the value in the textboxes from the controller class.Please tell me how can I do that.
Thank You Ritz
Hello All,
I want to take two html helpers textboxes on my master page please tell me what shall I do.I want to pass the value in the textboxes from the controller class.Please tell me how can I do that.
Thank You Ritz
Create a user control instead that contains the text boxes. Then on your master page, include the user control. That way in your controller you're still able to pass values to it through ViewData.
Assuming ASP.NET MVC:
In your controller you can do the following:
public ActionResult Index() {
ViewData["YourText"] = "Hello!";
return View();
}
Your page:
<%= Html.TextBox("NameOfTextBox", ViewData["YourText"]);