Click here to Skip to main content
15,901,284 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Resolve issues of devexpress aspxupload control's aspxprogresshandler not working with global.asax redirect route..
Global.asax as follows:
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.SessionState;
using System.Web.Routing;
using System.Threading;
using System.IO;
namespace ResumeManager
{
    public class Global : System.Web.HttpApplication
    {

        void Application_Start(object sender, EventArgs e)
        {
            try
            {
               // RegisterRoutes(RouteTable.Routes);
               // Response.End();
            }

            catch (Exception ex)
            {

            }
            // Code that runs on application startup

        }

        void Application_End(object sender, EventArgs e)
        {
            //  Code that runs on application shutdown

        }

        void Application_Error(object sender, EventArgs e)
        {
            //Exception ex = HttpContext.Current.Server.GetLastError().GetBaseException();

            //if (ex is ThreadAbortException)
            //    return;

            ////write error log to a text file
            //string logFile = Server.MapPath(@"~/Temp/test.txt");
            //StreamWriter sw = new StreamWriter(logFile, true);
            //sw.WriteLine("");
            //sw.WriteLine("User ID: " + Request.QueryString["xxx"]);
            //sw.WriteLine("Error message: " + ex.Message);
            //sw.WriteLine("Error occurred on: " + DateTime.Now.ToString());
            //sw.WriteLine("Error Stack Trace: " + ex.StackTrace);
            //sw.WriteLine();
            //sw.Flush();
            //sw.Close();
            // Code that runs when an unhandled error occurs

        }

        void Session_Start(object sender, EventArgs e)
        {

            // Code that runs when a new session is started

        }

        void Session_End(object sender, EventArgs e)
        {
            // Code that runs when a session ends.
            // Note: The Session_End event is raised only when the sessionstate mode
            // is set to InProc in the Web.config file. If session mode is set to StateServer
            // or SQLServer, the event is not raised.

        }
        protected void Application_BeginRequest(object sender, EventArgs e)
        {
            //if (Request.AppRelativeCurrentExecutionFilePath == "~/")
            //    HttpContext.Current.RewritePath("Login.aspx");
        }
        private void RegisterRoutes(RouteCollection routes)
        {
          routes.Add(new Route("{resource}.axd/{*pathInfo}",new StopRoutingHandler()));
          routes.MapPageRoute("RouteForJob", "{JobRefId}", "~/JobReport/DetailedJob.aspx?JobRefId=longvalue");
        }
    }
}


web.config
<system.web>
		

		<identity impersonate="true" />
		<pages controlrenderingcompatibilityversion="3.5" validaterequest="false" clientidmode="AutoID" enableviewstatemac="false">
			<controls>
				<add tagprefix="asp" namespace="System.Web.UI.DataVisualization.Charting" assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
			</controls>
		</pages>
		<sessionstate mode="InProc" timeout="525600"></sessionstate>
		<customerrors mode="Off" />
		<compilation debug="true" targetframework="4.0">
			<assemblies>
				<add assembly="DevExpress.Web.ASPxEditors.v12.1, Version=12.1.6.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A" />
				<add assembly="DevExpress.Web.ASPxThemes.v12.1, Version=12.1.6.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A" />
				<add assembly="DevExpress.Web.v12.1, Version=12.1.6.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A" />
				<add assembly="DevExpress.Data.v12.1, Version=12.1.6.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A" />
				<add assembly="DevExpress.XtraReports.v12.1.Web, Version=12.1.6.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A" />
				<add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
				<add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
				<add assembly="DevExpress.Printing.v12.1.Core, Version=12.1.6.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A" />
				<add assembly="DevExpress.XtraReports.v12.1, Version=12.1.6.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A" />
				<add assembly="DevExpress.Utils.v12.1, Version=12.1.6.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A" />
				<add assembly="DevExpress.XtraCharts.v12.1.Web, Version=12.1.6.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A" />
				<add assembly="DevExpress.Web.ASPxEditors.v12.1, Version=12.1.6.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A" />
				<add assembly="DevExpress.Web.v12.1, Version=12.1.6.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A" />
				<add assembly="DevExpress.Data.v12.1, Version=12.1.6.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A" />
				<add assembly="DevExpress.Web.ASPxGridView.v12.1.Export, Version=12.1.6.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A" />
				<add assembly="DevExpress.XtraPrinting.v12.1, Version=12.1.6.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A" />
				<add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
				<add assembly="DevExpress.Web.ASPxScheduler.v12.1, Version=12.1.6.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A" />
				<add assembly="DevExpress.XtraScheduler.v12.1.Core, Version=12.1.6.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A" /></assemblies>
		</compilation>
		<authentication mode="Forms">
      <forms loginUrl="~/Account/Login.aspx" timeout="2880"/>
		</authentication>
		<membership defaultprovider="AspNetSqlMembershipProviderRelaxed">
			<providers>
				<clear />
				<add connectionstringname="ConnectionString" applicationname="/" maxinvalidpasswordattempts="10" enablepasswordretrieval="false" enablepasswordreset="true" requiresquestionandanswer="false" passwordstrengthregularexpression="" minrequiredpasswordlength="1" minrequirednonalphanumericcharacters="0" name="AspNetSqlMembershipProviderRelaxed" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
			</providers>
		</membership>
		<rolemanager enabled="true">
			<providers>
				<clear />
				<remove name="AspNetSqlRoleProvider" />
				<add name="AspNetSqlRoleProvider" connectionstringname="ConnectionString" applicationname="/" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
			</providers>
		</rolemanager>
		<httpruntime requestvalidationmode="2.0" maxrequestlength="102400" executiontimeout="3600" />
		<httpmodules>
			<add type="DevExpress.Web.ASPxClasses.ASPxHttpHandlerModule, DevExpress.Web.v12.1, Version=12.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" name="ASPxHttpHandlerModule" />
		</httpmodules>
		<httphandlers>
			<add path="ChartImg.axd" verb="GET,HEAD,POST" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false" />
			<add path="ASPxUploadProgressHandlerPage.ashx" verb="GET,POST" type="DevExpress.Web.ASPxUploadControl.ASPxUploadProgressHttpHandler, DevExpress.Web.v12.1, Version=12.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" validate="false" />
			<add path="DX.ashx" verb="GET,POST" type="DevExpress.Web.ASPxClasses.ASPxHttpHandlerModule, DevExpress.Web.v12.1, Version=12.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" validate="false" />
		</httphandlers>
	</system.web>
	<system.webserver>
		<defaultdocument enabled="true">
			<files>
				<clear />
				<add value="Login.aspx" />
			</files>
		</defaultdocument>
    <modules runallmanagedmodulesforallrequests="true">
      <remove name="UrlRoutingModule" />
      <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
      <add type="DevExpress.Web.ASPxClasses.ASPxHttpHandlerModule, DevExpress.Web.v12.1, Version=12.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" name="ASPxHttpHandlerModule" />
    </modules>
   
		<validation validateintegratedmodeconfiguration="false" />
		<handlers>
			<remove name="ChartImageHandler" />
			<add type="DevExpress.Web.ASPxUploadControl.ASPxUploadProgressHttpHandler, DevExpress.Web.v12.1, Version=12.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" verb="GET,POST" path="ASPxUploadProgressHandlerPage.ashx" name="ASPxUploadProgressHandler" precondition="integratedMode" />
			<add type="DevExpress.Web.ASPxClasses.ASPxHttpHandlerModule, DevExpress.Web.v12.1, Version=12.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" verb="GET,POST" path="DX.ashx" name="ASPxHttpHandlerModule" precondition="integratedMode" />
			<add name="ChartImageHandler" precondition="integratedMode" verb="GET,HEAD,POST" path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
      <add>
        name="UrlRoutingHandler"
        preCondition="integratedMode"
        verb="*" path="UrlRouting.axd"
        type="System.Web.HttpForbiddenHandler, System.Web,  
              Version=2.0.0.0, Culture=neutral,  
              PublicKeyToken=b03f5f7f11d50a3a"/>
		</add></handlers>
		<httpprotocol>
			<customheaders>
				<clear />
				<add name="X-UA-Compatible" value="IE=9" />
			</customheaders>
		</httpprotocol>
	</system.webserver>
Posted
Updated 17-Mar-13 5:00am
v3
Comments
Richard C Bishop 14-Mar-13 15:07pm    
This is not a question. Try and rephrase your issue and ask a specific question about a problem you are having as well as listing any error messages you have.
ZurdoDev 14-Mar-13 15:37pm    
I would ask devexpress.
Korathu 2 17-Mar-13 11:02am    
Actualy i am not reposting intentionaly....I am getting 404 not found error while using aspxuploadprogressbar handler in devexpress...Its happpening due to url routing set in global.asax.Pls tell a way to resolve this....

Couple things to check.

1. look for the file App_Start/RouteConfig.cs
C#
// Ignore route statements. (DevExpress)
            routes.IgnoreRoute("{resource}.ashx/{*pathInfo}");


2. Web.config has the proper values.
- you'll have to ping DevExpress for that because ..

3. IIS running as Classic or Integrated
- needs to match what you put in the Web.config

4. (here is the part that hosed me) You'll need the following folders
/App_Data/UploadTemp

5. Set permission on the above folder to NETWORK SERVICE

DevExpress documentation on this is weak at best if not non-existent.

Hope this helps!
 
Share this answer
 
Here is the link to the DevExpress Web.config issue.
https://documentation.devexpress.com/#AspNet/CustomDocument6774[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900