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
tybartonAsked:
Who is Participating?
 
tybartonConnect With a Mentor Author Commented:
Ok I found a fix but it is not ideal. I set the panel style width property to 500px. The reason I used a label control is that it grows with the text property which I had hoped the Panel would also.

Tyler
0
 
tybartonAuthor Commented:
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
0
 
Ramkisan JagtapLead DeveloperCommented:
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
0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

 
tybartonAuthor Commented:
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
0
 
tybartonAuthor Commented:
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
0
 
tybartonAuthor Commented:
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

0
 
tybartonAuthor Commented:
A solution but I'm sure a better one exists.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.