aspvbnetnerd
Programmer
I would like to type this to C#. I am new to C# but know VB.NET
I have tried but I type it in C#, but with no success.
Any help is appriciated
/George
Code:
Protected Sub GridProjects_RowUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GridProjects.RowUpdating
Dim empid As String
empid = CType(GridProjects.Rows(e.RowIndex).Cells(4).Text, String)
Dim FieldName1 As New System.Web.UI.WebControls.TextBox
Dim FieldName2 As New System.Web.UI.WebControls.TextBox
FieldName1 = CType(Me.GridProjects.Rows(e.RowIndex).Cells(5).Controls(0), TextBox)
FieldName2 = CType(Me.GridProjects.Rows(e.RowIndex).Cells(6).Controls(0), TextBox)
Dim sFName As String = FieldName1.Text
Dim dFName As String = FieldName2.Text
End Sub
I have tried but I type it in C#, but with no success.
Code:
int IntProjectID;
IntProjectID = int.Parse(GridProjects.Rows[e.RowIndex].Cells[4].Text);
System.Web.UI.WebControls.TextBox FieldName1 = new System.Web.UI.WebControls.TextBox();
System.Web.UI.WebControls.TextBox FieldName2 = new System.Web.UI.WebControls.TextBox();
FieldName1 = (System.Web.UI.WebControls.TextBox) e.Item.Cells[0].Controls[0];
FieldName2 = (this.GridProjects.Rows[e.RowIndex].Cells[6].Controls[0]);
Any help is appriciated
/George