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 asp.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 asp.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 asp.net in the same way as asp?
 
Yes, you can do this very easily. Check out the ItemCreated and ItemDataBound events.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top