ASP.NET page_load event

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Rasha Farouk
    New Member
    • Oct 2008
    • 11

    #1

    ASP.NET page_load event

    I wanna run code in 2nd page load . How can I do so?
  • iam_clint
    Recognized Expert Top Contributor
    • Jul 2006
    • 1207

    #2
    Can you give a little more detail on what you are trying to accomplish?

    Comment

    • Rasha Farouk
      New Member
      • Oct 2008
      • 11

      #3
      Originally posted by iam_clint
      Can you give a little more detail on what you are trying to accomplish?
      Peace upon u
      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.
      Rasha

      Comment

      • DrBunchman
        Recognized Expert Contributor
        • Jan 2008
        • 979

        #4
        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:

        Code:
        If Not Page.IsPostBack Then iCounter = 0
        Does this help?

        Dr B

        Comment

        • Rasha Farouk
          New Member
          • Oct 2008
          • 11

          #5
          Originally posted by DrBunchman
          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:

          Code:
          If Not Page.IsPostBack Then iCounter = 0
          Does this help?

          Dr B
          Peace upon u
          Yes I use asp.net.
          I tried what u told me but still the same problem happen.
          Thanks

          Comment

          • DrBunchman
            Recognized Expert Contributor
            • Jan 2008
            • 979

            #6
            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 B

            Comment

            • Rasha Farouk
              New Member
              • Oct 2008
              • 11

              #7
              Originally posted by DrBunchman
              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 B
              Thanks sir 4 reply and inshallah I will do so

              Comment

              • Frinavale
                Recognized Expert Expert
                • Oct 2006
                • 9749

                #8
                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

                • ulai
                  New Member
                  • Oct 2008
                  • 15

                  #9
                  I'm a newbie in asp.net. i don't know but maybe this can help, pliz try it :

                  the main code : application.ite m("name")=val ue


                  dim a as string
                  a=application.i tem("name")

                  Is it can help?

                  Comment

                  Working...