How to retrieve the value of maxRequestLength in the web.config ?

Discussion in 'ASP .Net' started by toto@titi.com, Nov 8, 2004.

  1. Guest

    Example:
    <configuration>
    <system.web>
    <httpRuntime maxRequestLength="2048" />
    </system.web>
    </configuration>

    I need to kno in my code the value of key maxRequestLength.
    Thanks in advance.
    , Nov 8, 2004
    #1
    1. Advertising

  2. Karl Seguin Guest

    Some web.config variables accessible through the framework, like
    System.Web.SessionState.SessionStateMode, others, such as the
    maxRequestLength are not (as far as I know). Therefore, the only solution
    you'll have is to parse the web.config and jump to the value with an
    xpath....the good news is since the worker process would restart itself
    whenever that file changes, you can do it once in Application_Start and
    store the value from that point on...

    Karl

    --
    MY ASP.Net tutorials
    http://www.openmymind.net/


    <> wrote in message
    news:...
    > Example:
    > <configuration>
    > <system.web>
    > <httpRuntime maxRequestLength="2048" />
    > </system.web>
    > </configuration>
    >
    > I need to kno in my code the value of key maxRequestLength.
    > Thanks in advance.
    Karl Seguin, Nov 8, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David Stephen
    Replies:
    2
    Views:
    563
    David Stephen
    Jul 10, 2003
  2. Brad

    How to query maxRequestLength?

    Brad, Nov 26, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    605
    Jacob Yang [MSFT]
    Nov 27, 2003
  3. Peter Row
    Replies:
    1
    Views:
    1,420
    Peter Row
    Dec 4, 2003
  4. CSharpner
    Replies:
    0
    Views:
    990
    CSharpner
    Apr 9, 2007
  5. David Elliott
    Replies:
    0
    Views:
    480
    David Elliott
    Jan 27, 2005
Loading...

Share This Page