Click here to Skip to main content
16,001,020 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All

I wan to use eval with multiple conditions.
I want to load the image based on the Role.
The Roles 1,2,3,4,5,6. If the roleid is 1, i need to load a simple image. And if it is 2 another image... and so on.


In this scenario how to use Eval in the image.


thanks in advance.


regards
froxy
Posted
Comments
froxy 7-Jul-11 2:52am    
'<%# ((Eval("RoleId").ToString()=="1")?@"~/Images/Administrator.PNG":(Eval("RoleId").ToString()=="2")?@"~/Images/InstitueAdmin.jpeg:@"~/Images/Reviewer.PNG") %>'
shefeekcm 7-Jul-11 3:20am    
please provie your code...

1 solution

You're better off in a lot of ways, for readability, calling a code behind method and passing in your value, so that your logic stays in your code behind and not your ASPX.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900