Dialog control not working

Mar 7, 2011 at 7:45 PM
Edited Mar 7, 2011 at 8:43 PM

 

<DotNetAge:Dialog ID="DemoDialog" runat="server" Draggable="true" Resizable="false" Title="Server Dialog">
                <Buttons>
                    <DotNetAge:DialogButton Text="OK" OnClientClick="$(this).dialog('close')" />
                </Buttons>
                <BodyTemplate>
                    <div style="padding: 30px;">
                        This is a Dialog shows via Server.
                    </div>
                </BodyTemplate>
            </DotNetAge:Dialog>

 

 

My demo page has the above code and it does not seem to be working. I have tried accordion, it works, tried datepicker, it works. It is only dialog control that is giving me problems. Am I missing anything?

If I comment the above code from demo page, it runs fine. As soon as I add this code and run it, I get error. It is not a asp.net error but javascript error (object required) since my debugger stops in one of the javascript files - (which is combination of all javascripts)

I have added the following references to my project - DNA.dll, DNA.UI.JQuery and Jquery. Do I need anything else?

Oct 14, 2011 at 2:43 AM

The version of the JQuery ASP.NET I use has the Draggable attribute as IsDraggable.  Not sure if this is your problem, but thought I would point it out in case it helps.

Jan 9, 2012 at 1:55 AM

I agree, all my testing of the dialog component has it always stuck in the top left corner, no matter what the position setting is...

using inspect element in Chrome, it always seems to have a "position: relative" where the normal jquery demos have a "position: absolute"

if you navigate to the samples pages the dialog is stuck in the top left...

Any one got it to position elsewhere ?

Jan 17, 2012 at 2:15 AM

you can call javascript function let the dialog in center when the dialog is visiable

in the Page_Load function or button_Click you can write this

Page.ClientScript.RegisterStartupScript(this.GetType(), "setDialogInCenter", "setDialogInCenter();", true);

and the setDialogInCenter (javascript function) like this

function setDialogInCenter() {
        if (typeof ($("div.ui-dialog")[0]) == "undefined") {
            setTimeout(setDialogInCenter, 100);
        }
        else {
            //reference  http://stackoverflow.com/questions/210717/using-jquery-to-center-a-div-on-the-screen
            $("div.ui-dialog").css("position", "absolute");
            $("div.ui-dialog").css("top", (($(window).height() - $("div.ui-dialog").outerHeight()) / 2) + $(window).scrollTop() + "px");
            $("div.ui-dialog").css("left", (($(window).width() - $("div.ui-dialog").outerWidth()) / 2) + $(window).scrollLeft() + "px");
        }
    }

you can write the above function in `Content1` of aspx file

 

<embed id="lingoes_plugin_object" type="application/lingoes-npruntime-capture-word-plugin" width="0" height="0" hidden="true"></embed>
Jan 17, 2012 at 9:06 AM
cdturner wrote:

I agree, all my testing of the dialog component has it always stuck in the top left corner, no matter what the position setting is...

using inspect element in Chrome, it always seems to have a "position: relative" where the normal jquery demos have a "position: absolute"

if you navigate to the samples pages the dialog is stuck in the top left...

Any one got it to position elsewhere ?

I get similar problem. IE and Chrome makes dialog with position: relative, but Firefox with absolute. 

Who knows how to set position absolute for IE and Chrome?