Search Results

Search found 126 results on 6 pages for 'httpexception'.

Page 1/6 | 1 2 3 4 5 6  | Next Page >

  • CompliationLock throws HttpException when registering areas for ASP.NET MVC unit tests

    - by patridge
    The moment I added a unit test to my ASP.NET MVC application to test some of the area routing, I got an HttpException coming out of the System.Web.Complication.CompilationLock type initializer with the following stack trace. System.Web.HttpException : The type initializer for 'System.Web.Compilation.CompilationLock' threw an exception. ----> System.TypeInitializationException : The type initializer for 'System.Web.Compilation.CompilationLock' threw an exception. ----> System.NullReferenceException : Object reference not set to an instance of an object. at System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() at System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() at System.Web.Compilation.BuildManager.GetReferencedAssemblies() at System.Web.Mvc.BuildManagerWrapper.System.Web.Mvc.IBuildManager.GetReferencedAssemblies() at System.Web.Mvc.TypeCacheUtil.FilterTypesInAssemblies(IBuildManager buildManager, Predicate`1 predicate) at System.Web.Mvc.TypeCacheUtil.GetFilteredTypesFromAssemblies(String cacheName, Predicate`1 predicate, IBuildManager buildManager) at System.Web.Mvc.AreaRegistration.RegisterAllAreas(RouteCollection routes, IBuildManager buildManager, Object state) at System.Web.Mvc.AreaRegistration.RegisterAllAreas(Object state) at System.Web.Mvc.AreaRegistration.RegisterAllAreas() at StpWeb.MvcApplication.RegisterRoutes(RouteCollection routes) in Global.asax.cs: line 16 at StpWeb.Tests.RoutesTest.TestFixtureSetUp() in RoutesTest.cs: line 11 --TypeInitializationException at System.Web.Compilation.CompilationLock.GetLock(ref Boolean gotLock) at System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() --NullReferenceException at System.Web.Compilation.CompilationLock..cctor()

    Read the article

  • ASP.net MVC HttpException strange file not found

    - by Paddy
    I'm running asp.net MVC site on IIS6 - I've edited my routing to look like the following: routes.MapRoute( "Default", "{controller}.aspx/{action}/{id}", new { controller = "Home", action = "Index", id = "" } ); routes.MapRoute( "Root", "", new { controller = "Home", action = "Index", id = "" } ); So all my urls now contain .aspx (as per one of the solutions from Phil Haack). Now, I catch all unhandled exceptions using Elmah, and for almost every page request, I get the following error caught by Elmah, that I never see on the front end (everything works perfectly): System.Web.HttpException: The file '/VirtualDirectoryName/Home.aspx' does not exist. System.Web.HttpException: The file '/VirtualDirectoryName/Home.aspx' does not exist. at System.Web.UI.Util.CheckVirtualFileExists(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert) at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert) at System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) at System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) at System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) at System.Web.HttpApplication.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) There is a Home controller, and it should be found, but I'm not sure a) where this is being called from, and b) why I don't see this error on the front end. Any ideas? Edited with answer: I think the answer for this can be found in this question: http://stackoverflow.com/questions/34194/asp-net-mvc-on-iis6

    Read the article

  • Facebook canvas app ASP.NET MVC HttpException: Invalid Model

    - by zznq
    I am working on a Facebook tab application. I am using asp.net MVC 2 with the "official" Microsoft Facebook SDK. Most of my views are working just fine. However, I have one that is causing a huge mess. I am simply returning a List<Tags> to the view and as my ViewModel. This problematic view is simply displaying the list in a foreach loop. Whenever navigate to this view I get a "System.Web.HttpException: Invalid Model" exception. The most puzzling part of all this is that the same code is running without fail on our regular(non-Facebook) app that works just fine with the same code. Any insight into why Facebook and asp.net MVC 2 would be causing this behavior would be much appreciated.

    Read the article

  • System.Web.HttpException in asp.net mvc 2 on images and javascript files

    - by Rippo
    Hi I am getting the following errors reported by ELMAH on my asp.net mvc 2 site for javascript files, images etc. System.Web.HttpException: The remote host closed the connection I have done some research and it appears that the user/bot is clicking a link on the site before the page has fully loaded. Now this error never occurs on a controller action but always on a file that is on disk. e.g. /Content/CmsImages/logo.png /Content/CmsImages/MemberImages/Photo-001605.jpg /Content/jquery.tickertype.js So this means that all static files are being routed through the mvc pipeline. What options do I have?

    Read the article

  • How to avoid an HttpException due to timeout

    - by Dan
    I'm working on a website powered by .NET asp/C# code. The clients require that sessions have a 25 minute timeout. However, sometimes the site is used, and a user stays connected for long periods of time (longer than 25 mins). Session_End is triggered: protected void Session_End(Object sender, EventArgs e) { Hashtable trackingInformaiton = (Hashtable)Application["trackingInformation"]; trackingInformaiton.Remove(Session["trackingID"]); } The user returns some time later, but when they interact with the website, they get an error, and we get this email notification: User: Unauthenticated User Error: System.Web.HttpException Description: Failed to load viewstate. The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request... The telling part of the stack trace is System.Web.UI.Control.AddedControl. Apparently, the server has thrown away the session data, and is sending new data, but the client is trying to deal with old data. Hence the error that "the control tree into which viewstate is being loaded [doesn't] match the control tree that was used to save the viewstate during the prevoius request." So here's the question. How can I force instruct the user's browser to redirect to a "you're logged out" screen when the connection times out? (Is it something I should add to the Session_End method?)

    Read the article

  • Server.transfer causing HttpException

    - by salvationishere
    I am developing a C#/SQL ASP.NET web application in VS 2008. Currently I am using the Server.Transfer method to transfer control from one ASPX.CS file to another ASPX file. The first time through, this works. But after control is transferred to this new file it encounters a condition: if (restart == false) { where "restart" is a boolean variable. After this statement it immediately transfers control back to the same ASPX.CS file and tries to reexecute the Server.Transfer method. This time it gives me the following exception and stack trace. Do you know what is causing this? I tried to read this but it didn't make much sense to me. System.Web.HttpException was unhandled by user code Message="Error executing child request for DataMatch.aspx." Source="System.Web" ErrorCode=-2147467259 StackTrace: at System.Web.HttpServerUtility.Execute(String path, TextWriter writer, Boolean preserveForm) at System.Web.HttpServerUtility.Transfer(String path, Boolean preserveForm) at System.Web.HttpServerUtility.Transfer(String path) at AddFileToSQL._Default.btnAppend_Click(Object sender, EventArgs e) in C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\Default.aspx.cs:line 109 at System.Web.UI.HtmlControls.HtmlInputButton.OnServerClick(EventArgs e) at System.Web.UI.HtmlControls.HtmlInputButton.RaisePostBackEvent(String eventArgument) at System.Web.UI.HtmlControls.HtmlInputButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) InnerException: System.Web.HttpCompileException Message="c:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx(14): error CS1502: The best overloaded method match for 'System.Web.UI.HtmlControls.HtmlTableRowCollection.Add(System.Web.UI.HtmlControls.HtmlTableRow)' has some invalid arguments" Source="System.Web" ErrorCode=-2147467259 SourceCode="#pragma checksum \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\" \"{406ea660-64cf-4c82-b6f0-42d48172a799}\" \"76750ABD913CF678D216C1E9CFB62BDF\"\r\n//------------------------------------------------------------------------------\r\n// \r\n// This code was generated by a tool.\r\n// Runtime Version:2.0.50727.3603\r\n//\r\n// Changes to this file may cause incorrect behavior and will be lost if\r\n// the code is regenerated.\r\n// \r\n//------------------------------------------------------------------------------\r\n\r\nnamespace ASP {\r\n \r\n #line 285 \"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config\"\r\n using System.Web.Profile;\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 280 \"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config\"\r\n using System.Text.RegularExpressions;\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 282 \"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config\"\r\n using System.Web.Caching;\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 278 \"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config\"\r\n using System.Configuration;\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 277 \"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config\"\r\n using System.Collections.Specialized;\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 19 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n using System.Web.UI.WebControls.WebParts;\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 289 \"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config\"\r\n using System.Web.UI.HtmlControls;\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 19 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n using System.Web.UI.WebControls;\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 19 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n using System.Web.UI;\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 276 \"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config\"\r\n using System.Collections;\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 275 \"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config\"\r\n using System;\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 284 \"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config\"\r\n using System.Web.Security;\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 281 \"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config\"\r\n using System.Web;\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 283 \"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config\"\r\n using System.Web.SessionState;\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 279 \"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config\"\r\n using System.Text;\r\n \r\n #line default\r\n #line hidden\r\n \r\n \r\n [System.Runtime.CompilerServices.CompilerGlobalScopeAttribute()]\r\n public class datamatch_aspx : global::AddFileToSQL.DataMatch, System.Web.SessionState.IRequiresSessionState, System.Web.IHttpHandler {\r\n \r\n private static bool @_initialized;\r\n \r\n private static object @_fileDependencies;\r\n \r\n [System.Diagnostics.DebuggerNonUserCodeAttribute()]\r\n public datamatch_aspx() {\r\n string[] dependencies;\r\n ((global::AddFileToSQL.DataMatch)(this)).AppRelativeVirtualPath = \"~/DataMatch.aspx\";\r\n if ((global::ASP.datamatch_aspx.@__initialized == false)) {\r\n dependencies = new string[1];\r\n dependencies[0] = \"~/DataMatch.aspx\";\r\n global::ASP.datamatch_aspx.@__fileDependencies = this.GetWrappedFileDependencies(dependencies);\r\n global::ASP.datamatch_aspx.@__initialized = true;\r\n }\r\n this.Server.ScriptTimeout = 30000000;\r\n }\r\n \r\n protected System.Web.Profile.DefaultProfile Profile {\r\n get {\r\n return ((System.Web.Profile.DefaultProfile)(this.Context.Profile));\r\n }\r\n }\r\n \r\n protected ASP.global_asax ApplicationInstance {\r\n get {\r\n return ((ASP.global_asax)(this.Context.ApplicationInstance));\r\n }\r\n }\r\n \r\n [System.Diagnostics.DebuggerNonUserCodeAttribute()]\r\n private global::System.Web.UI.HtmlControls.HtmlTitle @_BuildControl_control3() {\r\n global::System.Web.UI.HtmlControls.HtmlTitle @_ctrl;\r\n \r\n #line 6 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl = new global::System.Web.UI.HtmlControls.HtmlTitle();\r\n \r\n #line default\r\n #line hidden\r\n return @_ctrl;\r\n }\r\n \r\n [System.Diagnostics.DebuggerNonUserCodeAttribute()]\r\n private global::System.Web.UI.HtmlControls.HtmlHead @_BuildControl_control2() {\r\n global::System.Web.UI.HtmlControls.HtmlHead @_ctrl;\r\n \r\n #line 5 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl = new global::System.Web.UI.HtmlControls.HtmlHead(\"head\");\r\n \r\n #line default\r\n #line hidden\r\n global::System.Web.UI.HtmlControls.HtmlTitle @_ctrl1;\r\n \r\n #line 5 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl1 = this.@_BuildControl_control3();\r\n \r\n #line default\r\n #line hidden\r\n System.Web.UI.IParserAccessor @_parser = ((System.Web.UI.IParserAccessor)(@_ctrl));\r\n \r\n #line 5 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_parser.AddParsedSubObject(@_ctrl1);\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 5 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_parser.AddParsedSubObject(new System.Web.UI.LiteralControl(\"\r\n \r\n \r\n \r\n \r\n\"));\r\n \r\n #line default\r\n #line hidden\r\n return @_ctrl;\r\n }\r\n \r\n [System.Diagnostics.DebuggerNonUserCodeAttribute()]\r\n private global::System.Web.UI.HtmlControls.HtmlTableRow @_BuildControl_control5() {\r\n global::System.Web.UI.HtmlControls.HtmlTableRow @_ctrl;\r\n \r\n #line 15 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl = new global::System.Web.UI.HtmlControls.HtmlTableRow();\r\n \r\n #line default\r\n #line hidden\r\n return @_ctrl;\r\n }\r\n \r\n [System.Diagnostics.DebuggerNonUserCodeAttribute()]\r\n private global::System.Web.UI.WebControls.PlaceHolder @_BuildControlphTextBoxes() {\r\n global::System.Web.UI.WebControls.PlaceHolder @_ctrl;\r\n \r\n #line 19 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl = new global::System.Web.UI.WebControls.PlaceHolder();\r\n \r\n #line default\r\n #line hidden\r\n this.phTextBoxes = @_ctrl;\r\n \r\n #line 19 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl.ID = \"phTextBoxes\";\r\n \r\n #line default\r\n #line hidden\r\n return @_ctrl;\r\n }\r\n \r\n [System.Diagnostics.DebuggerNonUserCodeAttribute()]\r\n private global::System.Web.UI.HtmlControls.HtmlTableCell @_BuildControl_control8() {\r\n global::System.Web.UI.HtmlControls.HtmlTableCell @_ctrl;\r\n \r\n #line 18 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl = new global::System.Web.UI.HtmlControls.HtmlTableCell(\"td\");\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 18 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl.Align = \"center\";\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 18 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl.VAlign = \"top\";\r\n \r\n #line default\r\n #line hidden\r\n System.Web.UI.IParserAccessor @_parser = ((System.Web.UI.IParserAccessor)(@_ctrl));\r\n \r\n #line 18 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_parser.AddParsedSubObject(new System.Web.UI.LiteralControl(\"\r\n \"));\r\n \r\n #line default\r\n #line hidden\r\n global::System.Web.UI.WebControls.PlaceHolder @_ctrl1;\r\n \r\n #line 18 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl1 = this.@_BuildControlphTextBoxes();\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 18 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_parser.AddParsedSubObject(@_ctrl1);\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 18 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_parser.AddParsedSubObject(new System.Web.UI.LiteralControl(\"\r\n \"));\r\n \r\n #line default\r\n #line hidden\r\n return @_ctrl;\r\n }\r\n \r\n [System.Diagnostics.DebuggerNonUserCodeAttribute()]\r\n private global::System.Web.UI.WebControls.Label @_BuildControlInstructions() {\r\n global::System.Web.UI.WebControls.Label @_ctrl;\r\n \r\n #line 22 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl = new global::System.Web.UI.WebControls.Label();\r\n \r\n #line default\r\n #line hidden\r\n this.Instructions = @_ctrl;\r\n @_ctrl.ApplyStyleSheetSkin(this);\r\n \r\n #line 22 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl.ID = \"Instructions\";\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 22 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl.Font.Italic = true;\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 22 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl.Text = \"Now select from the dropdownlists which table columns from my database you want t\" +\r\n \"o map these fields to\";\r\n \r\n #line default\r\n #line hidden\r\n return @_ctrl;\r\n }\r\n \r\n [System.Diagnostics.DebuggerNonUserCodeAttribute()]\r\n private global::System.Web.UI.HtmlControls.HtmlTableCell @_BuildControl_control9() {\r\n global::System.Web.UI.HtmlControls.HtmlTableCell @_ctrl;\r\n \r\n #line 21 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl = new global::System.Web.UI.HtmlControls.HtmlTableCell(\"td\");\r\n \r\n #line default\r\n #line hidden\r\n System.Web.UI.IParserAccessor @_parser = ((System.Web.UI.IParserAccessor)(@_ctrl));\r\n \r\n #line 21 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_parser.AddParsedSubObject(new System.Web.UI.LiteralControl(\"\r\n \"));\r\n \r\n #line default\r\n #line hidden\r\n global::System.Web.UI.WebControls.Label @_ctrl1;\r\n \r\n #line 21 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl1 = this.@_BuildControlInstructions();\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 21 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_parser.AddParsedSubObject(@_ctrl1);\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 21 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_parser.AddParsedSubObject(new System.Web.UI.LiteralControl(\"\r\n \"));\r\n \r\n #line default\r\n #line hidden\r\n return @_ctrl;\r\n }\r\n \r\n [System.Diagnostics.DebuggerNonUserCodeAttribute()]\r\n private global::System.Web.UI.WebControls.Button @_BuildControlbtnSubmit() {\r\n global::System.Web.UI.WebControls.Button @_ctrl;\r\n \r\n #line 26 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl = new global::System.Web.UI.WebControls.Button();\r\n \r\n #line default\r\n #line hidden\r\n this.btnSubmit = @_ctrl;\r\n @_ctrl.ApplyStyleSheetSkin(this);\r\n \r\n #line 26 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl.ID = \"btnSubmit\";\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 26 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl.Text = \"Submit\";\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 26 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl.Width = new System.Web.UI.WebControls.Unit(150, System.Web.UI.WebControls.UnitType.Pixel);\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 26 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n ((System.Web.UI.IAttributeAccessor)(@_ctrl)).SetAttribute(\"style\", \"top:auto; left:auto\");\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 26 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n ((System.Web.UI.IAttributeAccessor)(@_ctrl)).SetAttribute(\"top\", \"100px\");\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 26 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl.Click -= new System.EventHandler(this.btnSubmit_Click);\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 26 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @__ctrl.Click += new System.EventHandler(this.btnSubmit_Click);\r\n \r\n #line default\r\n #line hidden\r\n return @_ctrl;\r\n }\r\n \r\n [System.Diagnostics.DebuggerNonUserCodeAttribute()]\r\n private global::System.Web.UI.HtmlControls.HtmlTableCell @_BuildControl_control10() {\r\n global::System.Web.UI.HtmlControls.HtmlTableCell @_ctrl;\r\n \r\n #line 25 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl = new global::System.Web.UI.HtmlControls.HtmlTableCell(\"td\");\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 25 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl.Align = \"center\";\r\n \r\n #line default\r\n #line hidden\r\n System.Web.UI.IParserAccessor @_parser = ((System.Web.UI.IParserAccessor)(@_ctrl));\r\n \r\n #line 25 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_parser.AddParsedSubObject(new System.Web.UI.LiteralControl(\"\r\n \"));\r\n \r\n #line default\r\n #line hidden\r\n global::System.Web.UI.WebControls.Button @_ctrl1;\r\n \r\n #line 25 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl1 = this.@_BuildControlbtnSubmit();\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 25 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_parser.AddParsedSubObject(@_ctrl1);\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 25 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_parser.AddParsedSubObject(new System.Web.UI.LiteralControl(\"\r\n  \r\n \"));\r\n \r\n #line default\r\n #line hidden\r\n return @_ctrl;\r\n }\r\n \r\n [System.Diagnostics.DebuggerNonUserCodeAttribute()]\r\n private void @_BuildControl_control7(System.Web.UI.HtmlControls.HtmlTableCellCollection @_ctrl) {\r\n global::System.Web.UI.HtmlControls.HtmlTableCell @_ctrl1;\r\n \r\n #line 17 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl1 = this.@_BuildControl_control8();\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 17 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl.Add(@_ctrl1);\r\n \r\n #line default\r\n #line hidden\r\n global::System.Web.UI.HtmlControls.HtmlTableCell @_ctrl2;\r\n \r\n #line 17 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl2 = this.@_BuildControl_control9();\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 17 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl.Add(@_ctrl2);\r\n \r\n #line default\r\n #line hidden\r\n global::System.Web.UI.HtmlControls.HtmlTableCell @_ctrl3;\r\n \r\n #line 17 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl3 = this.@_BuildControl_control10();\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 17 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl.Add(@_ctrl3);\r\n \r\n #line default\r\n #line hidden\r\n }\r\n \r\n [System.Diagnostics.DebuggerNonUserCodeAttribute()]\r\n private global::System.Web.UI.HtmlControls.HtmlTableRow @_BuildControl_control6() {\r\n global::System.Web.UI.HtmlControls.HtmlTableRow @_ctrl;\r\n \r\n #line 17 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl = new global::System.Web.UI.HtmlControls.HtmlTableRow();\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 17 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl.Align = \"center\";\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 17 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n this.@_BuildControl_control7(@_ctrl.Cells);\r\n \r\n #line default\r\n #line hidden\r\n return @_ctrl;\r\n }\r\n \r\n [System.Diagnostics.DebuggerNonUserCodeAttribute()]\r\n private global::System.Web.UI.WebControls.Literal @_BuildControllTextData() {\r\n global::System.Web.UI.WebControls.Literal @_ctrl;\r\n \r\n #line 34 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl = new global::System.Web.UI.WebControls.Literal();\r\n \r\n #line default\r\n #line hidden\r\n this.lTextData = @_ctrl;\r\n \r\n #line 34 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl.ID = \"lTextData\";\r\n \r\n #line default\r\n #line hidden\r\n return @_ctrl;\r\n }\r\n \r\n [System.Diagnostics.DebuggerNonUserCodeAttribute()]\r\n private global::System.Web.UI.WebControls.Panel @_BuildControlpnlDisplayData() {\r\n global::System.Web.UI.WebControls.Panel @_ctrl;\r\n \r\n #line 31 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl = new global::System.Web.UI.WebControls.Panel();\r\n \r\n #line default\r\n #line hidden\r\n this.pnlDisplayData = @_ctrl;\r\n @_ctrl.ApplyStyleSheetSkin(this);\r\n \r\n #line 31 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl.ID = \"pnlDisplayData\";\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 31 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl.Visible = false;\r\n \r\n #line default\r\n #line hidden\r\n System.Web.UI.IParserAccessor @_parser = ((System.Web.UI.IParserAccessor)(@_ctrl));\r\n \r\n #line 31 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_parser.AddParsedSubObject(new System.Web.UI.LiteralControl(\"\r\n \r\n \r\n \" +\r\n \" \"));\r\n \r\n #line default\r\n #line hidden\r\n global::System.Web.UI.WebControls.Literal @_ctrl1;\r\n \r\n #line 31 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_ctrl1 = this.@_BuildControllTextData();\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 31 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_parser.AddParsedSubObject(@_ctrl1);\r\n \r\n #line default\r\n #line hidden\r\n \r\n #line 31 \"C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL\DataMatch.aspx\"\r\n @_parser.AddParsedSubObject(new System.Web.UI.LiteralCont

    Read the article

  • System.Web.HttpException on asp:gridview pagination

    - by Carlos Muñoz
    I have the following <asp:gridview> with one one TemplateField. En each cell there is an image with a link and a text with a link. It has AllowPaging=True This is the gridview: <asp:GridView ID="gvExperiencias" runat="server" AllowPaging="True" GridLines="None" ShowHeader="False" AutoGenerateColumns="False" Width="650px" PageSize="4" OnDataBinding="gvExperiencias_DataBinding" OnPageIndexChanging="gvExperiencias_PageIndexChanging"> <PagerSettings Mode="NumericFirstLast" FirstPageImageUrl="~/images/fle_pag_izq.gif" LastPageImageUrl="~/images/fle_pag_der.gif" NextPageImageUrl="~/images/fle_pag_der.gif" PreviousPageImageUrl="~/images/fle_pag_izq.gif" Position="TopAndBottom" PageButtonCount="4" FirstPageText="" LastPageText="" NextPageText="" PreviousPageText=""></PagerSettings> <Columns> <asp:TemplateField> <ItemTemplate> <div id="it_0" class="new_solo_exp_ini"> <asp:HyperLink ID="a_0" runat="server" NavigateUrl='<%# "experiencia.aspx?cod_cod=" + Eval("tttb_articulo_relacion_0.ARTCOD_ARTREL") + "&pag=" + pag + "&grp=" + Eval("idiocod_cod_idi_0") + "&cod="+cod %>' Visible='<%# Eval("NotEmpty_0") %>'> <asp:Image ID="Image_0" runat="server" Height="88px" ImageUrl='<%# Eval("arigls_nom_img_0","~/ArchivosUsuario/1/1/Articulos/{0}") %>' Width="88px" CssClass="new_image_exp_ini" /> </asp:HyperLink> <div class="new_vineta_tit_exp_ini"> <asp:HyperLink ID="HyperLink_0" runat="server" NavigateUrl='<%# "experiencia.aspx?cod_cod=" + Eval("tttb_articulo_relacion_0.ARTCOD_ARTREL") + "&pag=" + pag + "&grp=" + Eval("idiocod_cod_idi_0") + "&cod="+cod %>' Text='<%# Bind("arigls_tit_0") %>'> </asp:HyperLink> </div> </div> </ItemTemplate> </asp:TemplateField> </Columns> <PagerStyle CssClass="new_pag_bajo_exp_ini" /> <RowStyle CssClass="new_fila_exp_ini" /> </asp:GridView> When I click the last button or the ... it goes to the corresponding page but when i click on a previous page i get the following errror: An Error Has Occurred Because A Control With Id $ContentPlaceHolder1$gvExperiencias$ctl01$ctl01' Could Not Be Located Or A Different Control Is assigned to the same ID after postback. If the ID is not assigned, explicitly set the ID property of controls that raise postback events to avoid this error. So the pager does not work correctly. I think it's because of the Image's Id that has to be generated dinamically but i don't know how to do it. Can someone help me?

    Read the article

  • Server.Transfer("error_404.aspx") in Application_Error returns a blank page

    - by qntmfred
    I look for HttpExceptions in the Application_Error sub of my global.asx Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs) Dim ex As Exception = HttpContext.Current.Server.GetLastError() If ex IsNot Nothing Then If TypeOf (ex) Is HttpUnhandledException Then If ex.InnerException Is Nothing Then Server.Transfer("error.aspx", False) End If ex = ex.InnerException End If If TypeOf (ex) Is HttpException Then Dim httpCode As Integer = CType(ex, HttpException).GetHttpCode() If httpCode = 404 Then Server.ClearError() Server.Transfer("error_404.aspx", False) End If End If End If End Sub I can step through this code and confirm it does hit the Server.Transfer("error_404.aspx"), as well as the Page_Load of error_404.aspx, but all it shows is a blank page.

    Read the article

  • Not getting redirection to custom error page using custom errors - ASP.Net

    - by weevie
    Here's my Application_OnError event sink in global.asax.vb: Sub Application_OnError(ByVal sender As Object, ByVal e As EventArgs) Dim innerMostException As Exception = getInnerMostException(Me.Context.Error) If TypeOf innerMostException Is AccessDeniedException Then Security.LogAccessDeniedOccurrence(DirectCast(innerMostException, AccessDeniedException)) Dim fourOhThree As Integer = DirectCast(HttpStatusCode.Forbidden, Integer) Throw New HttpException(fourOhThree, innerMostException.Message, innerMostException) End If End Sub You'll see that if we've got an innermost Exception of type AccessDeniedException we throw a new HTTPExcpetion with a status code of 403 AKA 'forbidden' Here's the relevant web.config entry: <customErrors defaultRedirect="~/Application/ServerError.aspx" mode="On"> <error statusCode="403" redirect="~/Secure/AccessDenied.aspx" /> </customErrors> So what we're expecting is a redirect to the AccessDenied.aspx page. What we get is a redirect to the ServerError.aspx page. We've also tried this: Sub Application_OnError(ByVal sender As Object, ByVal e As EventArgs) Dim innerMostException As Exception = getInnerMostException(Me.Context.Error) If TypeOf innerMostException Is AccessDeniedException Then Security.LogAccessDeniedOccurrence(DirectCast(innerMostException, AccessDeniedException)) Context.Response.StatusCode = DirectCast(HttpStatusCode.Forbidden, Integer) End If End Sub Which unsuprisingly doesn't work either. Any ideas what we're doing wrong?

    Read the article

  • BinaryWrite exception "OutputStream is not available when a custom TextWriter is used" in MVC 2 ASP.

    - by Grant
    Hi, I have a view rendering a stream using the response BinaryWrite method. This all worked fine under ASP.NET 4 using the Beta 2 but throws this exception in the RC release: "HttpException" , "OutputStream is not available when a custom TextWriter is used." <%@ Page Title="" Language="C#" Inherits="System.Web.Mvc.ViewPage" %> <%@ Import Namespace="System.IO" %> <script runat="server"> protected void Page_Load(object sender, EventArgs e) { if (ViewData["Error"] == null) { Response.Buffer = true; Response.Clear(); Response.ContentType = ViewData["DocType"] as string; Response.AddHeader("content-disposition", ViewData["Disposition"] as string); Response.CacheControl = "No-cache"; MemoryStream stream = ViewData["DocAsStream"] as MemoryStream; Response.BinaryWrite(stream.ToArray()); Response.Flush(); Response.Close(); } } </script> </script> The view is generated from a client side redirect (jquery replace location call in the previous page using Url.Action helper to render the link of course). This is all in an iframe. Anyone have an idea why this occurs?

    Read the article

  • Render view to string followed by redirect results in exception

    - by Chris Charabaruk
    So here's the issue: I'm building e-mails to be sent by my application by rendering full view pages to strings and sending them. This works without any problem so long as I'm not redirecting to another URL on the site afterwards. Whenever I try, I get "System.Web.HttpException: Cannot redirect after HTTP headers have been sent." I believe the problem comes from the fact I'm reusing the context from the controller action where the call for creating the e-mail comes from. More specifically, the HttpResponse from the context. Unfortunately, I can't create a new HttpResponse that makes use of HttpWriter because the constructor of that class is unreachable, and using any other class derived from TextWriter causes response.Flush() to throw an exception, itself. Does anyone have a solution for this? public static string RenderViewToString( ControllerContext controllerContext, string viewPath, string masterPath, ViewDataDictionary viewData, TempDataDictionary tempData) { Stream filter = null; ViewPage viewPage = new ViewPage(); //Right, create our view viewPage.ViewContext = new ViewContext(controllerContext, new WebFormView(viewPath, masterPath), viewData, tempData); //Get the response context, flush it and get the response filter. var response = viewPage.ViewContext.HttpContext.Response; //var response = new HttpResponseWrapper(new HttpResponse // (**TextWriter Goes Here**)); response.Flush(); var oldFilter = response.Filter; try { //Put a new filter into the response filter = new MemoryStream(); response.Filter = filter; //Now render the view into the memorystream and flush the response viewPage.ViewContext.View.Render(viewPage.ViewContext, viewPage.ViewContext.HttpContext.Response.Output); response.Flush(); //Now read the rendered view. filter.Position = 0; var reader = new StreamReader(filter, response.ContentEncoding); return reader.ReadToEnd(); } finally { //Clean up. if (filter != null) filter.Dispose(); //Now replace the response filter response.Filter = oldFilter; } }

    Read the article

  • Rendering a view to a string in MVC, then redirecting -- workarounds?

    - by James S
    Hi -- I can't render a view to a string and then redirect, despite this answer from Feb (after version 1.0, I think) that claims it's possible. I thought I was doing something wrong, and then I read this answer from Haack in July that claims it's not possible. If somebody has it working and can help me get it working, that's great (and I'll post code, errors). However, I'm now at the point of needing workarounds. There are a few, but nothing ideal. Has anybody solved this, or have any comments on my ideas? This is to render email. While I can surely send the email outside of the web request (store info in a db and get it later), there are many types of emails and I don't want to store the template data (user object, a few other LINQ objects) in a db to let it get rendered later. I could create a simpler, serializable POCO and save that in the db, but why? ... I just want rendered text! I can create a new RedirectToAction object that checks if the headers have been sent (can't figure out how to do this -- try/catch?) and, if so, builds out a simple page with a meta redirect, a javascript redirect, and also a "click here" link. Within my controller, I can remember if I've rendered an email and, if so, manually do #2 by displaying a view. I can manually send the redirect headers before any potential email rendering. Then, rather than using the MVC infrastructure to redirecttoaction, I just call result.end. This seems easiest, but really messy. Anything else? EDIT: I've tried Dan's code (very similar to the code from Jan/Feb that I've already tried) and I'm still getting the same error. The only substantial difference I can see is that his example uses a view while I use a partial view. I'll try testing this later with a view. Here's what I've got: Controller public ActionResult Certifications(string email_intro) { //a lot of stuff ViewData["users"] = users; if (isPost()) { //create the viewmodel var view_model = new ViewModels.Emails.Certifications.Open(userContext) { emailIntro = email_intro }; //i've tried stopping this after just one iteration, in case the problem is due to calling it multiple times foreach (var user in users) { if (user.Email_Address.IsValidEmailAddress()) { //add more stuff to the view model specific to this user view_model.user = user; view_model.certification302Summary.subProcessesOwner = new SubProcess_Certifications(RecordUpdating.Role.Owner, null, null, user.User_ID, repository); //more here.... //if i comment out the next line, everything works ok SendEmail(view_model, this.ControllerContext); } } return RedirectToAction("Certifications"); } return View(); } SendEmail() public static void SendEmail(ViewModels.Emails.Certifications.Open model, ControllerContext context) { var vd = context.Controller.ViewData; vd["model"] = model; var renderer = new CustomRenderers(); //i fixed an error in your code here var text = renderer.RenderViewToString3(context, "~/Views/Emails/Certifications/Open.ascx", "", vd, null); var a = text; } CustomRenderers public class CustomRenderers { public virtual string RenderViewToString3(ControllerContext controllerContext, string viewPath, string masterPath, ViewDataDictionary viewData, TempDataDictionary tempData) { //copy/paste of dan's code } } Error [HttpException (0x80004005): Cannot redirect after HTTP headers have been sent.] System.Web.HttpResponse.Redirect(String url, Boolean endResponse) +8707691 Thanks, James

    Read the article

  • Filter on exception text in elmah

    - by Uwe
    Is there a way to filter exceptions in elma using the exception message? Examples: "System.Web.HttpException: Request timed out." I don't want to filter out all HttpException, but only the timed-out requests. "System.Web.HttpException: Maximum request length exceeded." What I don't want to do is write own code for that. So is it possible to do this with the buildin-web.config configuration? Thank you!

    Read the article

  • Using Nemerle in asp.net App_Code directory

    - by Andrew Davey
    I want to use Nemerle in an ASP.NET application. Specifically, putting .n files into App_Code. I added this to my web.config system.codedom/compilers section: <compiler language="n;Nemerle" extension=".n" type="Nemerle.Compiler.NemerleCodeProvider, Nemerle.Compiler"/> When running I get this exception: The assembly '' is already loaded in another appdomain. Setting in machine.config can help solve this issue. Stack trace [HttpException (0x80004005): The assembly '' is already loaded in another appdomain. Setting <deployment retail="true" /> in machine.config can help solve this issue.] System.Web.Compilation.CodeDirectoryCompiler.GetCodeDirectoryAssembly(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories, Boolean isDirectoryAllowed) +8809675 System.Web.Compilation.BuildManager.CompileCodeDirectory(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories) +128 System.Web.Compilation.BuildManager.CompileCodeDirectories() +265 System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +320 [HttpException (0x80004005): The assembly '' is already loaded in another appdomain. Setting <deployment retail="true" /> in machine.config can help solve this issue.] System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +58 System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +512 System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters) +729 [HttpException (0x80004005): The assembly '' is already loaded in another appdomain. Setting <deployment retail="true" /> in machine.config can help solve this issue.] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +8890735 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +85 System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +259 What am I doing wrong?

    Read the article

  • invalid viewstate error - OnPreRender

    - by dan
    I'm getting 100+ errors per day on my website with System.Web.HttpException: Invalid viewstate. The website is asp.net 3.5 running on iis6 , not running in a web-garden/web-farm , single server. Here are a few sample errors. Machine: ML Framework Version: 2.0.50727.3603 Assembly Version: 6.5.3664.33889 Source: http://www.domain.com/WebResource.axd?d=z5VmXXoSLLpQHoPictureAlert Exception: System.Web.HttpException: Invalid viewstate. at System.Web.UI.Page.DecryptStringWithIV(String s, IVType ivType) at System.Web.Handlers.AssemblyResourceLoader.System.Web.IHttpHandler.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) Machine: MLFramework Version: 2.0.50727.3603 Assembly Version: 6.5.3664.33889 Source: http://www.mydomain.com/ScriptResource.axd?d=SE0Ej7OlEAx91j2Cjv_6KkRPplqT-5wB4M7CZPdGdGn3LahLwqlRPApUcdxBsbFXYHZ91Q76FHAHWgHs8SmOC4zemr7 siym0QY0rF3XtJTu%3C/a%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ca%20id= Exception: System.Web.HttpException: Invalid viewstate. at System.Web.UI.Page.DecryptStringWithIV(String s, IVType ivType) at System.Web.UI.Page.DecryptString(String s) at System.Web.Handlers.ScriptResourceHandler.DecryptParameter(NameValueCollection queryString) at System.Web.Handlers.ScriptResourceHandler.ProcessRequestInternal(HttpResponse response, NameValueCollection queryString, VirtualFileReader fileReader) at System.Web.Handlers.ScriptResourceHandler.ProcessRequest(HttpContext context) at System.Web.Handlers.ScriptResourceHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) i already tried wraping all inline javascript with //<![CDATA[ //]]> i already set enableViewStateMac to false. From looking at all the errors guessing out of the "d" paramter it seems to focus on a single usercontrol on my website. in this control i change the visiblity of div's + text in the usercontrol OnPreRender function. protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); PreparePage(); } Can the errors be related to the usercontrol behavioral? thanks!

    Read the article

  • Reoccurring error "The current identity (NT AUTHORITY\NETWORK SERVICE) does not have write access to

    - by tuseau
    Hi, I keep receiving this error in my ASP.NET web app (below). I give the Network Service account rights to the specified folder, it runs fine for a while, but then within a day or two the error reoccurs, as the Network Service account has been removed from the rights for the folder. Adding it again fixes it, but why does it keep reocurring? Could it be anything to do with using Interop components (such as WMI)? Here's the full error: Server Error in '/DriveMonitor' Application. The current identity (NT AUTHORITY\NETWORK SERVICE) does not have write access to 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Web.HttpException: The current identity (NT AUTHORITY\NETWORK SERVICE) does not have write access to 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files'. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [HttpException (0x80004005): The current identity (NT AUTHORITY\NETWORK SERVICE) does not have write access to 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files'.] System.Web.HttpRuntime.SetUpCodegenDirectory(CompilationSection compilationSection) +8918190 System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags hostingFlags) +152 [HttpException (0x80004005): The current identity (NT AUTHORITY\NETWORK SERVICE) does not have write access to 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files'.] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +8890735 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +85 System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +259

    Read the article

  • The remote host closed the connection. The error code is 0x80070057

    - by Jalpesh P. Vadgama
    While creating a PDF or any file with asp.net pages I was getting following error. Exception Type:System.Web.HttpException The remote host closed the connection. The error code is 0x80072746. at System.Web.Hosting.ISAPIWorkerRequestInProcForIIS6.FlushCore(Byte[] status, Byte[] header, Int32 keepConnected, Int32 totalBodySize, Int32 numBodyFragments, IntPtr[] bodyFragments, Int32[] bodyFragmentLengths, Int32 doneWithSession, Int32 finalStatus, Boolean& async) at System.Web.Hosting.ISAPIWorkerRequest.FlushCachedResponse(Boolean isFinal) at System.Web.Hosting.ISAPIWorkerRequest.FlushResponse(Boolean finalFlush) at System.Web.HttpResponse.Flush(Boolean finalFlush) at System.Web.HttpResponse.Flush() at System.Web.UI.HttpResponseWrapper.System.Web.UI.IHttpResponse.Flush() at System.Web.UI.PageRequestManager.RenderFormCallback(HtmlTextWriter writer, Control containerControl) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) at System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) at System.Web.UI.HtmlFormWrapper.System.Web.UI.IHtmlForm.RenderControl(HtmlTextWriter writer) at System.Web.UI.PageRequestManager.RenderPageCallback(HtmlTextWriter writer, Control pageControl) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.Page.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) Exception Type:System.Web.HttpException The remote host closed the connection. The error code is 0x80072746. at System.Web.Hosting.ISAPIWorkerRequestInProcForIIS6.FlushCore(Byte[] status, After searching and analyzing I have found that client was disconnected and still I am flushing the response which I am doing for creating PDF files from the stream. To fix this kind of error we can use Response.IsClientConnected property to check whether client is connected or not and then we can flush and end response from client. Here is the sample code to fix that problem. if (Response.IsClientConnected) { Response.Flush(); Response.End(); } That’s it Hope this will help you..Stay tuned for more.. Till that Happy Programming!! Technorati Tags: Exception,ASp.NET

    Read the article

  • .Net 3.5 Chart Controls Exception

    - by ChrisHDog
    I am using the new free .net chart controls and they appear to work fine when I run the project up in visual studio, but when hitting the same via IIS I get and exception: [HttpException (0x80004005): No http handler was found for request type 'GET'] System.Web.HttpApplication.MapIntegratedHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig, Boolean convertNativeStaticFileModule) +529 System.Web.HttpServerUtility.Execute(String path, TextWriter writer, Boolean preserveForm) +947 [HttpException (0x80004005): Error executing child request for ChartImg.axd.] System.Web.HttpServerUtility.Execute(String path, TextWriter writer, Boolean preserveForm) +4120098 System.Web.UI.DataVisualization.Charting.ChartHttpHandler.EnsureInitialized(Boolean hardCheck) +266 System.Web.UI.DataVisualization.Charting.Chart.GetImageStorageMode() +25 System.Web.UI.DataVisualization.Charting.Chart.Render(HtmlTextWriter writer) +133 System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +240 System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +240 System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +253 System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +87 System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +53 System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +240 System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +240 System.Web.UI.Page.Render(HtmlTextWriter writer) +38 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4240 Any idea what I'm doing wrong? Thanks!

    Read the article

  • The HTTP verb POST used to access path '/' is not allowed.

    - by Ryan
    The entire error: Server Error in '/' Application. The HTTP verb POST used to access path '/' is not allowed. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Web.HttpException: The HTTP verb POST used to access path '/' is not allowed. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [HttpException (0x80004005): The HTTP verb POST used to access path '/' is not allowed.] System.Web.DefaultHttpHandler.BeginProcessRequest(HttpContext context, AsyncCallback callback, Object state) +2871966 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8679410 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155 To be honest, I'm not even sure where the error came from. I'm running Visual Studio 2008 through the Virtual Server. I just put a button: <asp:Button ID="btnRegister" runat="server" Text="Register" CssClass="bt_register" onclick="btnRegister_Click" /> On a login user control, the onclick event is just a simple response.redirect Response.Redirect("~/register.aspx"); Debugging the project, it isn't even hitting the btnRegister_Click method anyway. I'm not sure where to even begin with debugging this error. Any information will help. I can post all the code I have, but like I said, I'm not sure where this error is even being thrown at. Edit It has nothing at all to do with the button click event. I got rid of the method and the onclick parameter on the aspx page. Still coming up with the same error problem found Okay so this is for a school project and its a group project. Some one in my group thought it would be a good idea to wrap a form tag around this area telling it to post. Found it doing a diff with a revision on Google code.

    Read the article

  • ASP.Net MVC2 (RTM) breaks response filtering - "Filtering is not allowed"

    - by womp
    I've just done a test run of upgrading a project to ASP.Net MVC 2 (RTM) in anticipation of the full official .Net 4.0 release coming later this month. Our application is using a minimizer for our CSS and javascript. To do so, it is making use of the HttpResponse.Filter property to set a custom filter. With the upgrade, the setter for this property is throwing an HttpException saying "Filtering is not allowed." Looking that the HttpResponse.Filter property in reflector shows this: set { if (!this.UsingHttpWriter) { throw new HttpException(SR.GetString("Filtering_not_allowed")); } ... private bool UsingHttpWriter { get { return ((this._httpWriter != null) && (this._writer == this._httpWriter)); } } Clearly something has changed in the way the HttpResponse is writing to the output stream in MVC2. Does anyone know what the change is, or at least a workaround for this? EDIT: This seems pretty radical. Some further investigation shows that ASP.Net MVC 2 RTM is using a System.Web.Mvc.ViewPage.SwitchWriter as the Output property of an HttpResponse, whereas MVC 1 was using a plain old HttpWriter. That explains why the exception is being thrown. But that doesn't explain why they've chosen to completely break this functionality. This thread seems to indicate that this is just temporary... but this makes me pretty nervous... this is the RTM after all. Any further comments appreciated on this.

    Read the article

  • Why am I getting: InvalidOperationException: Failed to map the path '/app42/App_Code/'.

    - by serialhobbyist
    I've been working on a little Silverlight utility which calls a Silverlight web service. It works from my dev machine (XPsp2). I've tried publishing it to a 2008 R2 IIS 7.5 server and it doesn't work when trying to contact the web service. So I've tried using the WcfTestClient to connect to the web service. That gave an error. So I turned off CustomErrors and used IE and I get the following. Any idea why? There's no App_Code folder in the app. Failed to map the path '/app42/App_Code/'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidOperationException: Failed to map the path '/app42/App_Code/'. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [InvalidOperationException: Failed to map the path '/app42/App_Code/'.] System.Web.Configuration.ProcessHostConfigUtils.MapPathActual(String siteName, VirtualPath path) +320 System.Web.Configuration.ProcessHostServerConfig.System.Web.Configuration.IServerConfig.MapPath(IApplicationHost appHost, VirtualPath path) +34 System.Web.Hosting.MapPathBasedVirtualPathEnumerator..ctor(VirtualPath virtualPath, RequestedEntryType requestedEntryType) +169 System.Web.Hosting.MapPathBasedVirtualPathCollection.System.Collections.IEnumerable.GetEnumerator() +43 System.Web.Compilation.CodeDirectoryCompiler.ProcessDirectoryRecursive(VirtualDirectory vdir, Boolean topLevel) +147 System.Web.Compilation.CodeDirectoryCompiler.GetCodeDirectoryAssembly(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories, Boolean isDirectoryAllowed) +11196502 System.Web.Compilation.BuildManager.CompileCodeDirectory(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories) +185 System.Web.Compilation.BuildManager.CompileCodeDirectories() +654 System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +658 [HttpException (0x80004005): Failed to map the path '/app42/App_Code/'.] System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +76 System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +1012 System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters) +1025 [HttpException (0x80004005): Failed to map the path '/app42/App_Code/'.] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11301302 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +88 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +4338644 Version Information: Microsoft .NET Framework Version:2.0.50727.4927; ASP.NET Version:2.0.50727.4927

    Read the article

  • Logout exception flooding elmah

    - by durilai
    I am using ASP.NET membership, and in particular a copy of the membership code included in the MVC project. I am also using elmah to log exceptions. I am getting flooded with the following when people sign out. System.Web.HttpException: Server cannot set status after HTTP headers have been sent. Here is the stack trace sent System.Web.HttpException: Server cannot set status after HTTP headers have been sent. at System.Web.HttpResponse.set_StatusCode(Int32 value) at System.Web.HttpResponseWrapper.set_StatusCode(Int32 value) at System.Web.Mvc.HandleErrorAttribute.OnException(ExceptionContext filterContext) at System.Web.Mvc.ControllerActionInvoker.InvokeExceptionFilters(ControllerContext controllerContext, IList`1 filters, Exception exception) at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) at System.Web.Mvc.Controller.ExecuteCore() at System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) at System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) at System.Web.Mvc.MvcHandler.<>c__DisplayClass8.<BeginProcessRequest>b__4() at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass1.<MakeVoidDelegate>b__0() at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.End() at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) at System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) I cannot seem to find any reason for this. It is not causing an issue for end users, but would still like to resolve/learn about it. Thanks for any help or guidance.

    Read the article

  • Control 'ctl00_TextBox1' of type 'TextBox' must be placed inside a form tag with runat=server.

    - by Hiru
    When a form with a run at server is added there will be two forms with runat server and another error occurs. Can some one give me an idea. Thankx in advance. The details of the error are as follows. Control 'ctl00_TextBox1' of type 'TextBox' must be placed inside a form tag with runat=server. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Web.HttpException: Control 'ctl00_TextBox1' of type 'TextBox' must be placed inside a form tag with runat=server. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [HttpException (0x80004005): Control 'ctl00_TextBox1' of type 'TextBox' must be placed inside a form tag with runat=server.] System.Web.UI.Page.VerifyRenderingInServerForm(Control control) +2052287 System.Web.UI.WebControls.TextBox.AddAttributesToRender(HtmlTextWriter writer) +49 System.Web.UI.WebControls.WebControl.RenderBeginTag(HtmlTextWriter writer) +17 System.Web.UI.WebControls.TextBox.Render(HtmlTextWriter writer) +17 System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25 System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121 System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22 System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +199 System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +20 System.Web.UI.Control.Render(HtmlTextWriter writer) +7 System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25 System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121 System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22 System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +199 System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +20 System.Web.UI.Page.Render(HtmlTextWriter writer) +26 System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25 System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121 System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2558 Version Information: Microsoft .NET Framework Version:2.0.50727.1873; ASP.NET Version:2.0.50727.1433

    Read the article

  • Windows Azure ASP.NET MVC Role behaves strangely when redirecting from HTTP to HTTPS

    - by Rinat Abdullin
    Subj. I've got an ASP.NET 2 MVC Worker Role Application, that does not differ much from the default template. When attempting redirect from HTTP to HTTPS (this happens when we access constroller secured by the usual RequireSSL attribute implementation) we get blank page with "Bad Request" message. IntelliTrace shows this: Thrown: "The file '/Views/Home/LogOnUserControl.aspx' does not exist." (System.Web.HttpException) Call stack is really short: [External Code] App_Web_vfahw7gz.dll!ASP.views_shared_site_master.__Render__control1(System.Web.UI.HtmlTextWriter __w = {unknown}, System.Web.UI.Control parameterContainer = {unknown}) [External Code] App_Web_bsbqxr44.dll!ASP.views_home_index_aspx.ProcessRequest(System.Web.HttpContext context = {unknown}) [External Code] User control reference is the usual one in /Views/Shared/Site.Master: <div id="logindisplay"> <% Html.RenderPartial("LogOnUserControl"); %> </div> And partial view LogOnUserControl.ashx is located in Views/Shared (and it is ASHX, not ASPX). Problem shows up, when we try to access site pages, that require auth and redirect. These pages are secured by RequireSSL attribute (Redirect == true): [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, Inherited = true, AllowMultiple = false)] public sealed class RequireSslAttribute : FilterAttribute, IAuthorizationFilter { public bool Redirect { get; set; } // Methods public void OnAuthorization(AuthorizationContext filterContext) { // this get's messy, when we are running custom ports // within the local dev fabric. // hence we disable code in the debug #if !DEBUG if (filterContext == null) { throw new ArgumentNullException("filterContext"); } if (filterContext.HttpContext.Request.IsSecureConnection) return; var canRedirect = string.Equals(filterContext.HttpContext.Request.HttpMethod, "GET", StringComparison.OrdinalIgnoreCase); if (canRedirect && Redirect) { var builder = new UriBuilder { Scheme = "https", Host = filterContext.HttpContext.Request.Url.Host, Path = filterContext.HttpContext.Request.RawUrl }; filterContext.Result = new RedirectResult(builder.ToString()); } else { throw new HttpException(0x193, "Access forbidden. The requested resource requires an SSL connection."); } #endif } } Obviously we compile in RELEASE for this case. Does anybody have any idea, what could cause this strange exception and how to get rid of it?

    Read the article

1 2 3 4 5 6  | Next Page >