Link to home
Start Free TrialLog in
Avatar of tybarton
tybarton

asked on

Modalpopup and dynamic control issue

I am using the modalpopup control as a error message system. In the panel I have a label that will hold the message. In my code behind I set the lable text and then show the modalpopup control.

The issue is that the message is large that the panel so some of the text is hanging outside the panel bounds.

Thanks,
Tyler
Avatar of tybarton
tybarton

ASKER

Edit: I assume that the issue is that the label has not text at the time of creation on the page so the panel when created is sized for that so when I pass in a large exception error messgage the panel does not resize.

Tyler
you can put your error msg label in a div and apply scroll to that div so if msg is large it will not go out
Thanks for the tip ramkisan, however I really do not want to make the sure scroll in a message box that could easily fit on screen. I think it looks poor for the user experience. I know the first thing I would say is why didn't them make the messagebox bigger.

Thanks,
Tyler
Well I figured out that it is not the label text issue because I copied the exception and then set it as the labels text property so the page would load with that huge string but stil no luck.

Tyler
Here is the code if that helps.

    <asp:Panel ID="pnlmessage" runat="server" HorizontalAlign="Center" CssClass="modalPopup" style="display:none;">
        <asp:Label ID="lblerror" runat="server" Text="Label"></asp:Label>
        <br /><br />
        <asp:Button ID="btnok" runat="server" Text="OK" />
    </asp:Panel>
    <cc1:ModalPopupExtender ID="mpe" runat="server"
        BackgroundCssClass="modalBackground" 
        DropShadow="true" 
        OkControlID="btnOk"  
        PopupControlID="pnlmessage" 
        TargetControlID="Button1">
    </cc1:ModalPopupExtender>
    <asp:Button ID="Button1" runat="server" Text="Button" />

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of tybarton
tybarton

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
A solution but I'm sure a better one exists.