【发布时间】:2010-02-01 18:20:59
【问题描述】:
我使用 Ajax 日历扩展器在 Date_Box 中显示日期,然后使用数字上下扩展器来选择时间...
这是我的代码:
<td bgcolor="#969ECD">
<asp:TextBox ID="Date_Box" runat="server" Width="85px"></asp:TextBox>
<br />
<div style="height: 4px"></div>
<asp:TextBox ID="txtHour" runat="server" ></asp:TextBox>
<ajaxToolkit:NumericUpDownExtender ID="txtHour_NumericUpDownExtender"
runat="server" Enabled="True" Maximum="12" Minimum="1"
TargetControlID="txtHour" Width="70" >
</ajaxToolkit:NumericUpDownExtender>
<asp:TextBox ID="txtMinute" runat="server"></asp:TextBox>
<ajaxToolkit:NumericUpDownExtender ID="txtMinute_NumericUpDownExtender"
runat="server" Enabled="True" Maximum="59" Minimum="1"
TargetControlID="txtMinute" Width="70" >
</ajaxToolkit:NumericUpDownExtender>
<asp:TextBox ID="txtDayPart" runat="server"></asp:TextBox>
<ajaxToolkit:NumericUpDownExtender ID="txtDayPart_NumericUpDownExtender"
runat="server" Enabled="True" RefValues="AM;PM" TargetControlID="txtDayPart" Width="70">
</ajaxToolkit:NumericUpDownExtender>
<asp:Button ID="Update" runat="server" Text="Update"
onclick="Update_Click1" />
<br />
</td>
</tr>
</table>
</div>
<ajaxToolkit:CalendarExtender ID="CalendarExtender1" runat="server"
TargetControlID="Date_Box" PopupPosition="TopRight" >
</ajaxToolkit:CalendarExtender>
现在功能方面唯一的问题是,当我在文本框中写入非正常格式的内容并单击更新按钮时,它允许我接受这些值,而不应该让它写入除日期格式之外的任何其他内容.. 例如文本框中没有字母..
这我仍然可以弄清楚,使用一些异常消息......
但现在主要问题是控件的外观。数字扩展按钮太大,行格式不好,三个时间文本框之间也有很多空间......有没有办法让这个看起来整齐>>>
我该如何解决这个问题...有什么建议吗???!
这是图片链接http://www.freeimagehosting.net/image.php?05945773e0.jpg alt text
【问题讨论】: