[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 292
  • Last Modified:

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
0
tybarton
Asked:
tybarton
  • 6
1 Solution
 
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
 
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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:
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:
A solution but I'm sure a better one exists.
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now