Welcome Guest Search | Active Topics | Sign In | Register

Dialog Input Blocker ASP C# IF Else Call? Options
Pointeman
Posted: Monday, April 13, 2009 9:39:52 AM
Rank: Advanced Member
Groups: Member

Joined: 2/27/2009
Posts: 41
I use VS2008 ASP C# .NET 3.5 and use the codebehind page almost exclusively. I need to to call the <eo:Dialog> to open under IF Else conditions like so:

if (User.IsInRole("Administrators"))
{
// open eo.web.editor......
}
else
{
Dialog1 show, open, etc...
}

[asp]
<eo:CallbackPanel runat="server" ID="CallbackPanel1" LoadingDialogID="Dialog1" Triggers="{ControlID:Button1;Parameter:}">
<p>
Some Input:
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox></p>
<p>
<asp:Button ID="Button1" runat="server" Text="Submit"></asp:Button></p>
<p>
<asp:Label ID="lblResult" runat="server"></asp:Label></p>
</eo:CallbackPanel>
<eo:Dialog runat="server" ID="Dialog1" BackShadeColor="Blue">
<ContentTemplate>
<table border="0">
<tr>
<td align="center">
<!-- <img src="Images/loading.gif" /> -->
</td>
</tr>
<tr>
<td>
You do not have sufficient permissions to edit this page!
</td>
</tr>
</table>
</ContentTemplate>
</eo:Dialog>
eo_support
Posted: Monday, April 13, 2009 10:17:34 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

In order to display a dialog from code behind, you would set the dialog's InitialState to EO.Web.DialogState.Visible.

I am not sure about how exactly input blocker is associated with your if else condition though. The code you posted, which I assume you copied from the sample, associates the dialog with a CallbackPanel through the CallbackPanel's LoadingDialogID property. When using that way, the CallbackPanel automatically displays the dialog during the callback. That is exactly the purpose of LoadingDialogID property. It shows a dialog while the CallbackPanel is in progress. This particular usage does not appear to fit your case because yours deals with what to do after the callback (whether the show a dialog or the editor) instead of when the callback is in progress. So you may want to remove that.

Thanks!
Pointeman
Posted: Monday, April 13, 2009 1:27:09 PM
Rank: Advanced Member
Groups: Member

Joined: 2/27/2009
Posts: 41
Are you saying keep only the Dialog code and calling Dialog1.Visible = true ?

[.cs]
}
else
{
Dialog1.Visible = true;
}

[asp]
<eo:Dialog runat="server" ID="Dialog1" BackShadeColor="Red" Visible="false">
<ContentTemplate>
<table border="0">
<tr>
<td align="center">
<!-- <img src="Images/loading.gif" /> -->
</td>
</tr>
<tr>
<td>
You do not have sufficient permissions to edit this page!
</td>
</tr>
</table>
</ContentTemplate>
</eo:Dialog>
eo_support
Posted: Monday, April 13, 2009 1:36:15 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
No. We said you would set the dialog's InitialState to EO.Web.DialogState.Visible. InitialState is a property provided by the dialog. It's not a typo. You should not touch the dialog's Visible property.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.