Avatar of Jimbo99999
Flag for United States of America asked on

ASP.Net - How to tell button name?

Good Day Experts!

My experience with VB.net has been with the windows programming.  This week I have been given the task of becoming familiar with our ASP.net website.  I am trying to "poke around" and follow the code and already have stumbled on a seemingly simple question.

When I look at the Login.aspx page, I click on the button "expecting" to see the properties of the button so I can get the name of it to go to the Login.aspx.vb file and see what it is doing.
I quickly realize it doesn't work that way.

How do I find out the name of the button so I can ultimately go see the code that is running behind it?


Avatar of undefined
Last Comment

8/22/2022 - Mon

You need to check the onclick event of yor button to determine the event handler of your button...
Please check this..

Thanks for replying.  However, I am not trying to determine the event handler of the button.  I am trying to find out the name of it so I can locate the code that executes behind it. I click once on it in the designer and I get the little resizing boxes at each corner of it.  But I do not get any informaiton about the button in the Properties window.  How do I get the button properties to show? They show when I click in a textbox.


Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question

Yes, Visual Studio 2003.  Following the method you suggested and I thought would be how to see it, I just get <BUTTON> in the dropdown list where you normally would see the name.
In SolutionExplorer, I have  a file called Login.aspx. When I rick-click on it and and select "View Designer" I get a form with all the controls on it.  If I right-click and select "View Code" I get normal looking VB.net code.  I dont understand why I can't find the code like you have in 2).

Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes

Its been a long time since i used visual studio 2003.
Just goto the designer mode and in the toolbar, select View->Markup

you should be able to view the aspx file contents in code mode.

									<TD noWrap align="center" colSpan="2"><button id="cmdLogin" onmouseover="this.value='Enter Site';" onmouseout="this.value='Log In';"
											type="button" runat="server" Value="Login">Log 
            In</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BUTTON onmouseover="this.value='Clear Values';" onmouseout="this.value='Cancel';" type="reset"

Open in new window

Ok, I did not see View --> Markup...but I did try View --> HTML Source.  

I find the Login button is named cmdLogin, but I cannot locate the name of the Cancel button.