problem in emiting client script from code behind

Author Topic
Renukadevi Shanmugasundaram
Member

Joined: 14 Jul 2006
Country: Australia
Posts: 15

Posted: 31 Oct 2006 01:40:33

Hi all,

Task:

When user click a button the current window has to be closed and a new window should open to display information. I have to call a function to do certain task before closing this window and opening new.

Problem:

So in the click event of button i wrote:

callFunction();

string script = "@<script>javascript:window.open('PrintMicroResults.aspx','printWindow','toolbar=no,titlebar=no,width=800,height=500,top=50,left=50,scrollbars=yes,resizable=yes');location.href='#';self.close();</script>";

Page.RegisterStartupScript("print", script);

It is closing the current window but not opening the new window for page PrintMicroResults.

I tried the same window.open with <A> in the client side script and its woking very well. i mean its opening new window for my page and closing the current.

But if i use anchor how do i call callFunction() which drive the information to display on page PrintMicroResult?

Can any one help me to make the task successful?

I appreciate the time you have taken.

Thanks a lot.

Cheers
Renu

Hi all,

Task:

When user click a button the current window has to be closed and a new window should open to display information. I have to call a function to do certain task before closing this window and opening new.

Problem:

So in the click event of button i wrote:

callFunction();

string script = "@<script>javascript:window.open('PrintMicroResults.aspx','printWindow','toolbar=no,titlebar=no,width=800,height=500,top=50,left=50,scrollbars=yes,resizable=yes');location.href='#';self.close();</script>";

Page.RegisterStartupScript("print", script);

It is closing the current window but not opening the new window for page PrintMicroResults.

I tried the same window.open with <A> in the client side script and its woking very well. i mean its opening new window for my page and closing the current.

But if i use anchor how do i call callFunction() which drive the information to display on page PrintMicroResult?

Can any one help me to make the task successful?

I appreciate the time you have taken.

Thanks a lot.

Cheers
Renu
Follow us on twitter Subscribe to our RSS feed
Activate your free membership today | Login | Currency