Link to home
Start Free TrialLog in
Avatar of Jimbo99999
Jimbo99999Flag 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?

Thanks,
jimbo99999
Avatar of Pra4444
Pra4444
Flag of United States of America image

You need to check the onclick event of yor button to determine the event handler of your button...
Please check this..
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.button.click.aspx
Avatar of Jimbo99999

ASKER

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.

Thanks,
jimbo99999
ASKER CERTIFIED SOLUTION
Avatar of Pra4444
Pra4444
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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).

Thanks,
jimbo99999
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.
<TR>
									<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"
											value="Cancel">Cancel</BUTTON></TD>
								</TR>

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.

jimbo99999