开发者

Encoding problem in aspx/html files

I am developing a website in ASP.NET. I am facing a problem while I am trying to read the values from an .aspx page(using jsonp). I tried seeing this problem using Firebug and it was showing an error in one of my html files. Here's the screenshot: http://i.stack.imgur.com/GlQjC.jpg

I checked the respective html file and it was correct (according to me) except that I remember Visual Studio giving me some prompt regarding some encoding after which I saved the file. This was probably because this html file came from a Linux system. Here's my html file: http://pastebin.com/V3f6KDSa

Can there be such a problem because I then checked in Google Chrome too and it was giving an error as shown in this screenshot: http://i.stack.imgur.com/h67Me.jpg

I didn't see an开发者_JS百科y error in this html file. I am guessing this encoding might be the error but there could some other problem too. I am trying to read the output of a menu.aspx using getJSON. The output on my menu.aspx page is something like:

foo({"1":"Jeff","2":"Mic","5":"Mark"}); in html form using this .cs code

outputText += Convert.ToString(k.GetValue(0));
            for (Int32 i = 1; i < k.Length; i++)
            {
                outputText += "," + Convert.ToString(k.GetValue(i));
            }
            //
            outputText += "}" +");";

            Response.Write(outputText);

Please suggest something to resolve this.


Do a Response.Clear before writing anything to the output stream:

Response.Clear();
Response.Write(outputText);
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜