error on exit button

Posted by Priti2010 under VB.NET on 8/30/2011 | Points: 10 | Views : 1380 | Status : [Member] | Replies : 1
Protected Sub btnExit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExit.Click
Response.Write("<script language='javascript'>{ window.close();}</script>")
End Sub

i am getting error as 'Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed.'

Kindly help me out how to sort this error

Thanks & Regards
Priti



Responses

Posted by: Jpchoudhari on: 8/30/2011 [Member] Starter | Points: 25

Up
0
Down
If you are using update panel in your page then Response.Write method can give such error.
Use
ScriptManager.RegisterClientScriptBlock(
Page page,
Type type,
string key,
string script,
bool addScriptTags) insert your script in at script position. (If you are using Update Panel)

Kind Regards,
Jay

Priti2010, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response