Call .ascx page load method form .aspx page. [Resolved]

Posted by Programmer123 under ASP.NET on 11/18/2013 | Points: 10 | Views : 1982 | Status : [Member] | Replies : 1
I have .aspx page and .ascx page. I am calling the .ascx page form .aspx page. So when I called .aspx pageload event, then my .ascx page load event is also get called. Now my questions is I want to call the .ascs page load form one fo the method() form .aspx page.

Example:-

.aspx page
pageload()
{
//I want to call the Pageload() of .ascs page
}
method()
{
//I want to call the Pageload() of .ascs page
}

.ascx page.
Pageload() // Pageload() of .ascs page
{
}

Can any one help me?




Responses

Posted by: Allemahesh on: 11/19/2013 [Member] [MVP] Silver | Points: 50

Up
0
Down

Resolved
You can not call the page load event of .ascx page form you method. Insted you can use the blow event in your .ascx page insted of pageload() event. This will called after executing of your method() and it will be called at last.

protected override void OnPreRender(EventArgs e)
{
}


Happy Coding,
If it helps you or directs U towards the solution, MARK IT AS ANSWER

Programmer123, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response