Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create Variables from Data?

Status
Not open for further replies.

Silvinho

Programmer
Jul 9, 2001
58
GB
I'm quite new to vb.net but very experienced with standard asp.

The problem I’m having is being once I’ve created a datagrid I need to be able to format the html depending on the data.

ie: if the column "Activated" = True then the table row bgcolor would be blue

This was very easy to do in asp but from what I’ve read so far it’s quite awkward and clumsy in .net.

The main problem is I can’t seem to create variables from the data so therefore changing the output becomes very difficult. Even writing functions for everything wouldn’t cover every base and would be very time consuming.

What I want to do is something like:

dim strFileName AS String
strFileName = DataBinder.Eval(Container.DataItem, "File_Name")

Is it possible to create variables of this type in .net in the same way as asp?
 
Ask this in the ASP.Net forum. But I do seem to remember that you might want to look into the DataRepeater control instead of the DataGrid.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top