|
Rank: Advanced Member Groups: Member
Joined: 8/26/2009 Posts: 64
|
How do you bring up URL inside MsgBox with server-side code? I set ContentURL then show box from codebehind, but text in Show method overrides.
Code: Visual Basic.NET
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
MsgBox1.Show(Nothing, Nothing, Nothing, New EO.Web.MsgBoxButton("OK"), New EO.Web.MsgBoxButton("Canel")
End Sub
Code: HTML/ASPX
<eo:MsgBox ID="MsgBox1" runat="server" AllowResize="True" BackColor="White"
CloseButtonUrl="00020312" ContentUrl="http://www.google.com"
ControlSkinID="None" HeaderHtml="Dialog Title" Height="216px" Width="320px">
<HeaderStyleActive CssText="background-image:url('00020311');color:black;font-family:'trebuchet ms';font-size:10pt;font-weight:bold;padding-bottom:5px;padding-left:8px;padding-right:3px;padding-top:0px;" />
<BorderImages BottomBorder="00020305" BottomLeftCorner="00020304"
BottomRightCorner="00020306" LeftBorder="00020303" RightBorder="00020307"
TopBorder="00020310" TopLeftCorner="00020301" TopLeftCornerBottom="00020302"
TopRightCorner="00020309" TopRightCornerBottom="00020308" />
<FooterStyleActive CssText="padding-right: 4px; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; padding-top: 4px; font-family: tahoma" />
<ContentStyleActive CssText="padding-right: 4px; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; padding-top: 4px; font-family: tahoma" />
</eo:MsgBox>
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
I don't think you can use ContentUrl with MsgBox. MsgBox control is a Dialog that uses a fixed content template. The fixed content template includes an icon, a message and one or more buttons. So if that template fits your need, you can use use MsgBox. Otherwise you should use the Dialog control.
Thanks!
|
|
Rank: Advanced Member Groups: Member
Joined: 8/26/2009 Posts: 64
|
OK, that is no problem.
Related question -- and I realize already this question is on the fringe.
If I set the contenturl of a dialog box to "http:/www.google.com", I can interact with Google inside the dialog box. This is really great. I presume then that although the control says runat="server", it is not running Google on the server and pushing back the result, or I wouldn't be able to interact with it.
I presume it is running a new client-side instance of browser inside dialog box. True?
If my contenturl refers to an ASPX page on an external server (not localhost), where the site has forms authentication, it redirects me to the login dialog even though I am already logged in. But in this case, it doesn't let me login. Of course, this is not an EO issue at all, so my question is only to understand what browser is showing up inside the dialog box with the contenturl property, because maybe that will give me a clue why I can interact with Google, but not with my ASP website.
Possibly my ASP website is blocking input for security reasons, whereas Google is not.
For my application, it is so much better to bring up related ASPX pages inside the dialog box than in a separate browser window with JS window.open. Not required, but it would be a really nice touch.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
ContentUrl is rendered is a separate iframe. Thus it is a separate page. You will need to code to interact between these pages if needed.
Thanks
|
|
Rank: Advanced Member Groups: Member
Joined: 8/26/2009 Posts: 64
|
OK.
So it the client-side browser right? Browser is not running on server.
It is like an iframe with src="<some url>"?
What I meant is that if my contenturl="http://www.google.com", it comes up in the dialog and I can interact with it (i.e., put in search terms, see results).
But, when I try to put my own ASP page in there, I cannot interact with it and/or they don't come up.
I realize the code to interact with pages is outside scope of this FORUM, but can you tell me what code you meant? Do you mean assigning values to the Dialog control in similar fashion to an iframe?
I apologize in advance if these questions are not precise-enough.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
pghcpa wrote:It is like an iframe with src="<some url>"? Precisely. ContentUrl is never "run" on the server. It is directly pulled by an iframe from your cient side. pghcpa wrote:But, when I try to put my own ASP page in there, I cannot interact with it and/or they don't come up. I would suggest you to try either replacing your ASP.NET page with a simple HTML page and see if it comes up, or replacing the dialog with an iframe to load the same page. That should help you to identify where the problem is. I don't think it has anything to do with the dialog. pghcpa wrote:I realize the code to interact with pages is outside scope of this FORUM, but can you tell me what code you meant? Do you mean assigning values to the Dialog control in similar fashion to an iframe? This is up to you. If you wish to update your main page (which I assume is the page that loads the dialog) when user has logged into from the login page (which I assume is the page that got loaded into the dialog via ContentUrl), then you have a situation where the login page needs to notify your main page that user has just logged in. This is what we meant by interaction between pages. Hope this helps.
|
|
Rank: Advanced Member Groups: Member
Joined: 8/26/2009 Posts: 64
|
Thx. Your explanation of the dialog as a very-enhanced iframe helped.
I am not sure what I did differently, but I have it working now.
|
|
Rank: Advanced Member Groups: Member
Joined: 8/26/2009 Posts: 64
|
OK, I figured out the situation and now need a little more help. (This control is really, really great for my purpose.) If my initial state is visible, or I use dialog1.show() in the page load event, my page comes up blank (except the very first time I use it). Same problem if I set showbutton. But, if I just render my page first, then in codebehind a button put: dialog1.show(), it works every time. This suits my purpose, but have two follow-up questions. 1. I can't get the SaveLocation to work this way. I really need this feature. When I close the dialog, then press the button (with codebehind dialog1.show()) it returns to original spot I set with an anchor. How is SaveLocation intended to work? 2. I can't get any of the show or close effects to work. I populate them, but nothing happens. Maybe these don't work with contenturl?
Code: HTML/ASPX
<eo:Dialog ID="Dialog1" runat="server" BackColor="White" Height="800"
Width="615" AllowResize="True" CloseButtonUrl="00020312"
ContentUrl="getrecc.aspx?r=1" ControlSkinID="None"
HeaderHtml="Your Document" IsModal="True" OffsetX="50" OffsetY="50" SaveLocation="True" AnchorElementID="anchor1" MinimizeButtonUrl="~\images\minimize.gif" RestoreButtonUrl="~\images\restore.gif" ResizeImageUrl="~\images\resize_grip.gif" ConfineElementID="window" InitialState="Visible">
<HeaderStyleActive CssText="background-image:url('00020311');color:black;font-family:'trebuchet ms';font-size:10pt;font-weight:bold;padding-bottom:5px;padding-left:8px;padding-right:3px;padding-top:0px;" />
<BorderImages BottomBorder="00020305" BottomLeftCorner="00020304"
BottomRightCorner="00020306" LeftBorder="00020303" RightBorder="00020307"
TopBorder="00020310" TopLeftCorner="00020301" TopLeftCornerBottom="00020302"
TopRightCorner="00020309" TopRightCornerBottom="00020308" />
<FooterStyleActive CssText="padding-right: 4px; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; padding-top: 4px; font-family: tahoma" />
<ContentStyleActive CssText="padding-right: 4px; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; padding-top: 4px; font-family: tahoma" />
</eo:Dialog>
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
I belive both SaveLocation and effects work only on the client side. No information is being saved during post back for the dialog. So as long as you go back to the server, SaveLocation will stop working.
Effects do not work when you display the dialog from the server either because most user are annoyed first seeing your page reload and then see the dialog show up. Close effect should work if you are not posting the page immediately. If you post the page immediately, the whole page is unloaded before any effects can be played.
Thanks!
|
|