I wanna run code in 2nd page load . How can I do so?
ASP.NET page_load event
Collapse
X
-
Tags: None
-
Peace upon uOriginally posted by iam_clintCan you give a little more detail on what you are trying to accomplish?
I put login at master page, I wanna user when login , his data will retrieved from db according to his user name at my form.
at 1st time of loading page the session["id"] returned null and that is normal.
I traced the code and note that after 2nd page load I can put my code.
I tried to make counter to count times of loading but at every time of load the counter is reset to its initial value.
Thanks for ur caring.
RashaComment
-
Hi Rasha,
It sounds like you are using ASP.NET - can you confirm whether this is true?
If so then you can test whether the page load is a post back when you set your counter variable. In VB it would be something like:
Does this help?Code:If Not Page.IsPostBack Then iCounter = 0
Dr BComment
-
Peace upon uOriginally posted by DrBunchmanHi Rasha,
It sounds like you are using ASP.NET - can you confirm whether this is true?
If so then you can test whether the page load is a post back when you set your counter variable. In VB it would be something like:
Does this help?Code:If Not Page.IsPostBack Then iCounter = 0
Dr B
Yes I use asp.net.
I tried what u told me but still the same problem happen.
ThanksComment
-
I've moved this post for you to the .NET Forum where it belongs - please post all future ASP.NET questions in here.
Can you print the code please of what you are trying to do?
Thanks,
Dr BComment
-
Thanks sir 4 reply and inshallah I will do soOriginally posted by DrBunchmanI've moved this post for you to the .NET Forum where it belongs - please post all future ASP.NET questions in here.
Can you print the code please of what you are trying to do?
Thanks,
Dr BComment
-
Hey!
Please take a look at your other thread. I gave a whole bunch of links pointing you in the right direction there and was waiting for you to tell me more about what you've tried and what problems you're facing.
Please do Not double post your questions in the future.Comment
Comment