Popup window width

G

Guest

I'm having trouble changing the width of my pop up window. Changing the width
has no effect.

private void LinkButton1_Click(object sender, System.EventArgs e)
{

string script = "<script language=\"javascript\">";

script += "var winOptions = 'fullscreen=no,
channelmode=no,status=no,toolbar=no,
menubar=no,location=no,directories=no,height=200,width=50,resizable=no,scrollbars=yes';";

script += "var target = '_blank';";

script += "window.open('ActiveVendors.aspx', 'target', 'winOptions')";

script += "</script>";

Page.RegisterStartupScript("winOpen", script);

Response.Redirect("ActiveVendors.aspx");

}
 
D

D0tN3t C0d3r

Hi Newbie,

2 questions:
1. Are you doing this in code behind or inline with your aspx code?
2. If you are doing this in code behind, are you recompiling after you
change the width?

I tested it here and had no problems changing the width of my popup.

~d
 
G

Guest

Hi D0tN3t C0d3r,

I'm using code behind. Yes, I am rebuilding after changing the width. I also
commented out the last line below: Response.Redirect("ActiveVendors.aspx");
The reason why it has to be commented out is bec. the window that calls the
popup window (ActiveVendors.aspx) has to remain open while the popup is also
open.
Another problem I have is that the popup window doesnt have a vertical
scrollbar even though the DataGrid doesnt fit the window.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top