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.