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. Set LinkButton from MasterPage as default button on the page.

Set LinkButton from MasterPage as default button on the page.

Scheduled Pinned Locked Moved ASP.NET
help
6 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.
  • A Offline
    A Offline
    anada8886
    wrote on last edited by
    #1

    On my web form,I have applied a MasterPage,which contains a user control. This user control in turn contains a link button. I want to set this link button as the default button on my web form. I found 1 free dll on internet which gives this method : - DefaultButton.SetDefaultButton(textboxControl,ButtonControl); But this method, somehow, does not allow link button (only Buttons & ImageButtons are allowed). Please Help. Thank you :) .

    N 1 Reply Last reply
    0
    • A anada8886

      On my web form,I have applied a MasterPage,which contains a user control. This user control in turn contains a link button. I want to set this link button as the default button on my web form. I found 1 free dll on internet which gives this method : - DefaultButton.SetDefaultButton(textboxControl,ButtonControl); But this method, somehow, does not allow link button (only Buttons & ImageButtons are allowed). Please Help. Thank you :) .

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      Have you tried the DefaultButton property? Something like

      <form id="form1" runat="server" defaultbutton="yourLinkButton">

      Navaneeth How to use google | Ask smart questions

      A 1 Reply Last reply
      0
      • N N a v a n e e t h

        Have you tried the DefaultButton property? Something like

        <form id="form1" runat="server" defaultbutton="yourLinkButton">

        Navaneeth How to use google | Ask smart questions

        A Offline
        A Offline
        anada8886
        wrote on last edited by
        #3

        Yes,I have tried this in a separate sample project & it worked.But I am confused about ,on which page should I apply this in my project,B'coz here, the link button is inside a user control which is placed on the master page.And this master page is applied to my webform(). I tried this on the user control's

        tag,but it din't work. Thank for ur reply. But I still stuck,please help.

        A 1 Reply Last reply
        0
        • A anada8886

          Yes,I have tried this in a separate sample project & it worked.But I am confused about ,on which page should I apply this in my project,B'coz here, the link button is inside a user control which is placed on the master page.And this master page is applied to my webform(). I tried this on the user control's

          tag,but it din't work. Thank for ur reply. But I still stuck,please help.

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

          Hey,I got it!! :) I took all the required controls inside a panel,and then set its property defaultButton to a button(say "Button4"), made it invisible and called linkbutton's Clink Event on Button4_Click. Seems simple. Thanks a lot... :-D

          N 1 Reply Last reply
          0
          • A anada8886

            Hey,I got it!! :) I took all the required controls inside a panel,and then set its property defaultButton to a button(say "Button4"), made it invisible and called linkbutton's Clink Event on Button4_Click. Seems simple. Thanks a lot... :-D

            N Offline
            N Offline
            N a v a n e e t h
            wrote on last edited by
            #5

            That was tricky. But I assume you can use the same button and change it's style like a link button by applying some CSS. Then you don't need to hide the button.

            Navaneeth How to use google | Ask smart questions

            A 1 Reply Last reply
            0
            • N N a v a n e e t h

              That was tricky. But I assume you can use the same button and change it's style like a link button by applying some CSS. Then you don't need to hide the button.

              Navaneeth How to use google | Ask smart questions

              A Offline
              A Offline
              anada8886
              wrote on last edited by
              #6

              Yeah,I had tried that earlier.But then it was giving a diferent effect to the viewer and since there are other link buttons too,so all of them should look alike.That is why,I had do it like this. But anyways,Thanks a lot for your immediate responces. :)

              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