By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,731 Members | 1,104 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,731 IT Pros & Developers. It's quick & easy.

User Control and Page Load

P: n/a
Hi everyone, first of all I am sorry if my english is not so good
because I'm italian. The problem I need to solve is:
in a WebForm (WF) I have a UserControl (UC) wich contains some
controls. The first event that ASP.NET runs is WF_pageload but I'd
need UC_pageload event to run first. Does anyone know how to help me?

Jonathan
Nov 18 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hi, Jonathan,

Move the code in the UC_pageload to another method in the UserControl class.
Then just call this method from the Page_Load handler of the webform.

Hope this helps
Martin
"Jonathan" <th**************@tiscali.it> wrote in message
news:b1**************************@posting.google.c om...
Hi everyone, first of all I am sorry if my english is not so good
because I'm italian. The problem I need to solve is:
in a WebForm (WF) I have a UserControl (UC) wich contains some
controls. The first event that ASP.NET runs is WF_pageload but I'd
need UC_pageload event to run first. Does anyone know how to help me?

Jonathan


Nov 18 '05 #2

P: n/a
Hi Jonthan

Well, you are asking some thing that framework should go reverse

What i mean is, whenever you creare a User Control and Register the User Control in a
Web Form, what happens is, First the Page_Load event of the Web Form gets called
After this is the Page_Load of the User Control happens
This is how the .NET frame work is built upon

If you send the scenario what you are trying to do
we can see the alternative

Nov 18 '05 #3

P: n/a
Hi Martin

I agree with you

This can be a turn around for the scenario that jonath needs

He can create a public property or method in the UC and call it from the WF

regard
Kashyp

Nov 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.