c# & character problem - repost

  • Thread starter Thread starter snt
  • Start date Start date
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
 
& 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.
 
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 "&"
 
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?
 
Mark, please read the question before answering. None want to stop
html rendering behaviour, and my question is not on stopping html
rendering behaviour.
 
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...?
 
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.
 
Back
Top