Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Button return value in VB

Status
Not open for further replies.

Delphin

Programmer
Nov 27, 2001
134
US
I am bit new at the .Net version of everything:

This code works properly:
Button1.Attributes.Add("onclick", "vb: return confirm('Is this the location you are working?');")

What I need to know is how do I get the return value of this box? I am trying to do multiple operations depending on user selections.

Also is there an input but in ASP.Net?

Thank for all of your help

Billy Ballard

For in the past, Lies the future.
 
Anybody come up with a solution for this? I also need to know whether yes or cancel was selected.

The way the code works now, if the user selects "cancel", the button's click_Event never runs. I need to do a series of things depending on which value they selected.

Any help is greatly appreciated.

Thank you,

Frank Orozco
 
If you are using code behind pages this would be a lot simpler. Assuming you are:
On the aspx page:
<asp:button id=&quot;Button1&quot; runat=&quot;server&quot; text=&quot;Is this the location you are working?&quot; />

On the aspx.vb page you would have a routine:
Private Sub Button1_Click(ByVal sender as object, e as eventargs)
'Code to run when button is pressed.
End Sub

You could also put all of this into an aspx page without the code behind by enclosing your routine in script tags.

To answer your second question about input controls. As with all controls in .Net there is the standard html one and an asp one. The syntax is as follows
Old HTML version:
<input id=&quot;Input1&quot; runat=&quot;server&quot; Name=&quot;Input1&quot; type=&quot;input&quot;>

New ASP version:
<asp:textbox id=&quot;Input1&quot; runat=&quot;server&quot; />

Hope that helps.

Eva
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top