Saturday, November 25, 2006

How to create popup on defined size for an hyperlink

Lets asume we have an asp hyperlink control named/id "HyperLink_Download" in your page. And when u click it u want to open a popup with a defined size in another window, and it should not show the link properties in status bar.


Here is an example.
HyperLink_Download.Attributes.Add("onclick",
"DownloadFile_Handle=window.open('URL',
'DownloadFile',
'resizable=no, scrollbars=no, status=no, toolbar=no, height=1, width=1, left=1, top=1 '); DownloadFile_Handle.close(); return true;");
HyperLink_Download.Attributes.Add("onmouseover", "window.status='Click Here to Download File.';return true");
HyperLink_Download.Attributes.Add("onmouseout", "window.status=''; return true;");


DownloadFile_Handle : It is the handle for the opoup so that u can do any action if you want with it.
DownloadFile : this is the target location where the popup will open. if u have any target location like this the popup willopen in that if not it will open in a new window.
the best thing is that even though u clicked the same link more than one time, u wont be getting diffrent popup, the same popup which is opened will reload again and again

0 Comments:

Post a Comment

<< Home