Dim t As TextBox = DirectCast(FormView1.FindControl("DataTextBox"), TextBox)
t.Text = "hello"
How do I do the same thing in C# I don't see the DirectCast available in C#.
t.Text = "hello"
How do I do the same thing in C# I don't see the DirectCast available in C#.
What's the C# version of DirectCast?
pnb
Bruno B.
TextBox t = (TextBox)o;
t.Text = "hello";
Where o is a reference to the object you want to typecast.
So for yours...
TextBox t = (TextBox)FormView1.FindControl("DataTextBox");
t.Text = "hello";