<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="script" runat="server">
</asp:ScriptManager>
<div>
<table>
<tr>
<td>
StartDate:
</td>
<td>
<asp:TextBox ID="tbStartDate" runat="server" /><br />
<ajaxToolkit:CalendarExtender ID="ce1" runat="server" TargetControlID="tbStartDate" />
</td>
</tr>
<tr>
<td>
EndDate:
</td>
<td>
<asp:TextBox ID="tbEndDate" runat="server" ReadOnly="true" />
<ajaxToolkit:CalendarExtender ID="ce2" runat="server" TargetControlID="tbEndDate" />
</td>
</tr>
<tr>
<td>
</td>
<td>
<asp:Button ID="btnsubmit" runat="server" Text="Submit" onclick="btnsubmit_Click" />
</td>
</tr>
<tr>
<td>
StarDate Text:
</td>
<td>
<b><asp:Label ID="Label1" runat="server"></asp:Label></b>
</td>
</tr>
<tr>
<td>
EndDate Text:
</td>
<td>
<b><asp:Label ID="Label2" runat="server"></asp:Label></b>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
|
protected void Page_Load(object sender, EventArgs e)
{
tbStartDate.Attributes.Add("readonly", "readonly");
}
protected void btnsubmit_Click(object sender, EventArgs e)
{
Label1.Text = tbStartDate.Text;
Label2.Text = tbEndDate.Text;
}
|
Download sample code attached
|
If you enjoyed this post, please support the blog below. It's FREE! Get the latest Asp.net, C#.net, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email. |
|||
Subscribe by RSS
Subscribe by Email
|
|||
|
|

Subscribe by RSS
Subscribe by Email
13 comments :
thanks dude
Hi Suresh,,,
I added txBxId.Attributes.Add("readonly","readonly") in codebehind page but am getting the same problem. Not posssible to get the value in textbox after postback
I have a textbox called paysalary ok
down to it i have another box of interest i want the interest to be calculated and displayed if i press tab from paysal to interest box... i have the logic for interest .. but how do i display it in another ttextbox
excellent sir...
Hey Suresh,
I am doing same thing but on buttonsubmit I am trying to save to DB table using tbStartDate.Text. There it says cant convert string to system.datetime.Any ideas?
Thanks Much,