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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Help!

Help!

Scheduled Pinned Locked Moved ASP.NET
csharpasp-nethelpquestion
12 Posts 2 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.
  • R Offline
    R Offline
    Rockman X7
    wrote on last edited by
    #1

    Hello, I got a difficulty to use ASP.NET. When I create a button in web form. And I compiled it the button didn't appear. What should I do? do I must setting something?

    C 1 Reply Last reply
    0
    • R Rockman X7

      Hello, I got a difficulty to use ASP.NET. When I create a button in web form. And I compiled it the button didn't appear. What should I do? do I must setting something?

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      Did you create the button programmatically? (i.e. not using the designer) Did you remember to add it to the Page.Controls collection? --Colin Mackay--

      EuroCPian Spring 2004 Get Together[^]

      R 2 Replies Last reply
      0
      • C Colin Angus Mackay

        Did you create the button programmatically? (i.e. not using the designer) Did you remember to add it to the Page.Controls collection? --Colin Mackay--

        EuroCPian Spring 2004 Get Together[^]

        R Offline
        R Offline
        Rockman X7
        wrote on last edited by
        #3

        no I didn't. I have tried to create the button programmatically and using the designer. But the button didn't appear. Hiks.

        1 Reply Last reply
        0
        • C Colin Angus Mackay

          Did you create the button programmatically? (i.e. not using the designer) Did you remember to add it to the Page.Controls collection? --Colin Mackay--

          EuroCPian Spring 2004 Get Together[^]

          R Offline
          R Offline
          Rockman X7
          wrote on last edited by
          #4

          no I didn't. I have tried to create the button programmatically and using the designer. But the button didn't appear. Hiks. And what is Page.Controls collection? I'm sorry i'm newbie in ASp.NEt

          C 1 Reply Last reply
          0
          • R Rockman X7

            no I didn't. I have tried to create the button programmatically and using the designer. But the button didn't appear. Hiks. And what is Page.Controls collection? I'm sorry i'm newbie in ASp.NEt

            C Offline
            C Offline
            Colin Angus Mackay
            wrote on last edited by
            #5

            In the HTML view on the designer can you make sure that the code for the button looks like the following: <asp:Button id="Button1" runat="server" Text="Button"></asp:Button> That there is a corresponding object in your code-behind file (That's the one with the same name as the aspx file but with .cs on the end) protected System.Web.UI.WebControls.Button Button1; --Colin Mackay--

            EuroCPian Spring 2004 Get Together[^]

            R 1 Reply Last reply
            0
            • C Colin Angus Mackay

              In the HTML view on the designer can you make sure that the code for the button looks like the following: <asp:Button id="Button1" runat="server" Text="Button"></asp:Button> That there is a corresponding object in your code-behind file (That's the one with the same name as the aspx file but with .cs on the end) protected System.Web.UI.WebControls.Button Button1; --Colin Mackay--

              EuroCPian Spring 2004 Get Together[^]

              R Offline
              R Offline
              Rockman X7
              wrote on last edited by
              #6

              Ooo I understand. But your code is similar with the code I created. Do I have to use SQL Server? Or something else? Ops I forgot to tell you. I'm Vb.Net developer. Is "protected System.Web.UI.WebControls.Button Button1;" the c code?

              C 2 Replies Last reply
              0
              • R Rockman X7

                Ooo I understand. But your code is similar with the code I created. Do I have to use SQL Server? Or something else? Ops I forgot to tell you. I'm Vb.Net developer. Is "protected System.Web.UI.WebControls.Button Button1;" the c code?

                C Offline
                C Offline
                Colin Angus Mackay
                wrote on last edited by
                #7

                It's the C# code. The equivalent VB.NET code is: Protected WithEvents Button1 As System.Web.UI.WebControls.Button --Colin Mackay--

                EuroCPian Spring 2004 Get Together[^]

                R 1 Reply Last reply
                0
                • R Rockman X7

                  Ooo I understand. But your code is similar with the code I created. Do I have to use SQL Server? Or something else? Ops I forgot to tell you. I'm Vb.Net developer. Is "protected System.Web.UI.WebControls.Button Button1;" the c code?

                  C Offline
                  C Offline
                  Colin Angus Mackay
                  wrote on last edited by
                  #8

                  Rockman X7 wrote: Do I have to use SQL Server? Or something else? I'm not sure where you got the idea of needing SQL Server. If you're going to hook up a database later then that's fine but it doesn't have anything to do with the button. No, you shouldn't need anything else at this stage. --Colin Mackay--

                  EuroCPian Spring 2004 Get Together[^]

                  1 Reply Last reply
                  0
                  • C Colin Angus Mackay

                    It's the C# code. The equivalent VB.NET code is: Protected WithEvents Button1 As System.Web.UI.WebControls.Button --Colin Mackay--

                    EuroCPian Spring 2004 Get Together[^]

                    R Offline
                    R Offline
                    Rockman X7
                    wrote on last edited by
                    #9

                    Hei2 I found something. When I created a button in WEB FORM Panel. And I compiled it the button didn't appear. But if i created a button in HTML Panel. And I compiled it the button appeared. But it's strange. Why I can't create a button in Web Form panel? But in Design mode. The button appeared.

                    C 1 Reply Last reply
                    0
                    • R Rockman X7

                      Hei2 I found something. When I created a button in WEB FORM Panel. And I compiled it the button didn't appear. But if i created a button in HTML Panel. And I compiled it the button appeared. But it's strange. Why I can't create a button in Web Form panel? But in Design mode. The button appeared.

                      C Offline
                      C Offline
                      Colin Angus Mackay
                      wrote on last edited by
                      #10

                      You do know that they are different things? The button on the HTML panel doesn't provide server-side facilities - it is a client control only. The button in the Web Forms toolbox allows you to create server-side events like the button click event. Is <asp:button> inside the <form> </form> tags? Does the <asp:button> have the runat="Server" attribute? --Colin Mackay--

                      EuroCPian Spring 2004 Get Together[^]

                      R 1 Reply Last reply
                      0
                      • C Colin Angus Mackay

                        You do know that they are different things? The button on the HTML panel doesn't provide server-side facilities - it is a client control only. The button in the Web Forms toolbox allows you to create server-side events like the button click event. Is <asp:button> inside the <form> </form> tags? Does the <asp:button> have the runat="Server" attribute? --Colin Mackay--

                        EuroCPian Spring 2004 Get Together[^]

                        R Offline
                        R Offline
                        Rockman X7
                        wrote on last edited by
                        #11

                        Everything are okay.

                        Label

                        But it still didn't appear.

                        C 1 Reply Last reply
                        0
                        • R Rockman X7

                          Everything are okay.

                          Label

                          But it still didn't appear.

                          C Offline
                          C Offline
                          Colin Angus Mackay
                          wrote on last edited by
                          #12

                          I don't see a reference to asp:button in your code there. --Colin Mackay--

                          EuroCPian Spring 2004 Get Together[^]

                          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