I have an application where user selects from drop down list and text boxes and click the "GO' button (button1). I have defined button1 as default button as well. I also have a calendar that pop up when user clicks a link button.
Now, if user presses the enter key, the calendar pops up (no click on the link button have taken place). In my code behind, I have set the calendar not to be visible. Can someone explain to me why this happens?
Here is code snippet:
Code:
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<div>
<asp:Panel ID="Panel1" runat="server" Height="510px" Style="left: 1px; position: relative;
top: -48px">
<div>
<asp:Panel ID="Panel2" DefaultButton="button1" runat="server" Height="33px" Style="border-right: gray thin solid;
border-top: gray thin solid; left: 0px; border-left: gray thin solid; border-bottom: gray thin solid;
position: relative; top: 57px; background-color: #ffffcc; z-index: 100;" Width="948px">
<asp:Label ID="Label1" runat="server" Style="font-size: 25px; left: 333px; color: blue;
position: absolute; top: -37px; z-index: 100;" Text="J O B"></asp:Label>
<asp:Label ID="Label2" runat="server" Style="font-size: 25px; left: 401px; color: blue;
position: absolute; top: -37px; z-index: 101;" Text="R E P O R T I N G " Width="194px"></asp:Label>
......................
........................
...........................
<asp:Calendar ID="Calendar1" runat="server" Height="32px" Style="z-index: 104; border-right: blue thin solid;
border-top: blue thin solid; font-size: 10px; left: 661px; border-left: blue thin solid;
border-bottom: blue thin solid; position: absolute; top: 111px" Width="180px"
BackColor="White" BorderColor="#999999" CellPadding="4" DayNameFormat="Shortest"
Font-Names="Verdana" Font-Size="8pt" ForeColor="Black">
<SelectedDayStyle ForeColor="White" BackColor="#666666" Font-Bold="True" />
<TodayDayStyle ForeColor="Blue" BackColor="#CCCCCC" />
<WeekendDayStyle ForeColor="Red" BackColor="#FFFFCC" />
<SelectorStyle BackColor="#CCCCCC" />
<OtherMonthDayStyle ForeColor="Gray" />
<NextPrevStyle VerticalAlign="Bottom" />
<DayHeaderStyle BackColor="#CCCCCC" Font-Bold="True" Font-Size="7pt" />
<TitleStyle BackColor="#999999" BorderColor="Black" Font-Bold="True" />
</asp:Calendar