Setting height and width of window opened by hyperlink

  • Thread starter Thread starter Mike P
  • Start date Start date
M

Mike P

I am adding a hyperlink to a table and I want the hyperlink to open a
window with height and width I can set myself when it is clicked :

HyperLink hypGetExtractSQL = new HyperLink();

hypGetExtractSQL.Target = "_blank";
hypGetExtractSQL.ImageUrl =
"~/images/btnGetExtractSQL.jpg";
hypGetExtractSQL.NavigateUrl =
"~/secure/GetExtractSQL.aspx?guid=" + dr["CountID"].ToString();

htw.Write("</tr>");

pnlContent.Controls.Add(new
LiteralControl(sw.ToString()));

Is it possible to do this, or do I need to use a different approach?
 
Mike P said:
I am adding a hyperlink to a table and I want the hyperlink to open a
window with height and width I can set myself when it is clicked :

HyperLink hypGetExtractSQL = new HyperLink();

hypGetExtractSQL.Target = "_blank";
hypGetExtractSQL.ImageUrl =
"~/images/btnGetExtractSQL.jpg";
hypGetExtractSQL.NavigateUrl =
"~/secure/GetExtractSQL.aspx?guid=" + dr["CountID"].ToString();

htw.Write("</tr>");

pnlContent.Controls.Add(new
LiteralControl(sw.ToString()));

Is it possible to do this, or do I need to use a different approach?

Yes, you need a different approach. Instead of a hyperlink with
target=_blank, you will need to add a little bit of javascript to the
cient-side onclick event of the hyperlink. The javasript would be a
window.open(...), where one of the parameters lets you set (among other
things) the height and width of the opened 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

Back
Top