Code Behind Shows Publicly?!

  • Thread starter Thread starter AmitKu
  • Start date Start date
A

AmitKu

I have an asp.net 2.0 website, with C# code behind, hosted with network
solutions.

And much to my dismay, when I navigated to my csharp file (I don't know
what made me try this), I could actually see it! In fact, anyone can
see it.

Isn't this really really bad, and is there anything I can do fix this?
Network solutions is a very confused and unhelpful company, and I'll be
moving away from them in case I get no real answers....

Thanks in advance.
 
I host .net 2.0 websites on IIS and by default it's explicitly denied. I
wonder if directory browising is enabled.
 
Even if it was, *.cs is mapped to ASP.NET which maps it to the
ForbiddenHandler. So while you might see that the .cs file is present with
directory browsing, it wouldn't let you see the source code.

Karl
 
They tell me that they can't fix the problem...I'm on a shared hosting
account.....am I taking crazy pills or is this the most ridiculous
thing you've ever heard of?

--Amit
 
The fact that Network Solutions can make money is slightly more ridiculous.
Find yourself a new hosting company fast!
 
Why not compile everything into one dll to be put in the bin folder using
the web deployment project add-on offered by Microsoft?
 
On the odd chance that .cs is stil mapped to ASP.NET, but not to the
HttpForibiddenHandler, you should try to add the following to your
web.config:

<httpHandlers>
<add verb="*" path="*.cs" type="System.Web.HttpForbiddenHandler" />
</httpHandlers>

Karl
 
Back
Top