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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get a return value from window.prompt?

Status
Not open for further replies.

jartman

Programmer
Oct 16, 2001
34
US
I have a datagrid with a button in a template column. I want the button to open a dialog box to prompt the user for a value. The value is then used in the aspx.vb (code behind) file.

To pop up the dialog box, I use the following:
Sub DataGrid1.ItemDataBound(...)
myButton.Attributes("onclick") = "javascript:return mypn = prompt('Enter a part number')"
End Sub

The error I get when I try to reference mypn in the aspx.vb file is "Public member 'mypn' on type 'object_aspx' not found". Is the variable mypn in the scope of the aspx file? The code behind file? Neither? Is there another way to accomplish this?

- John
 
Check out this signature!

-Rick

----------------------
[banghead]If you're about to post an ASP.Net question,
please don't do it in the VB.Net forum[banghead]

[monkey] I believe in killer coding ninja monkeys.[monkey]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top