Click here to Skip to main content
15,888,301 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have a literal control I want to bind the value to that control.
Before that I want to check the condition based on the condition I want to bind the value.

The condition I want to check is not a aspx.cs it a .cs file.

I tried

C#
literal_id.Text = "<%# Eval("tc_TotalHour_Modelling") %>"; 

like this but it is not possible in .cs file.

how to achieve this, give me some suggestions.

Thanks in advance.
Posted
Updated 25-Jul-13 15:28pm
v2
Comments
vinay.tatipamula 25-Jul-13 8:14am    
You can use Eval function in the Aspx page,But you might be getting a DataTable or DataReader object, loop through in the codebehind and bind it to the literal control like the following,

literal_id.Text =YOUROBJECT.tc_TotalHour_Modelling;
Tejas Vaishnav 26-Jul-13 1:05am    
and what was the condition you want to check while binding...

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