[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Gomathi

2/20/2006 6:08:00 AM

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


1 Answer

sloan

2/21/2006 4:36:00 PM

0

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.a...

just as a test to see if thats the issue.

you might experiment with the ~ thing also.



"Gomathi" <gomathi@celtycs-consulting.com> wrote in message
news:eQBBeQeNGHA.648@TK2MSFTNGP14.phx.gbl...
> 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
>
>