poultarp
asked on
ASP.NET C#: Dynamic text in GridView HyperLinkField
Hello All
I have a GridView on an ASP.NET C# website that contains data from a database. In the GridView I have a HyperLinkField.
What I want to do is change the text of the HyperLinkField depending on the value of one of the GridView Columns (if the column is 0 the HyperLinkField text should be "Activate" and if the value is 1 the text should be "Block").
Does anyone know how this can be done?
Regards
Søren Augustesen
I have a GridView on an ASP.NET C# website that contains data from a database. In the GridView I have a HyperLinkField.
What I want to do is change the text of the HyperLinkField depending on the value of one of the GridView Columns (if the column is 0 the HyperLinkField text should be "Activate" and if the value is 1 the text should be "Block").
Does anyone know how this can be done?
Regards
Søren Augustesen
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hello Mark
Thank you for your answer.
I have one quick question:
In the <%Eval %> line, how do I pass more than one value to the URL parameters?
Regards
Søren Augustesen
Thank you for your answer.
I have one quick question:
In the <%Eval %> line, how do I pass more than one value to the URL parameters?
Regards
Søren Augustesen
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you Mark - it works just as I want it to!
Regards
Søren Augsutesen
Regards
Søren Augsutesen
Glad to help. It's a very useful technique, and one I use almost daily.
you can use this
Text='<%# Eval("colname")%> == "1" ? "Yes" : "No"
this is just example