|
Rank: Member Groups: Member
Joined: 10/15/2007 Posts: 8
|
Hello, I am attempting to use the Dialog control in a DNN module with standard ASP.NET validation controls. The Dialog does appear, but before the client-side validation is performed. (i.e. required field validators). In addition, the code in the cmdSaveAndAdd button is not excecuting after I click the AcceptButton - cnd1
Code: HTML/ASPX
<eo:Dialog ID="Dialog1" runat="server" BackColor="White" Height="200px" Width="300px"
AcceptButton="cnd1" AcceptButtonPostBack="True" CancelButton="cmd2" ShowButton="cmdSaveAndAdd"
BackShadeColor="Silver" BorderColor="Lime" BorderStyle="Dotted" BorderWidth="4px"
HeaderHtml="Whatever" ShadowColor="224, 224, 224" ShadowDepth="3">
<ContentTemplate>
Are you Sure?
<asp:Button ID="cnd1" runat="server" Text="OK" />
<asp:Button ID="cmd2" runat="server" Text="Cancel" />
</ContentTemplate>
<CloseEffect Type="GlideTopToBottom" />
<DesignOptions BackColor="Gold" />
<HeaderStyleActive CssText="background-color:#c0ffc0;" />
</eo:Dialog>
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi,
That is normal. :) Try to clear ShowButton property and then set the dialog's IntialState to Visible inside your server side cmdSaveAndAdd handler.
You can either display a dialog from server side code or from client side. When you set the dialog's ShowButton, it would hijack that button and use that button solely to display the dialog from the client side. So whatever logic that is original associated with the button will be lost. As soon as you clear ShowButton, all your original logics should start to work, including the validators.
Thanks
|
|
Rank: Member Groups: Member
Joined: 10/15/2007 Posts: 8
|
Hi,
Thanks foir the explanation - but I'm still a bit confused. Can you please post a real basic sample showing the following scenario.
Scenario: When a user clicks a Delete button on form (i.e. cmdDelete), they are prompted with an EO:Dialog control with these properties:
1. A dialog control with an OK and Cancel button and text "Confirm Deletion" 2. When OK is pressed, server side code is executed. (in my example, I would run code to delete a record from the database).
If such a sample exists in the demo code that shipped with the product, please tell me where I can find it. I had a look but could not find anything like this in the samples.
Thanks in advance.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi,
We don't have such an example but it's really simple. All you need to do is to put a regular ASP.NET button inside your dialog. Do not set AcceptButton or AcceptButtonPostBack. That way when you click the button, the page will post back and the dialog will close.
The difficult part is to provide a handler for the button. In our current build you won't be able to directly hook up an event handler to the button from the form designer since it is inside the dialog's ContentTemplate, not directly inside the form. So you would need to manually hook up the event handler. We have a new version that will come out in a few days. With that version you won't need to hook up the event handler manually. So I would recommend you to wait for that version.
Thanks
|
|
Rank: Member Groups: Member
Joined: 10/15/2007 Posts: 8
|
Thanks - I'll be looking forward to the new release !
|
|