window.open in c# using RegisterClientScriptBlock opens window in minimized

Hello Friends

I am developing web application using Win XP, IIS, C#, Sql Server etc. Now I have one button on to my web page when user click it, i do some operation on server side and then opens into a new window.

So I have opened the window by using c#  and by RegisterClientScriptBlock.... But when it opens, it opens properly but get minimize to the taskbar. I wanted it to remain open or restore, So if anybody have an idea, Please let me know soon.

My code to open new window..

string script = String.Format("window.open('ChildWindow.aspx',null,'height=550, width= 550, status=yes, resizable= no, scrollbars= no, toolbar= no,menubar= no');");
this.Page.ClientScript.RegisterStartupScript(this.GetType(), "123", script, true);

Thank you in advance..

 

-2
Chinoo007
2/25/2008 6:44:31 AM
asp.net.client-side 24353 articles. 1 followers. Follow

12 Replies
7693 Views

Similar Articles

[PageSpeed] 18

Try: window.open(...).focus();

Mark replies as answers if they helped you solve the problem.
0
siva_sm
2/25/2008 8:33:12 AM

i think this article will help you alot and you will find your anmswer there :

http://www.codeproject.com/KB/aspnet/Tibs_Tricks_In_ASPNET.aspx


Mark As Answer If my reply helped you.
0
darsho
2/25/2008 8:35:26 AM

try

 String vv = @"function OpenWin(){           var win =          window.open('B.aspx',null,'height=300,width=460');          window.opener = win;          }         
 window.onload = OpenWin;";    
Page.ClientScript.RegisterStartupScript(this.GetType(), "New Window", vv, true); 

 


Shawpnendu Bikash Maloroy
http://shawpnendu.blogspot.com
0
shawpnendu
2/25/2008 9:30:38 AM

 Thanks for your suggestion.

 But it is not working.

 

1
Chinoo007
2/25/2008 1:47:56 PM

Try this. I just tried it and it works for me.

string script = "var windowRef = window.open('ChildWindow.aspx',null,'height=550, width= 550, status=yes, resizable= no, scrollbars= no, toolbar= no,menubar= no');";
script += "windowRef.focus();";
this.Page.ClientScript.RegisterStartupScript(this.GetType(), "123", script, true);

NC...

0
NC01
2/25/2008 1:52:28 PM

any progress...?


Mark As Answer If my reply helped you.
0
darsho
2/26/2008 7:25:54 AM

window.open has another property called 'alwaysRaised' u can use that.

 So u'r code would be

string script = String.Format("window.open('ChildWindow.aspx',null,'height=550, width= 550, status=yes, resizable= no, scrollbars= no, toolbar= no,menubar= no,alwaysRaised=1');");
this.Page.ClientScript.RegisterStartupScript(this.GetType(), "123", script, true);

0
Chaitra
2/26/2008 9:34:58 AM

Try this 

window.open('Defualt.aspx','Default','maximize=true,top=200,left=200,height=150px,width=600px, titlebar = no, status=yes,resizable=no,toolbar=no,menubar=no,location=yes,directories=no,fullscreen=false, scrollbars=yes, location=yes'); 

0
itsnasir
2/26/2008 9:50:28 AM

 Hi

Thanks for your help.

But i really not able to understand why it is not working for me.

 

 

     

0
Chinoo007
2/28/2008 6:29:02 AM

 Thanks budy

but it not working for me :(  

0
Chinoo007
2/28/2008 6:30:08 AM

Hi,

Check  the application in some other system, and check for the same issue 


N.P.Senthil
Software Engineer
0
nps
2/28/2008 6:48:48 AM

I just posted this solution for that: http://forums.asp.net/t/1225564.aspx

NC...

 

0
NC01
2/28/2008 6:54:29 PM
Reply:

Web resources about - window.open in c# using RegisterClientScriptBlock opens window in minimized - asp.net.client-side

Resources last updated: 1/11/2016 5:03:27 AM