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

  • Thread starter Thread starter abirami elango
  • Start date Start date
A

abirami elango

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(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Unload

txtPopConfirm.Text = intCountAnswer1

End Sub

..............
I need to retrive value of textbox(txtPopConfirm) 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.frmPopupidentity.txtPopConfirm.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
 
I need to retrive value of textbox(txtPopConfirm) 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.
 
Back
Top