如何复制标签值 [英] How do I copy a label value
本文介绍了如何复制标签值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一张表格,其中标签是记录号码。我需要将它传递给表外的文本框,但是在同一个aspx页面上。保存文件时,我需要将值传递给另一个表。或者,如果我可以绕过这一步,只是在保存时将标签值传递给第二个表,那就太棒了!
解决方案
管理角落的同事能够解决
受保护 Sub FormView1_DataBound( ByVal sender As Object , ByVal e As System.EventArgs)句柄 FormView1.DataBound
如果 FormView1.CurrentMode = FormViewMode.Edit 然后
Dim sCompanyAutoLabel1 作为标签= CType (FormView1.FindControl( CompanyAutoLabel1),Label)
CompanyAuto_TB.Text = sCompanyAutoLabel1.Text
End 如果
结束 Sub
I have a table where the label is the record number. I need to pass that to a text box outside of the table but on the same aspx page. I need the value to pass to another table when I save a file. Alternately if I could bypass this step and just pass the label value to the 2nd table when saving, it would be great!
解决方案
Managed to corner a coworker who was able to resolve
Protected Sub FormView1_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles FormView1.DataBound If FormView1.CurrentMode = FormViewMode.Edit Then Dim sCompanyAutoLabel1 As Label = CType(FormView1.FindControl("CompanyAutoLabel1"), Label) CompanyAuto_TB.Text = sCompanyAutoLabel1.Text End If End Sub
这篇关于如何复制标签值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文