| Author: Sidewinder2 28 Aug 2008 | Member Level: Gold | Rating:  Points: 1 |
Hi,
try this
(Label)row.FindControl("Label1").text= tot.ToString();
|
| Author: sivapriya 28 Aug 2008 | Member Level: Gold | Rating:  Points: 3 |
total = (Label)row.FindControl("Label1"); total=tot; here you r trying to assign int to label value (string).
use like this
Label total = (Label)row.FindControl("Label1"); total.Text=Convert.ToString(tot);
|
| Author: Karthikeyan S 28 Aug 2008 | Member Level: Gold | Rating:  Points: 6 |
In your code (last four lines) the object " (Label)row.FindControl("Label1")" is returning a Label.
First check whether 'total' is an integer datatype or Label control.
Let we create a Label control named as lblTotal and total value sumed is stored in the variable 'tot'.
then correct code is:
Label total = (Label)row.FindControl("Label1"); // right side code is returing a Label control. So we created a Label control called total and we placed it in left side. total.Text = tot.ToString(); // tot is an int and total.text is of string datatype. so we have to convert tot integer to string using ToString() function.
|
| Author: Elz 28 Aug 2008 | Member Level: Gold | Rating:  Points: 0 |
thanks all
|