471,354 Members | 1,629 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,354 software developers and data experts.

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(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

Jun 27 '08 #1
1 1772
On May 22, 1:14 pm, abirami elango wrote:
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.
Jun 27 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Sergei | last post: by
3 posts views Thread by epigram | last post: by
1 post views Thread by ganesh22 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.