|
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!
|
|
|
|
|
Hi Kenvord,
I want to navigate to the last page programatically. Think this would be achived by the CurrentPage property but this is a readonly property. How to do this?
|
|
|
|
|
Hi,
This is a great control too bad it didn't work in VS2005 or VS2008. VS tries to convert the project but it generates errors. If the author can go through this conversion process, it will be a great service to those who are looking for this functionality on their websites.
|
|
|
|
|
I use this control without conversion on VS2005 Web projects - not an issue.. No dis intended here but if you want to update it.. you should do it .. the Author I am sure is as busy as the rest of us.
I update code when it is needed and if someone wants it - I post it back..
mailalosh wrote: This is a great control too bad it didn't work in VS2005 or VS2008. VS tries to convert the project but it generates errors. If the author can go through this conversion process, it will be a great service to those who are looking for this functionality on their websites.
|
|
|
|
|
How can I display several messagens using popUpWin ?
I need to read one or more messagens from a database and then display then to the user...
Thank you.
|
|
|
|
|
Hi,
Great Work.
Everything works fine but there is one problem which might be a serious one.
The popup control automaticallt pops up on postback. This happens even in the demo project u have posted.
Procedure i followed with ur demo project to get this problem :
After loading the site i click the popup button its fine now and the controls pops up the message. But when i refresh the page the popup control pops up again which is not intended i think this shouldn't happen.
I think there should be a solution for this.
Please let me know how can this b solved.
Waiting for ur reply
Thanks for the article.
Regards,
Govardhana Reddy R
apondu@gmail.com
http://www.apondu.50megs.com
|
|
|
|
|
The Download file is CxImage Demo,is not popup controls. Oh!~~~ my god!~``
I need Popup ,no other.
sra
|
|
|
|
|
Hhmm.. I just downloaded then and it worked for me.. try again now..
Regards,
Michael Davey
biproject.com rss and blog news in a more palatable format
mobile edition now available!
|
|
|
|
|
I was looking for a popup control to display an alert on a button click. Will this work in such cases.?
Joe
|
|
|
|
|
Did you get an answer to this? I am about to integrate the same thing with a button click calling the pop up. Let me know if you have had any success and I will do the same.
|
|
|
|
|
Yes I used it successfully in my app. But it doesn't have that aesthetic appeal. I don't remember exactly how I set it up. I think I just read the topic and followed the instructions. If you get any problems let me know I will look at it again.
|
|
|
|
|