[英]Passing value from one textbox to another in ASP.Net Gridview
我在GridView中有兩個字段。1.通知日期2.生效日期
當用戶在通知日期中輸入/更改日期時,我想在通知日期值中添加10個附加天,並在每次用戶更改通知日期時自動在生效日期中填充。 請指教:
<asp:DetailsView ID="DetailsView1" runat="server"
DataKeyNames="ID"
DataSourceID="ObjectDataSource1"
OnDataBound="DetailsView_OnDataBound">
<Fields>
<asp:TemplateField HeaderText="Notification Date">
<HeaderTemplate><span style="color:Red;">*</span> Notification Date </HeaderTemplate>
<InsertItemTemplate>
<asp:TextBox ID="txtNotificationDate" runat="server" Width="150" Text="" />
<cc1:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtNotificationDate" PopupPosition="Right"/>
</InsertItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtNotificationDate" runat="server" Width="150" Text='<%# Eval("NotificationDate", "{0:d}") %>' />
<cc1:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtNotificationDate" PopupPosition="Right"/>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Effective Date">
<InsertItemTemplate>
<asp:TextBox ID="txtEffectiveDate" runat="server" Width="150" Text="" />
<cc1:CalendarExtender ID="CalendarExtender2" runat="server" TargetControlID="txtEffectiveDate" PopupPosition="Right"/>
</InsertItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtEffectiveDate" runat="server" Width="150" Text='<%# Eval("EffectiveDate", "{0:d}") %>' />
<cc1:CalendarExtender ID="CalendarExtender2" runat="server" TargetControlID="txtEffectiveDate" PopupPosition="Right"/>
</EditItemTemplate>
</asp:TemplateField>
</Fields>
</asp:DetailsView>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.