Formview Edititem模板 [英] Formview Edititem template

查看:119
本文介绍了Formview Edititem模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


谁能告诉我如何使用
在edititemtemplate中找到控件 formview控件....

在此先感谢

Hi,
can any one tell me how to find control in edititemtemplate using
formview control....

Thanks in advance

推荐答案

Google告诉我这些是Web类,但您没有这么说,还是将您的帖子标记为ASP.NET?为什么需要找到控件?你想做什么 ? MSDN示例显示了如何迭代返回的数据,并且,如果需要,可以通过添加代码来轻松处理模板中控件的事件.
Google tells me these are web classes, yet you didn''t say so, or mark your post as ASP.NET ? Why do you need to find the control ? What are you trying to do ? The MSDN samples show how to iterate over the data returned, and you can easily handle the events of the controls in the template, by adding the code to do so, if you need to.



我为此编写了以下代码,但没有用.

受保护的Sub fvDise_PreRender(ByVal发送者作为对象,ByVal e作为System.EventArgs)处理fvDise.PreRender
如果fvDise.CurrentMode = FormViewMode.Edit然后
暗淡的标签为TextBox = fvDise.FindControl("lblneDisease1")
其他
Dim label1 As Label = fvDise.FindControl("lbleDisease1")
如果结束
结束子

我也称模式更改为事件,但没有用...
请帮我...
Hi,
I wrote following code for that but it was not work.

Protected Sub fvDise_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles fvDise.PreRender
If fvDise.CurrentMode = FormViewMode.Edit Then
Dim label As TextBox = fvDise.FindControl("lblneDisease1")
Else
Dim label1 As Label = fvDise.FindControl("lbleDisease1")
End If
End Sub

i call mode changed event also but no use...
plz help me...



我使用以下代码解决了我的问题....

受保护的子fvDise_Databound(ByVal发送者作为对象,ByVal e作为System.EventArgs)处理fvDise.Databound

如果fvDise.CurrentMode = FormViewMode.Edit然后
CType(fvOther.FindControl("lbleDrivingLicense"),Label).Text ="sometext"
其他
CType(fvOther.FindControl("lblDrivingLicense"),Label).Text ="sometext"
如果结束

结束Sub
Hi,
I solved my problem using following code....

Protected Sub fvDise_Databound(ByVal sender As Object, ByVal e As System.EventArgs) Handles fvDise.Databound

If fvDise.CurrentMode = FormViewMode.Edit Then
CType(fvOther.FindControl("lbleDrivingLicense"), Label).Text="sometext"
Else
CType(fvOther.FindControl("lblDrivingLicense"), Label).Text="sometext"
End If

End Sub


这篇关于Formview Edititem模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆