3
Answers

How to create TextBox2_TextChanged put into Edit template

Hi Guys
Please help me
This is textbox in EditItem template in gridview :
 
<EditItemTemplate>
<asp:TextBox ID="TextBox11" Width="80" runat="server" Text='<%# Bind("Service_Start_Date", "{0:dd/MM/yyyy}") %>' TargetControlID="TextBox11"></asp:TextBox>
<ajaxToolkit:CalendarExtender ID="CalendarExtender1" TargetControlID="TextBox11" runat="server" Format="dd/MM/yyyy" />
</EditItemTemplate>
 
and this is other :
 
<EditItemTemplate>
<asp:TextBox ID="TextBox11" Width="80" runat="server" Text='<%# Bind("Service_Start_Date", "{0:dd/MM/yyyy}") %>' TargetControlID="TextBox12"></asp:TextBox>
<ajaxToolkit:CalendarExtender ID="CalendarExtender1" TargetControlID="TextBox11" runat="server" Format="dd/MM/yyyy" />
</EditItemTemplate>
 
How to applied this code and how declare txt in gridview 
 
protected void TextBox11_TextChanged(object sender, EventArgs e)
{
string date = TextBox11.Text;
DateTime dt1 = DateTime.ParseExact(date, "dd/MM/yyyy", CultureInfo.InvariantCulture);
TextBox12.Text = dt1.AddDays(30).ToString("dd/MM/yyyy");
Label1.BackColor = Color.Green;
Label2.Text = ("Team Should Be Changed On:" + dt1.AddDays(30).ToShortDateString());
}
 
thanks 
 
 
 
Answers (3)