Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesHandle Handle 'Maximum request length exceeded' error nicely
Previous
 
Next
New Post
3/30/2012 6:13 AM
 

Hi,

i already did some research on the net:

 http://stackoverflow.com/questi...

 http://www.velocityreviews.com/...

that should not be the way: http://www.aspdotnet-suresh.com/2011/... (adding global.asax.cs >not recommended!)

and here somebody suggest that's the way: http://codebetter.com/karlseguin/2006... (Using httpmodules)

But wat is the way? I already have an own custom module but how do you integrate it. Please give me some feedback.

 
New Post
3/30/2012 12:13 PM
 
a httpmodule would be my recommendation as we do not expose an editable global.asax

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
4/3/2012 5:47 AM
 

can you give me an example on how to integrate it?

Now i have my own module in the folder desktopmodules...

 
New Post
4/3/2012 8:46 AM
 

Ok,

I followed this tutorial:  http://www.codeproject.com/Articles/26106/Handle-Session-Timeouts-on-DotNetNuke-Through-an-H

i changed the code to this:

public void Init(HttpApplication application)
    {
        app = application;
        //app.BeginRequest += new EventHandler(Application_BeginRequest);
        app.PreRequestHandlerExecute += new EventHandler(app_PreRequestHandlerExecute);
    }

protected void app_PreRequestHandlerExecute(Object sender, EventArgs e)
    {
        HttpRuntimeSection runTime = (HttpRuntimeSection)WebConfigurationManager.GetSection("system.web/httpRuntime");
        //Approx 100 Kb(for page content) size has been deducted because the maxRequestLength proprty is the page size, not only the file upload size
        int maxRequestLength = (runTime.MaxRequestLength - 100) * 1024;
        //This code is used to check the request length of the page and if the request length is greater than
        //MaxRequestLength then retrun to the same page with extra query string value action=exception
        HttpContext context = ((HttpApplication)sender).Context;
        if (context.Request.ContentLength > maxRequestLength)
        {
            PortalSettings portalSettings = (PortalSettings)app.Context.Items["PortalSettings"];
            TabInfo tabInfo = portalSettings.ActiveTab;
            //if this tab is not "SessionTimeout" tab
            if (tabInfo.TabName != "RequestLengthExceeded")
            {
                TabController tabController = new TabController();
                tabInfo = tabController.GetTabByName("RequestLengthExceeded", portalSettings.PortalId);
                string pageUrl = Globals.NavigateURL(tabInfo.TabID, false, portalSettings, "", portalSettings.CultureCode);

                app.Context.Response.Redirect(pageUrl);
            }
        }
    }

 

Now i don't get the error above but:

---------------------------Dutch---------------------------------------
De verbinding werd geherinitialiseerd

De verbinding met de server werd geherinitialiseerd tijdens het laden van de pagina.

* Misschien is de website tijdelijk niet beschikbaar of overbelast. Probeer het
over enkele ogenblikken opnieuw.

* Controleer uw netwerkverbinding indien u geen enkele pagina kunt laden.

* Verzeker u ervan dat Firefox toegang heeft tot het web als uw
computer of netwerk is beveiligd door een firewall of proxyserver.

-------------------------------------------------------------------------

Roughly translated it says:

The connection has been re-initialized while loading the page.
- Maybe the website is not available, try it again in a few seconds
- Check your network connection in case you cant open any pages
- Be sure firefox has acces to the web if your protected by a firewall or proxy server

None of this applies to my case.

Please help :-)

 
New Post
5/24/2012 8:58 AM
 
I don't know what's exactly causing the problem, but the error you're mentioning (I'm dutch too ;-)) is usually displayed when an infinite redirect-loop, or some infinite loop in code, happens..

Perhaps that pushes you a little bit in the right direction?

Please let me know :-)
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesHandle Handle 'Maximum request length exceeded' error nicely


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out