Code Behind Shows Publicly?!

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.
 
J

Juan T. Llibre

Have you registered the .Net Framework with IIS ?

aspnet_regiis -i

....from a command-line in the .Net Framework directory.
 
B

Bishop

I host .net 2.0 websites on IIS and by default it's explicitly denied. I
wonder if directory browising is enabled.
 
K

Karl Seguin

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
 
A

AmitKu

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
 
B

Bishop

The fact that Network Solutions can make money is slightly more ridiculous.
Find yourself a new hosting company fast!
 
W

William LaMartin

Why not compile everything into one dll to be put in the bin folder using
the web deployment project add-on offered by Microsoft?
 
K

Karl Seguin

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top