Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. how to fire buttonclick event on page load

how to fire buttonclick event on page load

Scheduled Pinned Locked Moved ASP.NET
tutorial
10 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    PrakashBhaskar
    wrote on last edited by
    #1

    Hi, I want the button clickevent should fire on the page load event is it possible if yes tell me how to do this. thanks in advance Thanks Warm Regards Prakash-B

    A 1 Reply Last reply
    0
    • P PrakashBhaskar

      Hi, I want the button clickevent should fire on the page load event is it possible if yes tell me how to do this. thanks in advance Thanks Warm Regards Prakash-B

      A Offline
      A Offline
      abhinish
      wrote on last edited by
      #2

      simply call the button click event in the form load like this Public Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Button1_Click(sender,e) end Sub abhinav

      P 1 Reply Last reply
      0
      • A abhinish

        simply call the button click event in the form load like this Public Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Button1_Click(sender,e) end Sub abhinav

        P Offline
        P Offline
        PrakashBhaskar
        wrote on last edited by
        #3

        Hi, I have another doubt, i am having aspx page and having webusercontrol ascx. I want to call page_load event of webusercontrol from aspx page is it possible. thanks in advance Thanks Warm Regards Prakash-B

        A M 2 Replies Last reply
        0
        • P PrakashBhaskar

          Hi, I have another doubt, i am having aspx page and having webusercontrol ascx. I want to call page_load event of webusercontrol from aspx page is it possible. thanks in advance Thanks Warm Regards Prakash-B

          A Offline
          A Offline
          abhinish
          wrote on last edited by
          #4

          i m not sure but try this call ur page using reponse.redirect("mypage.ascx") when the page will be displyed it will automatically call the page load.. try it abhinav

          1 Reply Last reply
          0
          • P PrakashBhaskar

            Hi, I have another doubt, i am having aspx page and having webusercontrol ascx. I want to call page_load event of webusercontrol from aspx page is it possible. thanks in advance Thanks Warm Regards Prakash-B

            M Offline
            M Offline
            minhpc_bk
            wrote on last edited by
            #5

            Hi there, Basically, the Page_Load of the web user control does not run until the Page_Load of the web page instance has finished. And it does not make much sense when you want to change the event order in the life cycle. Can you be more specific about what you might want to do?

            P 1 Reply Last reply
            0
            • M minhpc_bk

              Hi there, Basically, the Page_Load of the web user control does not run until the Page_Load of the web page instance has finished. And it does not make much sense when you want to change the event order in the life cycle. Can you be more specific about what you might want to do?

              P Offline
              P Offline
              PrakashBhaskar
              wrote on last edited by
              #6

              Hi, On button click event of the webpage i have to call the pageload event of webusercontrol. Thanks Warm Regards Prakash-B

              M I 2 Replies Last reply
              0
              • P PrakashBhaskar

                Hi, On button click event of the webpage i have to call the pageload event of webusercontrol. Thanks Warm Regards Prakash-B

                M Offline
                M Offline
                minhpc_bk
                wrote on last edited by
                #7

                Why do you want to call the Page_Load event of the user control in the Click handler? Do you want to dynamically load the user control?

                P 1 Reply Last reply
                0
                • M minhpc_bk

                  Why do you want to call the Page_Load event of the user control in the Click handler? Do you want to dynamically load the user control?

                  P Offline
                  P Offline
                  PrakashBhaskar
                  wrote on last edited by
                  #8

                  yes i want to call it dynamically Thanks Warm Regards Prakash-B

                  M 1 Reply Last reply
                  0
                  • P PrakashBhaskar

                    yes i want to call it dynamically Thanks Warm Regards Prakash-B

                    M Offline
                    M Offline
                    minhpc_bk
                    wrote on last edited by
                    #9

                    If you want to dynamically load the user control, you can use the LoadControl("usercontrol.ascx") method in the Click event handler, then add the control to the container.

                    1 Reply Last reply
                    0
                    • P PrakashBhaskar

                      Hi, On button click event of the webpage i have to call the pageload event of webusercontrol. Thanks Warm Regards Prakash-B

                      I Offline
                      I Offline
                      Ista
                      wrote on last edited by
                      #10

                      You need to find another of doing that. Create a Web Control instead of an ascx page. Your using a screwdriver to do a hammers work 1 line of code equals many bugs. So don't write any!!

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups