I have webform code as below.I need to have this in mvc.. What to use to initialize objext in pageload event in asp.net mvc
protected void Page_Load(object sender, EventArgs e)
{
Control ctrl = (Control)Session["ctrl"];
PrintHelper.PrintWebControl(ctrl);
}
ASP.NET MVC doesn't work on events like ASP classic; there's no "pageload event". Your controller methods correspond to requests sent to the server. You'll need to build the equivalent control in HTML, and then use a form to HTTP POST the data to the server, where it is handled by a controller method.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With