|
|
Cool
|
|
|
|
|
Hi,
How can I run/display popupWin from within Javascript function?
This code only shows the window without effects.
document.getElementById("popupWin").style.display = ""
document.getElementById("popupWin").style.visibility = "visible";
Thanks
|
|
|
|
|
hello,
i am using this for displying help on each control. for this i have added help button next to each control and on that control poping up help message.
now i have draged one PopupWinAnchor, PopUpWin and it working great for one button but i want to use same these control for showing up diffrent help text and diffrent help button.
how can i do this?
~ Vivek
|
|
|
|
|
Please help me, how can use the control with AJAX interactive page or into a UPDATEPANEL?
|
|
|
|
|
You will need to use the Trigger PostBackTrigger and not AsyncPostBackTrigger.
|
|
|
|
|
is it possible to make it popup even the browser is minimize?
just like what mozilla does in the download complete popup box....
|
|
|
|
|
|
i tried this control with ajax but its not working
modified on Saturday, September 20, 2008 5:30 AM
|
|
|
|
|
How to show the popwin if a button is inside an update Panel ? Is this possible ?
Thanks
|
|
|
|
|
Even I have the same question. Any solution?
Regards
|
|
|
|
|
Hi All,
PLace this code to demo and noticed that the zorder is off, the popup gets rendered behind drop down list boxes and possibly other controls.
O played with the z-order property, setting other controls to negative but the popup still appears behing the drop down list controls?
you can see this effect by running the demo page with drap and drop enabled,
on win xp sp 2 ie 6.0.2900, possibly other web versions as well.
anyone see this and have a possible fix ?
|
|
|
|
|
I need some form of popup that will display a text message, and allow the user to click OK or Cancel.
In a win desktop application it's called a dialog box.
Additionally, I need to trap the user selection back at the server, pref in vb.net code.
Any ideas?
thanks
|
|
|
|
|
HI,
Can i use this code as part of my application. There are no details in the downloaded project.
Thanks,
Dev.
|
|
|
|
|
Hi Tomas,
Thank you for this wonderful piece of code. When i used this code in my application, its working fine in my machine, but when i deployed the application in the server, its not working. I have used a timer to show popup in interval of 3 minutes. Can you suggest a solution ? Thanks in advance
|
|
|
|
|
I heed a help.I have to display an image in popup window.I don't know how to do.plz kindly help me
|
|
|
|
|
Can you please tell me if I am able to use this control with Ajax AsyncPostBack Trigger and how. Apart from this It is working fine. Expecting your reply very soon.
Thanks.
Gopal
|
|
|
|
|
|
Can someone post code to modify this control to allow for other controls to be placing inside this Popup. I saw a Message from PaigePB back in 2005 but it wasnt very clear. Can someone either message me or post the code or the actual control to perform this task. Thanks in advance.
PDS
|
|
|
|
|
Is it possible to put more than text into this popup, say a radio list datagrid.... etc..?
|
|
|
|
|
In the "PopupWin.cs", replace the "Render" function by this one:
protected override void Render(HtmlTextWriter output)
{
string br=Page.Request.Browser.Browser;
string script=sScript,sps=spopStyle;
string acmd="";
switch(popAction)
{
case PopupAction.MessageWindow:
acmd=aCommands.Replace("[cmd]","javascript:[id]espopup_ShowWindow();");
script=script.Replace("[slink]","");
script=script.Replace("[sclose]","");
break;
case PopupAction.RaiseEvents:
acmd=aCommands.Replace("[cmd]","javascript:[id]espopup_ShowWindow();");
string scriptClick=(LinkClicked==null)?"":
(Page.GetPostBackClientEvent(this,"C")+"; return;");
string scriptClose=(PopupClosed==null)?"":
(Page.GetPostBackClientEvent(this,"X")+"; return;");
script=script.Replace("[slink]",scriptClick);
script=script.Replace("[sclose]",scriptClose);
break;
case PopupAction.OpenLink:
acmd=aCommands.Replace("[cmd]",sLink);
script=script.Replace("[slink]","");
script=script.Replace("[sclose]","");
if (sTarget!="") acmd+=" target=\""+sTarget+"\"";
break;
}
sps=sps.Replace("[gs]",gradientStart);
sps=sps.Replace("[ge]",gradientEnd);
sps=sps.Replace("[clr]",textColor);
script=script.Replace("[winstyle]",String.Format(
"width={0},height={1},scrollbars={2}",winSize.Width,
winSize.Height,(winScroll?"yes":"no")));
script=script.Replace("[hide]",iHide.ToString());
script=script.Replace("[stime]",startTime.ToString());
script=script.Replace("[id]",ClientID);
script=script.Replace("[ie]",(br=="IE"?"true":"false"));
script=script.Replace("[popup]",String.Format(sPopup,fullmsg,title,sps));
script=script.Replace("[autoshow]",bAutoShow.ToString().ToLower());
script=script.Replace("[speed]",iSpeed.ToString());
string divPos=String.Format("width:{0}; height:{1}; ",Width,Height);
string cntsI=String.Format(cntStyleI,Width.Value-6,Height.Value-24);
string cntsN=String.Format(cntStyleN,Width.Value-10,Height.Value-28);
string sDragDrop="";
if (bDragDrop)
sDragDrop=" onmousedown=\"return "+ClientID+"espopup_DragDrop(event);\" ";
if (popDock==PopupDocking.BottomLeft) divPos+="left:"; else divPos+="right:";
divPos+=string.Format("{0}px; bottom:{1}px;",xOffset,yOffset);
script = (script + String.Format("<div id=\"{0}\" " +
"style=\"display:none; {1} {2}\" onselectstart=\"return false;\" {4}>"+
"<div id=\"{3}\" style=\"cursor:default; display:none; {5}\">{6}</div>"+
"<div id=\"{7}\" onmousedown=\"event.cancelBubble=true;\" style=\"display:none; {8}\">"+
((bShowLink==true)?
"<a style=\"{9}\" {10} id=\"{11}\">{12}</a></div></div>":
"<span style=\"{9}\" id=\"{11}\">{12}</span></div></div>"),
ClientID,PutColors(divDesign),divPos,ClientID+"_header",sDragDrop,PutColors(hdrStyle).
Replace("[wid]",(Width.Value-6).ToString())+PutColors(aStyle),
"<span id=\""+ClientID+"titleEl\">"+title+"</span>"+PutColors(closeHtml).Replace("[id]",ClientID),ClientID+"_content",
PutColors(cntStyle)+((br!="Netscape"&&br!="Mozilla")?cntsI:cntsN),PutColors(aStyle),
acmd.Replace("[id]",ClientID),ClientID+"aCnt",msg));
int contentlocation = script.LastIndexOf("</a>");
string prescript = script.Substring(0, contentlocation);
string postscript = script.Substring(contentlocation, script.Length - (contentlocation));
output.Write(prescript);
base.Render(output);
output.Write(postscript);
}
Then you can add any controls inside the PopupWin control like this (aspx file):
<cc3:PopupWin ID="PopupWin1" Visible="false" runat="server" OffsetX="5" OffsetY="5" ActionType="RaiseEvents" ColorStyle="Blue" LinkTarget="_blank" Text="" Title="" HideAfter="10000" PopupSpeed="5" ShowAfter="500">
<br /><br /><div style="z-index "><asp:Label ID="Label1" runat="server" Text="Label"></asp:Label></div>
</cc3:PopupWin>
|
|
|
|
|
I tried this and it doesn't quite work
What I did was paste your code mod into the source file, recompiled to create a new dll.
I copied that dll to the demo folder, /bin and replaced the existing dll.
In the aspx file I pasted your 2nd code sample when I try to build I get all sort of error messages
Error 1 Type 'EeekSoft.Web.PopupWin' does not have a public property named 'br'.
Error 2 Type 'EeekSoft.Web.PopupWin' does not have a public property named 'div'.
Error 3 Type 'EeekSoft.Web.PopupWin' does not have a public property named 'Label'.
what am missing here?
|
|
|
|
|
Hi,
few things need changing apart from whats said,
first
Replace
public class PopupWin : System.Web.UI.WebControls.WebControl, IPostBackEventHandler
with
public class PopupWin : System.Web.UI.WebControls.PlaceHolder, IPostBackEventHandler
It should be something like this
public class PopupWin : System.Web.UI.WebControls.PlaceHolder, IPostBackEventHandler
{
//Contents goes here
}
Add 2 variables
public Unit Height;
public Unit Width;
once that is done, it should look like this
public class PopupWin : System.Web.UI.WebControls.PlaceHolder, IPostBackEventHandler
{
#region Private variables, constants and constructor
public Unit Height;
public Unit Width;
//Contents goes here
}
Now replace the entire render method with the below
protected override void Render(HtmlTextWriter output)
{
string br=Page.Request.Browser.Browser;
string script=sScript,sps=spopStyle;
string acmd="";
switch(popAction)
{
case PopupAction.MessageWindow:
acmd=aCommands.Replace("[cmd]","javascript:[id]espopup_ShowWindow();");
script=script.Replace("[slink]","");
script=script.Replace("[sclose]","");
break;
case PopupAction.RaiseEvents:
acmd=aCommands.Replace("[cmd]","javascript:[id]espopup_ShowWindow();");
string scriptClick=(LinkClicked==null)?"":
(Page.GetPostBackClientEvent(this,"C")+"; return;");
string scriptClose=(PopupClosed==null)?"":
(Page.GetPostBackClientEvent(this,"X")+"; return;");
script=script.Replace("[slink]",scriptClick);
script=script.Replace("[sclose]",scriptClose);
break;
case PopupAction.OpenLink:
acmd=aCommands.Replace("[cmd]",sLink);
script=script.Replace("[slink]","");
script=script.Replace("[sclose]","");
if (sTarget!="") acmd+=" target=\""+sTarget+"\"";
break;
}
sps=sps.Replace("[gs]",gradientStart);
sps=sps.Replace("[ge]",gradientEnd);
sps=sps.Replace("[clr]",textColor);
script=script.Replace("[winstyle]",String.Format(
"width={0},height={1},scrollbars={2}",winSize.Width,
winSize.Height,(winScroll?"yes":"no")));
script=script.Replace("[hide]",iHide.ToString());
script=script.Replace("[stime]",startTime.ToString());
script=script.Replace("[id]",ClientID);
script=script.Replace("[ie]",(br=="IE"?"true":"false"));
script=script.Replace("[popup]",String.Format(sPopup,fullmsg,title,sps));
script=script.Replace("[autoshow]",bAutoShow.ToString().ToLower());
script=script.Replace("[speed]",iSpeed.ToString());
string divPos=String.Format("width:{0}; height:{1}; ",Width,Height);
string cntsI=String.Format(cntStyleI,Width.Value-6,Height.Value-24);
string cntsN=String.Format(cntStyleN,Width.Value-10,Height.Value-28);
string sDragDrop="";
if (bDragDrop)
sDragDrop=" onmousedown=\"return "+ClientID+"espopup_DragDrop(event);\" ";
if (popDock==PopupDocking.BottomLeft) divPos+="left:"; else divPos+="right:";
divPos+=string.Format("{0}px; bottom:{1}px;",xOffset,yOffset);
script = (script + String.Format("<div id=\"{0}\" " +
"style=\"display:none; {1} {2}\" onselectstart=\"return false;\" {4}>"+
"<div id=\"{3}\" style=\"cursor:default; display:none; {5}\">{6}</div>"+
"<div id=\"{7}\" onmousedown=\"event.cancelBubble=true;\" style=\"display:none; {8}\">"+
((bShowLink==true)?
"<a style=\"{9}\" {10} id=\"{11}\">{12}</a></div></div>":
"<span style=\"{9}\" id=\"{11}\">{12}</span></div></div>"),
ClientID,PutColors(divDesign),divPos,ClientID+"_header",sDragDrop,PutColors(hdrStyle).
Replace("[wid]",(Width.Value-6).ToString())+PutColors(aStyle),
"<span id=\""+ClientID+"titleEl\">"+title+"</span>"+PutColors(closeHtml).Replace("[id]",ClientID),ClientID+"_content",
PutColors(cntStyle)+((br!="Netscape"&&br!="Mozilla")?cntsI:cntsN),PutColors(aStyle),
acmd.Replace("[id]",ClientID),ClientID+"aCnt",msg));
int contentlocation = script.LastIndexOf("</span>");
string prescript = script.Substring(0, contentlocation);
string postscript = script.Substring(contentlocation, script.Length - (contentlocation));
output.Write(prescript);
base.Render(output);
output.Write(postscript);
}
That should do the trick, let me know if you have issues...
|
|
|
|
|
The code pasted above can be copied directly from the following CODE BLOCK and pasted into your code file.
protected override void Render(HtmlTextWriter output)
{
string br=Page.Request.Browser.Browser;
string script=sScript,sps=spopStyle;
string acmd="";
switch(popAction)
{
case PopupAction.MessageWindow:
acmd=aCommands.Replace("[cmd]","javascript:[id]espopup_ShowWindow();");
script=script.Replace("[slink]","");
script=script.Replace("[sclose]","");
break;
case PopupAction.RaiseEvents:
acmd=aCommands.Replace("[cmd]","javascript:[id]espopup_ShowWindow();");
string scriptClick=(LinkClicked==null)?"":
(Page.GetPostBackClientEvent(this,"C")+"; return;");
string scriptClose=(PopupClosed==null)?"":
(Page.GetPostBackClientEvent(this,"X")+"; return;");
script=script.Replace("[slink]",scriptClick);
script=script.Replace("[sclose]",scriptClose);
break;
case PopupAction.OpenLink:
acmd=aCommands.Replace("[cmd]",sLink);
script=script.Replace("[slink]","");
script=script.Replace("[sclose]","");
if (sTarget!="") acmd+=" target=\""+sTarget+"\"";
break;
}
sps=sps.Replace("[gs]",gradientStart);
sps=sps.Replace("[ge]",gradientEnd);
sps=sps.Replace("[clr]",textColor);
script=script.Replace("[winstyle]",String.Format(
"width={0},height={1},scrollbars={2}",winSize.Width,
winSize.Height,(winScroll?"yes":"no")));
script=script.Replace("[hide]",iHide.ToString());
script=script.Replace("[stime]",startTime.ToString());
script=script.Replace("[id]",ClientID);
script=script.Replace("[ie]",(br=="IE"?"true":"false"));
script=script.Replace("[popup]",String.Format(sPopup,fullmsg,title,sps));
script=script.Replace("[autoshow]",bAutoShow.ToString().ToLower());
script=script.Replace("[speed]",iSpeed.ToString());
string divPos=String.Format("width:{0}; height:{1}; ",Width,Height);
string cntsI=String.Format(cntStyleI,Width.Value-6,Height.Value-24);
string cntsN=String.Format(cntStyleN,Width.Value-10,Height.Value-28);
string sDragDrop="";
if (bDragDrop)
sDragDrop=" onmousedown=\"return "+ClientID+"espopup_DragDrop(event);\" ";
if (popDock==PopupDocking.BottomLeft) divPos+="left:"; else divPos+="right:";
divPos+=string.Format("{0}px; bottom:{1}px;",xOffset,yOffset);
script = (script + String.Format("<div id=\"{0}\" " +
"style=\"display:none; {1} {2}\" onselectstart=\"return false;\" {4}>"+
"<div id=\"{3}\" style=\"cursor:default; display:none; {5}\">{6}</div>"+
"<div id=\"{7}\" onmousedown=\"event.cancelBubble=true;\" style=\"display:none; {8}\">"+
((bShowLink==true)?
"<a style=\"{9}\" {10} id=\"{11}\">{12}</a></div></div>":
"<span style=\"{9}\" id=\"{11}\">{12}</span></div></div>"),
ClientID,PutColors(divDesign),divPos,ClientID+"_header",sDragDrop,PutColors(hdrStyle).
Replace("[wid]",(Width.Value-6).ToString())+PutColors(aStyle),
"<span id=\""+ClientID+"titleEl\">"+title+"</span>"+PutColors(closeHtml).Replace("[id]",ClientID),ClientID+"_content",
PutColors(cntStyle)+((br!="Netscape" && br!="Mozilla")?cntsI:cntsN),PutColors(aStyle),
acmd.Replace("[id]",ClientID),ClientID+"aCnt",msg));
int contentlocation = script.LastIndexOf("</span>");
string prescript = script.Substring(0, contentlocation);
string postscript = script.Substring(contentlocation, script.Length - (contentlocation));
output.Write(prescript);
base.Render(output);
output.Write(postscript);
}
|
|
|
|
|
I want to pop this up when a user clicks an ImageButton using the OnClientClicked. Is it possible? Also, can I specify where on the screen it displays? I don't want it to come up from the bottom. I want to use it more like a standard popup.
Thanks!
|
|
|
|
|