How to assign a variable/value to table cell in asp.net?
I'm creating an ASP.NET web application using C# and I want to know how I could assign an integer variable to the cell of a table. I could easily do it using a text-box and label but I'd like to use a table if possible.
I'm using Microsoft Visual Studio 2010 Ultimate
Re: How to assign a variable/value to table cell in asp.net?
What kind of table (gridview?) is it databound, what is an outline of what you are trying to acheive?
If its a gridview you want something like
Code:
int Myint = 100;
dataGridView1.Rows[rowIndex].Cells[columnIndex].Value = Myint;
rememeber though DGV's are zero based
Re: How to assign a variable/value to table cell in asp.net?
You could alse set the innerhtml of the tablecel you want te set. If you use an asp:Table you can set your own id's...