|
Rank: Member Groups: Member
Joined: 1/16/2009 Posts: 22
|
Based on the documentation, the following dialog box should show, yet it doesn't work. I need a code behind solution in c# that displays the dialog. How come there isn't a dialog.show method or something simular? Thanks in advance.
using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls;
public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) {
} protected void Button1_Click(object sender, EventArgs e) { Dialog1.InitialState = EO.Web.DialogState.Visible; Dialog1.Visible = true; } }
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="EO.Web" Namespace="EO.Web" TagPrefix="eo" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <div> <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" /> <eo:Dialog ID="Dialog1" runat="server" BackColor="White" ContentHtml="hi" Height="200px" Width="300px"> </eo:Dialog> </div> </form> </body> </html>
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi, Your code is correct, but you will need to style and fill the dialog. Your dialog should be working but it has neither contents nor style, so it is basically a transparent and empty block. Thus you won't see it. You can take a look of these topics as to how to set the dialog's style and content: http://doc.essentialobjects.com/library/1/dialog/dialog_style.aspxhttp://doc.essentialobjects.com/library/1/dialog/dialog_ui.aspxYou can also copy the dialog directly from the sample project to see how it works. The full source code of the sample project is installed on your machine. You can load it by going to Start -> All Programs -> EO.Web Controls 7.0 (2009) -> EO.Web Controls for ASP.NET xxx -> Live Demo, then choose one of the source code shortcut. Thanks!
|
|
Rank: Member Groups: Member
Joined: 1/16/2009 Posts: 22
|
Hi,
I made the changes you stated and it did work. This was my attempt to see if I could just get it to display. My actual project as the dark_blue style and contect dialog box that is called from an eo callback and the same code that I'm using from a button click doesn't appear to work from the callback control. Also note, that my dialog and callback control are within a ascx user control. Based on the page source, the control exists, but never displays. If I use the "Show Model" hyperlink that calls that java code as in the samples, it works, but the code behind that I presented in my example (Dialog1.InitialState = EO.Web.DialogState.Visible; Dialog1.Visible = true;) doesn't display the dialog control. Ideas?
Thanks,
Wayne
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
Your code is correct. Just make sure you have the dialog inside the CallbackPanel. Otherwise nothing will happen.
Thanks!
|
|
Rank: Member Groups: Member
Joined: 1/16/2009 Posts: 22
|
Hi,
I went back to check it and the dialog was outside the callbackpanel, no wonder it didn't work. It's working now. Much thanks!
Wayne
|
|