Monday, May 13, 2024
Homepage · c#
 Popular · Latest · Hot · Upcoming
148
rated 0 times [  150] [ 2]  / answers: 1 / hits: 7160  / 10 Years ago, fri, may 16, 2014, 12:00:00

I have a calendar in asp.net that is shown when a user clicks on a textbox. However, I'm not sure how to display the calendar without pushing all the content below. I need a way to make a popup panel for the calendar.



This is what I have so far. I'm just using a table in order to position the calendar directly below the textbox but this is changing the layout of the items below my table.



<asp:Table runat=server>
<asp:TableRow>
<asp:TableCell>
<asp:TextBox ID=TextBox1 runat=server OnClick=showCal('Calendar1')></asp:TextBox>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell>
<asp:Calendar ID=Calendar1 runat=server style=display: none;></asp:Calendar>
</asp:TableCell>
</asp:TableRow>
</asp:Table>


notice that I have my calendar set to display:none. My onclick js function fires when someone clicks on the textbox.



I've tried to change the z-index of my second table row in the hopes that when the calendar is shown, the rest of my page wont be changed but that didn't work.


More From » c#

 Answers
-2

I was able to solve this problem by just applying the following CSS to my calendar:



calendarClass{
background: white;
position: absolute;
}


somehow adding a white background (or whichever color you'd like) takes the transparency away from the calendar so that it doesn't look strange. The position absolute then makes the calendar appear on top of the table.


[#45252] Thursday, May 15, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
kylanalis

Total Points: 438
Total Questions: 85
Total Answers: 102

Location: Barbados
Member since Sun, Nov 27, 2022
1 Year ago
kylanalis questions
Sat, Oct 2, 21, 00:00, 3 Years ago
Tue, Oct 13, 20, 00:00, 4 Years ago
Thu, Feb 13, 20, 00:00, 4 Years ago
Tue, Jan 7, 20, 00:00, 4 Years ago
;