get user enter value from prompt window asp.net

A

ambersaria420

I need to prompt the user to enter ID. I can open up prompt fine using
javascript code below. However I am not sure how to get value that user
entered in user prompt window. I have to check this value to see if it
exists in the database.

Private Sub btnID_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnID.Click
Dim strPop As String
strPop = "<script language='javascript'>" & vbCrLf & "var temp
= window.prompt('Enter ID:','');window.returnValue = temp;" & vbCrLf &
"</script>" & vbCrLf
Page.RegisterStartupScript("Pop", strPop)
End Sub

Thanks a lot
 
S

Subramanian

Hi,

You put the value retuned into a <input> of type HIDDEN
and then call the page refresh.. and at server side take
the value from this hidden variable. and perfrom the
further task.
regards
subramanian
 
A

Alex Homer

I built a selection of user controls that create various client-side prompts
and dialogs, and you can reuse these or copy the code. See:
http://www.daveandal.net/books/6744/default.asp
for the main page and download links, or run these examples from the online
examples page:
a.. Alert, Prompt and Confirm Dialogs from a User Control
a.. Browser-Adaptive Dialogs from a User Control
a.. Internet Explorer Dialog Windows from a User Control
a.. Adaptive Dialog Windows from a User Control
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top