get user enter value from prompt window asp.net

Discussion in 'ASP .Net' started by ambersaria420@yahoo.com, Dec 17, 2004.

  1. Guest

    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
     
    , Dec 17, 2004
    #1
    1. Advertising

  2. Subramanian Guest

    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
    >-----Original Message-----
    >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
    >
    >.
    >
     
    Subramanian, Dec 17, 2004
    #2
    1. Advertising

  3. Alex Homer Guest

    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

    <> wrote in message
    news:...
    > 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
    >
     
    Alex Homer, Dec 17, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    358
    =?Utf-8?B?cmFqYW1hbmlja2Ft?=
    Dec 17, 2004
  2. Sunfire
    Replies:
    2
    Views:
    1,066
    Sunfire
    Nov 6, 2007
  3. gaurav kashyap
    Replies:
    2
    Views:
    623
    gaurav kashyap
    Oct 30, 2008
  4. Tom Jenkins
    Replies:
    10
    Views:
    191
    Thomas 'PointedEars' Lahn
    Oct 10, 2004
  5. HopfZ
    Replies:
    0
    Views:
    576
    HopfZ
    Aug 28, 2006
Loading...

Share This Page