how to use items in a formview
-
hi all How could I reach a label in a formview edititemtemplate section void gogo(){ label01.Text="abc.."; // this gives error The name 'label01' does not exist in the current context } ... ... karanba
You need to use FindControl for this. Try: protected void Button1_Click(object sender, EventArgs e) { Label MyLabel = null; MyLabel = (Label)FormView1.FindControl("label01"); MyLabel.Text= "xxxx"; } I'm just learning this stuff so it may not be the nicest way - but it should work. Maj
-
You need to use FindControl for this. Try: protected void Button1_Click(object sender, EventArgs e) { Label MyLabel = null; MyLabel = (Label)FormView1.FindControl("label01"); MyLabel.Text= "xxxx"; } I'm just learning this stuff so it may not be the nicest way - but it should work. Maj
-
thaks this works...but I could not understand that why we can direcly reach any item that not nested in formview or any other control but this does not work in nested items ...:~ karanba -- modified at 14:37 Thursday 2nd February, 2006