本文介绍了如何在详细信息视图控件中引用文本框.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我正在使用asp.net 2.0(VB),我想在详细信息视图控件中调用一个文本框,即
ASP代码
Hi guys,
Am using asp.net 2.0 (VB), I would like to call a text box in the details view control i.e
asp code
<insertitemtemplate>
<asp:TextBox ID="tdate1" runat="server" Text='<%# Bind("To_Date") %>'></asp:TextBox>
</InsertItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="fdate2" runat="server" Text='<%# Bind("From_Date") %>'></asp:TextBox>
</InsertItemTemplate>
vb代码
vb code
Dim tdate, fdate As Date
'Where tdate1 &fdate2 are controlID's in the detailsview
tdate = tdate1.date
fdate = fdate2.date
Dim ts As TimeSpan = tdate.Subtract(fdate)
您的帮助将不胜感激.
Larsh.
Your help will be appreciated.
Larsh.
推荐答案
Dim tempTxtSome As TextBox = CType(myDetailView.FindControl("txtSome"), TextBox)
这行代码是在您访问逐条记录时.
类似的讨论在此处. [ ^ ]
This line of code is at the time when you are accessing record-by-record.
Similar thread discussion here.[^]
这篇关于如何在详细信息视图控件中引用文本框.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!