Welcome Guest Search | Active Topics | Sign In | Register

eo:Dialog show() + server-side functionality Options
Mark Rae
Posted: Saturday, November 15, 2008 4:05:57 AM
Rank: Advanced Member
Groups: Member

Joined: 11/13/2008
Posts: 43
Hi,

Supposing I'm using an eo:Dialog to edit some data but, when the page initially loads, I don't necessarily know what that data is. Therefore, I can't populate the eo:Dialog when the page first loads. Instead, I want to fetch a record from a server-side database when the eo:Dialog is shown.

Is there a built-in method for this, or will I have to write my own AJAX function?

Thanks,

Mark
eo_support
Posted: Saturday, November 15, 2008 6:54:51 AM
Rank: Administration
Groups: Administration

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

The standard approach for this is to use a Button control (or whatever other server control), then handle the Button's Click event and show the dialog by setting the Dialog's InitialState property:

Code: C#
private void Button1_Click(object sender, EventArgs e)
{
    //Load dialog data....
    ......

    //Show the dialog
    Dialog1.InitialState = EO.Web.DialogState.Visible;
}


Whether you would like to use AJAX for this is up to you. You can either use our CallbackPanel or ASP.NET UpdatePanel for that. You would need to put the dialog inside the CallbackPanel/UpdatePanel, then set the button as a trigger.

Hope this helps.

Thanks!
Mark Rae
Posted: Saturday, November 15, 2008 7:02:53 AM
Rank: Advanced Member
Groups: Member

Joined: 11/13/2008
Posts: 43
eo_support wrote:
Whether you would like to use AJAX for this is up to you. You can either use our CallbackPanel or ASP.NET UpdatePanel for that. You would need to put the dialog inside the CallbackPanel/UpdatePanel, then set the button as a trigger.


Excellent response - just what I was looking for.

Thanks very much.
eo_support
Posted: Saturday, November 15, 2008 7:11:44 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
You are very welcome!


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.