how to retrive value of textbox assined in page UNLOADevent in javascript....

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • abirami elango

    how to retrive value of textbox assined in page UNLOADevent in javascript....

    Hi,
    i have created a web application in vb.net.
    i have assigned a value to the textbox during page UNLOAD event as below..
    .........
    Protected Sub Page_Unload(ByV al sender As Object, ByVal e As System.EventArg s) Handles Me.Unload

    txtPopConfirm.T ext = intCountAnswer1

    End Sub

    ..............
    I need to retrive value of textbox(txtPopC onfirm) assigned in page UNLOAD event in javascript.
    i have called the script code in the .aspx page as

    <body style="width: 825px; height: 1024px" onunload= "Alertmessage() ">

    and the script is...

    function Alertmessage()
    {
    var ans = document.frmPop upidentity.txtP opConfirm.value ;
    if (ans == 'False')
    {
    //alert message
    }
    }


    problem:
    if the value of txtPopConfirm is assigned as true in page unload event, but in the script it is retrived as false.

    plz provide me the solution...

    thz,
    abirami

  • Terry Rogers

    #2
    Re: how to retrive value of textbox assined in page UNLOAD event injavascript... .

    On May 22, 1:14 pm, abirami elango wrote:
    I need to retrive value of textbox(txtPopC onfirm) assigned in page UNLOAD event in javascript.
    The Unload event happens after the page has been rendered out to the
    client, so there's no way of getting the value in a client side
    script.
    Set the value in the Init, Load or PreRender event handler instead.

    Comment

    Working...