How to call Page Method from WebUserControl???

Hi all

If we have 2 different WebUserControl added into a .aspx Page, while standing in WebUserControl1.ascx.cs, we can easily call a public method that declared in WebUserControl2.ascx.cs via:

<@Register….> in WebUserContol1.ascx file 

and type cast: ((WebUserControl2)(this.Page.FindControl(…<WebUserControl2 id>….))).MethodToCall(); //in WebUserControl1.ascx.cs file

 

I've found it very easy and it works well.

But i don't know if I have a method that declared in Page that contains these 2 controls, such as Default.aspx.cs, How can I call this method while standing in WebUserControl1.ascx.cs.

Or this logic is impossible???

Thanks

Read More

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s