Question

I use a modal popup extender, i followed all the instructions on the toolkit sample page, except that i didn't set the property BackgroundCssClass.

this is what happens: alt text

Is there a way I can get rude of it without setting the cssclass prop? I don't need any styles.

If the answer is NO then please show me an example how to set it with a cssclass (even dummy).

Thanks in advance.

Here is the code:

<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div>
    <div style="size: 100%; vertical-align: middle">
        <asp:LinkButton ID="lnkUpload" Text="Upload" ToolTip="Upload new file" runat="server" OnClick="lnkUpload_Click" />
        <cc1:ModalPopupExtender ID="lnkUpload_ModalPopupExtender" runat="server" Drag="true" PopupDragHandleControlID="pnlUploadTitle" DynamicServicePath="" PopupControlID="pnlUpload" Enabled="True" TargetControlID="lnkUpload" CancelControlID="btnCancel" />
    </div>
    <asp:Panel ID="pnlUploadTitle" runat="server" Visible="false">
        <center>
            Upload file
        </center>
    </asp:Panel>
    <asp:Panel ID="pnlUpload" runat="server" Visible="false">
        <center>
            <br />
            <asp:FileUpload ID="upFiles" runat="server" /><br />
            <br />
            <asp:Button ID="btnUpload" runat="server" Text="Upload" OnClick="btnUpload_Click" />
            &nbsp;<asp:Button ID="btnCancel" runat="server" Text="Cancel" />
            <br />
        </center>
    </asp:Panel>
</div>
</form>
Was it helpful?

Solution

You can set the ModalPopupExtender's backgroundCssClass within the actual HTML markup.

Example from the asp.net modal popup page:

<ajaxToolkit:ModalPopupExtender ID="MPE" runat="server"
TargetControlID="LinkButton1"
PopupControlID="Panel1"
**BackgroundCssClass="modalBackground"** 
DropShadow="true" 
OkControlID="OkButton" 
OnOkScript="onOk()"
CancelControlID="CancelButton" 
PopupDragHandleControlID="Panel3" />

OTHER TIPS

I spent ages looking up a solution for the similar problem Set your PopUpControlId to be the ClientID of the control.

It solved the problem for me.

Also read more on: Codeplex

Ha-ha, I remember more then 2 years ago in AJAX beta not setting the BackgroundCssClass property caused modal popup not to be really modal, but just popup. I remember setting a style class solved the problem. I haven't used AJAX for a long time, it's funny if similar problems still persist. Anyway, create stylesheet class inside your ASPX page or in CSS file referenced form it and set the property value to it. Maybe, this will also help.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top