Hi,
There are many ways to do this and there is nothing particular about the dialog. In another word, whatever scheme way you were using to create any other server control will work with the dialog. We will discuss a few options here so that you get the general idea.
One way to do is to place a dialog inside your master page. You can then reference the dialog in your content page either from code behind or from client side JavaScript.
Another way to do it is to place the dialog inside a user control and then load that user control when you need to.
A third way is to create a function to dynamically create a dialog, set all the properties with code, then add that dialog into your page. You would then call this function whenever you need the dialog.
In all cases, once the dialog is created or loaded, you must be able to get a reference to the dialog so that you will be able to use it (for example, to show it). If you use master page or user control, then you will need to code your master page or user control class so that it exposes the dialog. For example, if you have dialog1 directly in your page, then you can do this:
Code: C#
dialog1.InitialState = EO.Web.DialogState.Visible;
However, if you have user control userControl1 containing dialog1, you will
NOT be able to do this:
Code: C#
userControl1.dialog1.InitialState = EO.Web.DialogState.Visible;
This is because dialog1 is a private member your user control. In order to access the dialog, you can add either expose the dialog directly through a property:
Code: C#
public EO.Web.Dialog TheDialog { get { return dialog1; } }
Or expose a method that does whatever you want to do on the dialog:
Code: C#
public void ShowDialog()
{
dialog1.IntialState = EO.Web.DialogState.Visible;
}
These are added to the user control class so that you will be able to use the dialog from outside.
Hope this helps.
Thanks