Java input box and asp.net

Should be easy or so I've been told..  : )

What I'm looking for is...

I have an asp.net  button on a page, I want a popup input box to show when the button is pressed
and the ablity to read the users inout into my asp.net code... ie: (vb example)

button.click
Dim mystring as string = inputbox("enter some text")

now I want to be able to work with "mystring" in the asp.net code.

Thanks!
flosoftAsked:
Who is Participating?
 
pratap_rConnect With a Mentor Commented:
button1.AddAttribute("onclick","hdnctrl.value=prompt('enter some text','default value');")

will go in your page_load
0
 
pratap_rCommented:
add this to your page_load

assuming you have a aspbutton which will postback the form and is named button1
button1.AddAttribute("onclick","hdnctrl.value=prompt('enter some text','default value');")

assuming you have a hidden control called hdnctrl

now the button click event should be able to access hdnctrl's value as the user entered input

easy right?

Have Fun
Pratap
0
 
flosoftAuthor Commented:
where do I put that code?... the asp button also has an onclick event in the .vb file...

hopefully ez...
0
 
harry_hendrataCommented:
Either what pratap_r said, or you could have a hidden layer on your html with the code, then display when the button is clicked..
0
 
flosoftAuthor Commented:
Thanks!!
0
All Courses

From novice to tech pro — start learning today.