Hi All,
In my web application, i use this following code to open a pop up window.
Its working in my machine.
Response.Write("var win =
window.open('ResponseCountReport.aspx',null,'height =300 width=420
scrollbars=yes');");
But when i hosted my application in my ISP server, its not working.
Any idea where the problem will be?
Thanks in advance.
Regards,
Gomathi
sloan - 21 Feb 2006 16:35 GMT
private readonly string JAVASCRIPT_STARTTAG= "<script
language='javascript'>";
private readonly string JAVASCRIPT_ENDTAG = "</script>";
public static void NewWindow ( Page p , string url)
{
string uuid = System.Guid.NewGuid().ToString();
//'uuid ensures uniqueness, the replace gets rid of non
html/javascript friendly values
uuid = uuid.Replace("-", "").Replace("{", "").Replace("}", "");
p.RegisterClientScriptBlock(uuid, JAVASCRIPT_STARTTAG + "var win
=
window.open('"+url+"',null,'height =300 width=420 scrollbars=yes');"+
JAVASCRIPT_ENDTAG)
}
You can try the Page..RegisterClientScriptBlock method instead. I don't
know if it will fix your issue or not, just giving a suggestion.
Above is a static method I have to pop a new window.. .from a code behind
method.
Another hint ... is the domain issue. Try passing in the FULL QUALIFIED url
.. as it will be on the hosting server.
instead of
string url = "ResponseCountReport.aspx";
try
string url = "http://www.myhost.com/myapp/ResponseCountReport.aspx";
just as a test to see if thats the issue.
you might experiment with the ~ thing also.
> Hi All,
>
[quoted text clipped - 11 lines]
> Regards,
> Gomathi