Quotes in __doPostBack

This is a general problem I have when I create asp:linkbutton on a aspx page (ASP.NET 4 on IIS 7). When I debugged my web app at localhost I immediately realized two things in browser view: the special symbol I use (a pair of double arrows) turned into 2 question marks and the ‘remove’ link doesn’t work. Looking at the source-the asp-generated function __doPostBack for remove-the first parameter (eventTarget) is supposed to have enclosing quotes but instead it has the code & # 39 ; around the control ID. How do I fix it?

I’m not sure I can answer all these items, but here’s what I can tell. The special characters that you’re using (the double arrows) are turning into question marks because the application can’t find a font with those characters. Different apps display different behavior when they can’t find a glyph for the particular codepoint which the input defines. My browser defaults to a rectangular outline, yours defaults to a question mark; both are quite common indications. Is this coming up in your browser? If so, that’s really strange. As long as you have the fonts loaded on your computer, browsers do a good job these days of automatically switching fonts in order to display rare characters that aren’t supported by all fonts.

Also, you’re running into some of the complexities of working with .NET’s generated Javascript. This is one of the reasons that I get strange looks from MS guys, because I write my own JS / use jQuery to handle client side scripting. I don’t find .NET’s JS sensible enough to use in a production environment. There are plenty of people using it, so I’m sure it works just fine, but I won’t use anything that I can’t wrap my head around. If I can’t fix it when it breaks, I don’t want it in my code in the first place.

It sounds like the information is being escaped. Instead of quotes which work in a javascript they’re being transformed into the corresponding entity reference to provide the ability to display the characters in a browser without providing a possible security breach. That’s your problem. There may be some guys who can figure out how to stop the value from being escaped around here, but I work around that by writing my own JS.