SitePoint Sponsor

User Tag List

Results 1 to 15 of 15
  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2010
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Web Config Not Working!

    So the scenario is: I'm taking an existing HTML/CSS website and adding a contact form using ASP.NET right. All goes well until I put it up on my server and I get this "custom errors" error in my web config file. My web config file doesn't contain much of anything so I try to add the code in the error message (both of them) with no luck. What can I do to fix this problem and avoid it in the future?

    http://ns-llc.com/alexnodr/networksp...contactUs.aspx

  2. #2
    Chopped Liver bronze trophy imaginekitty's Avatar
    Join Date
    Aug 2007
    Location
    Pennsyltucky
    Posts
    1,494
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    So, what happens when you follow the directions in the "Details:" section?

  3. #3
    SitePoint Enthusiast
    Join Date
    Jun 2010
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nothing changes
    > Gives me the same error message either way.

  4. #4
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,653
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    What is the folder layout? What version of ASP.NET is the server configured for?

  5. #5
    SitePoint Enthusiast
    Join Date
    Oct 2008
    Location
    England
    Posts
    80
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    turn web.config custom errors to off, try adding the xml code if its not there.

    Try also finding out what version of .net your hosting supports. Alot of them only support 2.0.
    Read my blog...
    Skylight Studios

  6. #6
    SitePoint Enthusiast
    Join Date
    Jun 2010
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well i tried adding the code on the error page to my web config file and that didn't help so turning custom errors off doesn't seem to be an option at this point.

    I talked to the people hosting the server and they say they have the latest version of ASP.NET running.

  7. #7
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,653
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Ok, what tool did you use to make the contact form.

  8. #8
    SitePoint Enthusiast
    Join Date
    Jun 2010
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well I'm using Visual Studio Web Dev 2010. I also found out that the servers .net framework is 2.0 - does it really make that much of a difference though?

  9. #9
    SitePoint Guru pinch's Avatar
    Join Date
    Mar 2005
    Posts
    688
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You may be compiling for .NET 4.0 but if your server is running 2.0 then I think you're going to have some problems. Did you reconcile why your host says they're running the latest version if it is 2.0?

    You should be able turn turn "off" custom errors and turn "on" debug through your web.config. That will give you a better idea of the problem you're facing.

  10. #10
    SitePoint Enthusiast
    Join Date
    Jun 2010
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well I tried that - and nothing has changed - my web.config file looks like this:


    <?xml version="1.0"?>

    <configuration>

    <system.web>
    <compilation debug="true" targetFramework="2.0" />
    </system.web>
    <system.web>
    <customErrors mode="Off">
    </customErrors>
    </system.web>

    </configuration>

  11. #11
    SitePoint Mentor NightStalker-DNS's Avatar
    Join Date
    Jul 2004
    Location
    Cape Town, South Africa
    Posts
    2,880
    Mentioned
    48 Post(s)
    Tagged
    0 Thread(s)
    Try this:

    <?xml version="1.0"?>

    <configuration>

    <system.web>
    <compilation debug="true" targetFramework="2.0" />
    <customErrors mode="Off"></customErrors>
    </system.web>




    </configuration>

  12. #12
    SitePoint Enthusiast
    Join Date
    Jun 2010
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It doesn't seem to recognize the targetFramework="2.0" it keeps erroring out on me and a blue line is under it. Not sure what it means.

  13. #13
    SitePoint Mentor NightStalker-DNS's Avatar
    Join Date
    Jul 2004
    Location
    Cape Town, South Africa
    Posts
    2,880
    Mentioned
    48 Post(s)
    Tagged
    0 Thread(s)
    Make sure which version of .NET the host has setup your site to use

  14. #14
    SitePoint Member
    Join Date
    May 2011
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is your web.config in the root directory of your application?

    Have you tried just writing the value to the screen as opposed to actually trying to use it? (e.g. Response.Write(ConfigurationSettings.AppSettings("[keyname]"))

    I store all of my database connection strings in the web.config file and do something like this:

    web.config:
    <appSettings>
    <add key="Clients" value="workstation id=PC;user ID=Username;password=Password;data source=Server;persist security info=True;initial catalog=Database"/>
    </appSettings>

    In code:

    sqlConn = New SqlConnection
    sqlConn.ConnectionString = ConfigurationSettings.AppSettings("Clients")

    And this works fine.

    --Stole this from a moderator

    I will only tell you how to do it, not do it for you.

    Unless, of course, you want to hire me to do work for you.

  15. #15
    SitePoint Enthusiast
    Join Date
    Jun 2010
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well I'm not using any kind of kind of database connections. And my server is running 2.0 - which is ridiculously hard to develop for I've come to realize. . .


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •