Can We Write Eval With In Eval [Resolved]

Posted by Hemanth.Sutapalli under ASP.NET on 9/18/2012 | Points: 10 | Views : 1348 | Status : [Member] | Replies : 2
hello all,

How to write eval within eval i wrote like this it shows an error.
<%#Eval("id").ToString().Equals("2") ? "Ram" :<%#Eval("id").ToString().Equals("3")? "Raj" :<%#Eval("id").ToString().Equals("4")? "Raja":"Rao" %>%>%>

Thanks&&Regards,
S.Hemanth




Responses

Posted by: Ranjeet_8 on: 9/18/2012 [Member] [MVP] Gold | Points: 50

Up
0
Down

Resolved
try this

<%#Eval("id").ToString().Equals("2") ? "Ram" :Eval("id").ToString().Equals("3")? "Raj" :Eval("id").ToString().Equals("4")? "Raja":"Rao" %>


Hemanth.Sutapalli, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vikash on: 9/18/2012 [Member] Starter | Points: 25

Up
0
Down
Plz use the code like following....

<%#Comparisio(Eval("id"))%>

And, in the code behind implement it like following.........

public string Comparisio( object obj)
{
//write your logic here and return as string
}


Regards,
Vikash Pathak

Hemanth.Sutapalli, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response