Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET MVC app displaying weird characters

I'm developing an ASP.NET MVC app and today, after one month, I uploaded a new version to my server (Discount Asp.NET). Since that, I'm having some problems to display one of the pages: http://www.jobbox.com.br/cocoonhealth/profile/gguerini Invalid characters are shown instead of the page.

All the other pages are ok. I tried to change the encoding, line breaks and etc. Nothing! I tested on my computer and another server: both places the page works great, but on the Discount.asp server, doesn't. I don't know what to do. I spent the entire day trying to figure out what happened.

http://www.jobbox.com.br/cocoonhealth/ - HOME PAGE http://www.jobbox.com.br/cocoonhealth/profile/gguerini - PROBLEM

I double check everything and there is nothing apparently wrong. I don't know what to so.

Have you seen anything similar before?

I appreciate your help. G

like image 461
Guillermo Guerini Avatar asked Jan 13 '10 03:01

Guillermo Guerini


2 Answers

Go to your Global.asax.cs file and add this code in the Application_Error event:

 HttpApplication app = sender as HttpApplication;
 app.Response.Filter = null;
like image 197
maxspan Avatar answered Oct 18 '22 08:10

maxspan


Is this the only page where this is a problem? I saw something similar about a year ago with an old beta of MVC 1 ... I think it had something to do with returning the wrong type from the controller (i.e. returning a JSON result instead of a View result or something like that).

I'd suggest cutting your view down to its bare essentials ... i.e. the first line then a Hello World. If it still happens, check out the action that creates the view ... I'd bet it's not returning a view but something else.

If you still can't find it, post your bare essentials version of the view and relevant action.

like image 2
Beep beep Avatar answered Oct 18 '22 10:10

Beep beep