Protected WithEvents TextBox1 As System.Web.UI.WebControls.TextBox Protected WithEvents TextBox2 As System.Web.UI.WebControls.TextBox
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionPublic Property textbox1Text() As String Get Return TextBox1.Text End Get Set(ByVal Value As String) TextBox1.Text = Value End Set End Property
private m_value as string Public Property textbox1Text() As String Get Return m_value End Get Set(ByVal Value As String) m_value = Value End Set End Property
private m_value as string private m_int as integer Public Property textbox1Text() As String Get Return m_value End Get Set(ByVal Value As String) if Value = "" then throw new exception("chaine vide") else m_value = Value end if End Set End Property Public Property theint() As Integer Get Return m_int End Get Set(ByVal Value As String) try m_int = Integer.parse(value) catch ex as exception end try End Set End Property
public sub WriteTextBox(Id as String, Value as String) CType(Me.FindControl("test"), TextBox).Text = "test" End Sub public function ReadTextBox(Id as string) as string Return CType(Me.FindControl("test"), TextBox).Text End Function
'Parcourt des contrôles de la page For Each Controle In nom_page.Controls(1).Controls nomchamp = Controle.ID 'Si les 4 premiers carac du nom forment Text alors If Left(nomchamp, 4) Like "Text" Then nom = nomchamp.Remove(0, 4) 'Recherche dans la base si le champ existe For Each objDataCol In objDataTable.Columns nom_champ = objDataCol.ColumnName If nom_champ Like nom Then 'Remplissage du champ de saisie champtexte = nom_page.Controls(1).FindControl("Text" + nom) champtexte.Text = objDataTable.Rows(intRowNumber).Item(nom_champ) Exit For End If Next End If Next