Khopkins32
asked on
Creating Pop Windows in ASPNET C#
Dear Expert,
I am fairly new to .net develop using C# and ASPNET. I have an application were I need to create pop-up window for quick help referencing and hints. I wanted to use either a hyperlink or a link webform control. I am not sure how to go about using either of these control create the desired a pop-up window functionality. I am open to suggestions.
Thanks for the help
-K
I am fairly new to .net develop using C# and ASPNET. I have an application were I need to create pop-up window for quick help referencing and hints. I wanted to use either a hyperlink or a link webform control. I am not sure how to go about using either of these control create the desired a pop-up window functionality. I am open to suggestions.
Thanks for the help
-K
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
First, put the following code somewhere in the <head></head> tags:
<script language="javascript">
function popUp(URL,xsize,ysize)
{
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'width=' + xsize + ',height=' + ysize + ',left = 835.5,top = 475.5');");
}
</script>
Lets say you have some link on your page. Normally, the code would look as follows:
<a href="somepage.html">My other page</a>
Now lets say you want this page to pop-up when you load your server control (which is what I'm assuming you want to do).
Your link would now look like this:
<a href="javascript:popUp('so
Note, the 100 and 100 are the x and y dimensions of the new page. This is handy if you want your pages to appear a certain size.
Hope this helped.
-Eric