Replace characters in a Field when bindig data

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)
 
R

Ravikanth[MVP]

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")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,243
Members
46,835
Latest member
lila30

Latest Threads

Top