c# & character problem - repost

S

snt

I have a C# asp.net project in which I create meta keywords
dynamically. I have a problem with "&" character. When the page is
rendered, the "&" character is converted into "&". Is there any
way to stop this?

I already once posted this question and did not get any useful help.
Any help with this issue will be highly appreciated.

Thanks in advance,

snt
http://www.onlinemall.com
http://www.flexoweb.com
 
K

Kevin Spencer

& is HTML-encoding for '&'. There is no reason to stop it.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.
 
M

Mark Rae

I have a C# asp.net project in which I create meta keywords
dynamically. I have a problem with "&" character. When the page is
rendered, the "&" character is converted into "&". Is there any
way to stop this?

???

This is perfectly standard behaviour - why on earth would you want to stop
it?

Go to http://www.microsoft.com and do a View Source - you'll find literally
dozens of instances of "&"
 
S

snt

Kevin, I think, you did not read the question. I am not asking a html
related question. I am creating keywords dynamically and don't want
any unwanted html characters there. If I have an '&' in the text, it
should be output as &, not &. Does anyone have any idea on this?
 
S

snt

Mark, please read the question before answering. None want to stop
html rendering behaviour, and my question is not on stopping html
rendering behaviour.
 
M

Mark Rae

Mark, please read the question before answering. None want to stop
html rendering behaviour, and my question is not on stopping html
rendering behaviour.

I see. So when you write:

'When the page is *rendered*, the "&" character is converted into "&".
Is there any way to *stop* this?'

you're not actually asking a question about stopping rendering behaviour...?
 
K

Kevin Spencer

Kevin, I think, you did not read the question. I am not asking a html
related question.

I think you did not understand our answers. "Keywords" are part of a meta
tag, which is part of an HTML document, which is what an ASP.net page
renders to the client browser. What you are seeing is what should be there.
Remember, it's not what you think or feel that matters; that is purely
subjective. It's what is true that matters. What you are asking is how to do
something incorrectly. ASP.net does things correctly by default, and that is
the way it should be.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.
 

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
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top