Click to See Complete Forum and Search --> : close window problem


Bill Crawley
June 12th, 2008, 10:44 AM
Hi All,

I open a form via a call from a Javascript Function (dont ask me why, this is a hangover from the app I have to work with and I'm not allowed to change it).

This is the Javascript used to open the form:

function OpenWindowModalSetSizeJobSearchAdv(sizeHeight, sizeWidth)
{
var target = WebSiteRootURL + "Jobs/PopUps/JobAdvancedSearch.aspx"
var JobSearchInfo = OpenWindowModalSetSizeReturn(target, "", sizeHeight, sizeWidth);
..........

The form opens no problem.

behind my close button, I have:

Private Sub ASPxButtonClose_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ASPxButtonClose.Click
' close the page
Response.Write("<script language='javascript'> { window.close(); }</script>")
End Sub

When I press the button I receive the folowing Internet Explorer error and the window stays open.

Sys.WebForms.PageRequestManagerParseErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled. Details:Error parsing near '<Script language='ja'.

MikeVallotton
June 12th, 2008, 02:20 PM
I believe you can split up your "<script" into "<scr" + "ipt".

RegisterStartupScript is really the recommended approach, though.