Click here to Skip to main content
16,013,082 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
I have 1 calender, textbox, button and dropdownlist in my page.
If I select the date, by clicking the button, it shows the selected date in the text box but my other control dropdownlist are move down when I'm clicking the button.

How to select the date without disturbing the other controls in my page?
Posted
Updated 23-Feb-11 21:44pm
v2
Comments
Dalek Dave 24-Feb-11 3:44am    
Edited for Spelling, Grammar and Readability.

1 solution

What calender are you used?
it should have property to lay it on your page.
 
Share this answer
 
Comments
shanthikalai 24-Feb-11 3:12am    
no...
shanthikalai 24-Feb-11 3:12am    
i'm a beginner so let me knw how to do tis...
CodingLover 24-Feb-11 3:14am    
Can you show me your code segment? it's easy to comment.
shanthikalai 24-Feb-11 3:27am    
DEFAULT.aspx.cs....
protected void Page_Load(object sender, EventArgs e)
{
Calendar1.Visible = false;
}
protected void Calendar1_SelectionChanged(object sender, EventArgs e)
{
TextBox1.Text = Calendar1.SelectedDate.ToString("MM/dd/yy");
Calendar1.Visible = false;


}

protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
if (Calendar1.Visible = false)
{
Calendar1.Visible = true;

}
else
{
Calendar1.Visible = true;

}
}
}


Default.aspx

asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<contenttemplate>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/WebResource.jpg"
onclick="ImageButton1_Click" />
<asp:Calendar ID="Calendar1" runat="server" BackColor="White"
BorderColor="White" BorderWidth="1px" Font-Names="Verdana" Font-Size="9pt"
ForeColor="Black" Height="190px" NextPrevFormat="FullMonth"
onselectionchanged="Calendar1_SelectionChanged" Width="350px">
<SelectedDayStyle BackColor="#333399" ForeColor="White" />
<todaydaystyle backcolor="#CCCCCC">
<othermonthdaystyle forecolor="#999999">
<nextprevstyle font-bold="True" font-size="8pt" forecolor="#333333"
="" verticalalign="Bottom">
<dayheaderstyle font-bold="True" font-size="8pt">
<TitleStyle BackColor="White" BorderColor="Black" BorderWidth="4px"
Font-Bold="True" Font-Size="12pt" ForeColor="#333399" />
</asp:Calendar>

</asp:UpdatePanel>
<asp:DropDownList ID="DropDownList1" runat="server">
</asp:DropDownList>



this is my code if i click the button then my dropdownlist moves down .....how to select without disturbing other controls
Dalek Dave 24-Feb-11 3:45am    
Fair Question.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900