- 追加された行はこの色です。
- 削除された行はこの色です。
#freeze
閲覧総計:&counter(); (本日:&counter(today); 昨日:&counter(yesterday);)
カレンダの日付クリックでその日付をTextBoxに入力する法 10/08/08
開発環境:VWD2005 + Access2003
サーバ:ASP.NET2.0 + Access2003
【ポイント】
Protected Sub Calendar1_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs)
TextBox1.Text = Calendar1.SelectedDate
End Sub
開発環境:VWD2008 + Access2003
サーバ:ASP.NET3.5 + Access2003
【機能】DetailsViewで1件を1ページで新規データの入力を行う。
データ一覧表示はGridViewで行う。GridViewの「編集」機能も動作する。
【稼働画面】
#ref(DetailsViewInsert01.JPG);
#ref(CalTextInp01.jpg);
【CalTextInp.aspx】
<%@ Page Language="VB" %>
<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Protected Sub Calendar1_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs)
TextBox1.Text = Calendar1.SelectedDate
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>カレンダから日付入力</title>
</head>
<body>
<form id="form1" runat="server">
<div>
カレンダの日付クリックで日付入力 10/08/08<br />
<br />
【機能】カレンダの日付をクリックするとその日付がTextBoxに入力される<br />
<asp:TextBox ID="TextBox1" runat="server" Width="151px"></asp:TextBox>
<br />
<asp:Calendar ID="Calendar1" runat="server" OnSelectionChanged="Calendar1_SelectionChanged"></asp:Calendar>
<br />
</div>
</form>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Protected Sub Calendar1_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs)
TextBox1.Text = Calendar1.SelectedDate
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>カレンダから日付入力</title>
</head>
<body>
<form id="form1" runat="server">
<div>
カレンダの日付クリックで日付入力 10/08/08<br />
<br />
【機能】カレンダの日付をクリックするとその日付がTextBoxに入力される<br />
<asp:TextBox ID="TextBox1" runat="server" Width="151px"></asp:TextBox>
<br />
<asp:Calendar ID="Calendar1" runat="server" OnSelectionChanged="Calendar1_SelectionChanged"></asp:Calendar>
<br />
<br />
<br />
<br />
</div>
</form>
</body>
</html>
【参考にしたページ】
Calendarコントロール上で選択された日付について処理を行うには? 05/08/12
http://www.atmarkit.co.jp/fdotnet/dotnettips/337aspcalendarsel/aspcalendarsel.html
#comment_nospam
#vote(参考になった[0],ふつう[0],参考にならなかった[0])