开发者

Html inner-text replace special character in C# or Vb.net

ho开发者_开发百科w to replace special character from client-side html editor post to server in vb or c# whitout replace same charachter in html tags? it usefull to insert to database the correct string.

input:

<div class="c1">HELLO YOUR Number 1</div>

replace("1","xxx") => replace "1" with "xxx"

output:

<div class="c1">HELLO YOUR Number xxx</div>

not

<div class="cxxx">HELLO YOUR Number xxx</div>


once you get a reference to your div from JavaScript or Server side, just call the replace on div.InnerText instead of calling it on the whole page markup.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜