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. run time event create

run time event create

Scheduled Pinned Locked Moved ASP.NET
7 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.
  • B Offline
    B Offline
    Bhim Prakash Singh
    wrote on last edited by
    #1

    i try this code but this not worked properly. Button but = new Button(); but.Text = "Full Detail"; but.ID = "Full_Detail"; t.OnClientClick += new System.EventHandler(fullDetail); Panel1.Controls.Add(but); private void fullDetail(object sender, EventArgs e) { SearchResult.InnerHtml = "Hi"; }

    C A 2 Replies Last reply
    0
    • B Bhim Prakash Singh

      i try this code but this not worked properly. Button but = new Button(); but.Text = "Full Detail"; but.ID = "Full_Detail"; t.OnClientClick += new System.EventHandler(fullDetail); Panel1.Controls.Add(but); private void fullDetail(object sender, EventArgs e) { SearchResult.InnerHtml = "Hi"; }

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Your click event will not fire unless the button is added before the page load event.

      Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

      1 Reply Last reply
      0
      • B Bhim Prakash Singh

        i try this code but this not worked properly. Button but = new Button(); but.Text = "Full Detail"; but.ID = "Full_Detail"; t.OnClientClick += new System.EventHandler(fullDetail); Panel1.Controls.Add(but); private void fullDetail(object sender, EventArgs e) { SearchResult.InnerHtml = "Hi"; }

        A Offline
        A Offline
        Abhijit Jana
        wrote on last edited by
        #3

        when did you add the button. check this, itw working fine

        protected void Page_Load(object sender, EventArgs e)
            {
                Button b = new Button();
                b.Text = "Dunamic";
                b.ID = "myid";
                b.Click += new EventHandler(b_Click);
                Panel1.Controls.Add(b);
            }
        
            void b_Click(object sender, EventArgs e)
            {
                Response.Write("Dynamic Button");
            }
        

        Best Regards ----------------- Abhijit Jana Check Out My Latest Article Java.NET : Integration of Java and .NET[^] "Success is Journey it's not a destination"

        B S 2 Replies Last reply
        0
        • A Abhijit Jana

          when did you add the button. check this, itw working fine

          protected void Page_Load(object sender, EventArgs e)
              {
                  Button b = new Button();
                  b.Text = "Dunamic";
                  b.ID = "myid";
                  b.Click += new EventHandler(b_Click);
                  Panel1.Controls.Add(b);
              }
          
              void b_Click(object sender, EventArgs e)
              {
                  Response.Write("Dynamic Button");
              }
          

          Best Regards ----------------- Abhijit Jana Check Out My Latest Article Java.NET : Integration of Java and .NET[^] "Success is Journey it's not a destination"

          B Offline
          B Offline
          Bhim Prakash Singh
          wrote on last edited by
          #4

          thank this code button load in page_load but i have a button. then click on button i want to create a new button and then i click on new button than show message "Hi";

          A 1 Reply Last reply
          0
          • B Bhim Prakash Singh

            thank this code button load in page_load but i have a button. then click on button i want to create a new button and then i click on new button than show message "Hi";

            A Offline
            A Offline
            Abhijit Jana
            wrote on last edited by
            #5

            prakash_adysoft wrote:

            this code button load in page_load

            yes

            prakash_adysoft wrote:

            have a button. then click on button i want to create a new button

            as Chirs say, you have register event before page load.

            Best Regards ----------------- Abhijit Jana Check Out My Latest Article Java.NET : Integration of Java and .NET[^] "Success is Journey it's not a destination"

            1 Reply Last reply
            0
            • A Abhijit Jana

              when did you add the button. check this, itw working fine

              protected void Page_Load(object sender, EventArgs e)
                  {
                      Button b = new Button();
                      b.Text = "Dunamic";
                      b.ID = "myid";
                      b.Click += new EventHandler(b_Click);
                      Panel1.Controls.Add(b);
                  }
              
                  void b_Click(object sender, EventArgs e)
                  {
                      Response.Write("Dynamic Button");
                  }
              

              Best Regards ----------------- Abhijit Jana Check Out My Latest Article Java.NET : Integration of Java and .NET[^] "Success is Journey it's not a destination"

              S Offline
              S Offline
              Sandeep Akhare
              wrote on last edited by
              #6

              I think its better to creat to do this functionality in Page_init rather than Page Load

              Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

              A 1 Reply Last reply
              0
              • S Sandeep Akhare

                I think its better to creat to do this functionality in Page_init rather than Page Load

                Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

                A Offline
                A Offline
                Abhijit Jana
                wrote on last edited by
                #7

                yes.

                Best Regards ----------------- Abhijit Jana Check Out My Latest Article Java.NET : Integration of Java and .NET[^] "Success is Journey it's not a destination"

                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