Replace characters in a Field when bindig data

  • Thread starter Thread starter Satish Appasani
  • Start date Start date
S

Satish Appasani

I have a drop down field on a form. When binding data to the DataValueField
property of the drop down, I need to replace "&" with "%".

In code behind I tried

DataValueField='<%# DataBinder.Eval(Container.DataItem, "CATEGORY_VALUE")
%>'

I get the following error:

Compiler Error Message: BC30456: 'DataItem' is not a member of
'System.Web.UI.Control'.

I tried DataSource in place of DataItem but similar error.
Can somebody please help me?

--


Thank you.

Satish Appasani
#201, Wing - 1, Block - D
Cyber Gateway
Hyderabad - 500 081, India
Phone: +91(40)2311-1356 Ext-122
Mobile: +91(40)333-31032
E-mail: (e-mail address removed)
 
Hi

My guess is you should replace values in sql query itself.


Ravikanth

-----Original Message-----
I have a drop down field on a form. When binding data to the DataValueField
property of the drop down, I need to replace "&" with "%".

In code behind I tried

DataValueField='<%# DataBinder.Eval
(Container.DataItem, "CATEGORY_VALUE")
 
Back
Top