Saturday, March 24, 2012

ModalPopup

hi guys,

I copied the tool kit dll and I tried the modal popup. I made it work but the modal window is displayed somewhere on the right hand side corner and only cancel button is visible. How can I make it to be displayed in the center?

Second, how can I make the window to be disabled when the poup is shown? please advice. Thanks a lot!

here is the html code:

<atlasToolkit:ModalPopupExtenderID="ModalPopupExtender"runat="server"><atlasToolkit:ModalPopupPropertiesTargetControlID="LinkButton1"PopupControlID="Panel1"BackgroundCssClass="modalBackground"DropShadow="true"OkControlID="OkButton"OnOkScript="onOk()"CancelControlID="CancelButton"/></atlasToolkit:ModalPopupExtender>

<

divstyle="display:none;"><center><divID="Panel1"class="modalPopup">

POP UP

<asp:Buttonid="OkButton"runat="server"text="OK"></asp:Button><asp:Buttonid="CancelButton"runat="server"text="Cancel"></asp:Button></div></center</div>

<

asp:LinkButtonid="LinkButton1"runat="server"text="Click here to view modal popup"></asp:LinkButton></p>

Please help! Also is there anay way when I click on the linkbutton, perform somejavascript that populates the popup window content?

Thanks lot!

Hi

Can you make sure you have the correct css in place e.g

/*Modal Popup*/
.modalBackground {
background-color:Gray;
filter:alpha(opacity=70);
opacity:0.7;
}

.modalPopup {
background-color:#ffffdd;
border-width:3px;
border-style:solid;
border-color:Gray;
padding:3px;
}

This should make it dispkay correctly.

HTH


As for your second question you could have script such as

function SetModalContent()

{

$('Panel1').innerHTML = "YOU CONTENT HERE";

}

and then just add the call to this function on your linkbuton.


I have the same problem. But my popupbox is shown in the upper left corner.

I have copied the code and the css, but I still have this problem.

And the background is doesn't change color when the popup is shown.

I have downloaded all the ATLAStoolkit examples. If I run that code modalpopup works as it should.

I think I have missed a little thing but what ?


Sorry - I solved the problem myself.

For som reason I had a space between ! and DOCTYPE in<!DOCTYPE ...


can you send me the html part of your code?


There is a bug in the ModalPopup JS that causes it to popup in the top left corner of the screen if the doctype is incorrect or if no doctype is used. The solution to this problem is posted here

http://forums.asp.net/thread/1322436.aspx

Just replace the javascript and rebuild the AtlasControlToolkit project.

No comments:

Post a Comment