Title

Saturday, 7 February 2015

Error parsing attribute 'title': The 'title' property is read-only and cannot be set


I have been searching for days for an answer to this issue. I have found a few sites through Google where Google listed my error in the sample text only to discover that the same text does not actually exist in the page (this happened several times) or it turned out to be a different issue (with an easy fix that didn't work for me).

I am using Elmah in an ASP.NET web form project (v3.5). Elmah is working great, and successfully logging (in a SQL database). In the Global class, I am capturing the ErrorID in the Logged event handler and calling a couple of methods in a custom class.

protected void errorLog_Logged(object sender, ErrorLoggedEventArgs e)  {   ElmahLogManager logMgr = new ElmahLogManager(e.Entry, HttpContext.Current);   logMgr.LogErrorDetails();   string errorPageUrl = logMgr.GetErrorPageUrl();   if (!string.IsNullOrEmpty(errorPageUrl))   {   Response.Redirect(errorPageUrl);   }  }

For your reference, the first method (LogErrorDetails) logs extra details such as Session variables, and the second method (GetErrorPageUrl) returns the url with the ErrorID as a parameter. Both of these methods are working. The session data is being logged, and the url is returned (such as: "ErrorPage.aspx?id=DB9AFF21-A614-446E-8FF1-E35CFBE56C57").

The problem I am having is when the redirect happens, an System.Web.HttpException is thrown which of course logs a new error which raises this event again, and the whole thing happens over and over until the system says it's had enough that quits the loop.

The specific error I am getting is:

Error parsing attribute 'title': The 'title' property is read-only and cannot be set.

The error page is never reached (i.e. a breakpoint at the beginning of Page_Load or OnInit are never reached).

The stack trace doesn't show anything useful (to me), but in case it does to you, here it is:

System.Web.HttpParseException: Error parsing attribute 'title': The 'title' property is read-only and cannot be set.  ---> System.Web.HttpParseException: Error parsing attribute 'title': The 'title' property is read-only and cannot be set.  ---> System.Web.HttpException: Error parsing attribute 'title': The 'title' property is read-only and cannot be set.   at System.Web.UI.TemplateParser.ProcessError(String message)   at System.Web.UI.TemplateControlParser.ProcessUnknownMainDirectiveAttribute(String filter, String attribName, String value)   at System.Web.UI.PageParser.ProcessUnknownMainDirectiveAttribute(String filter, String attribName, String value)   at System.Web.UI.TemplateParser.ProcessMainDirective(IDictionary mainDirective)   at System.Web.UI.TemplateControlParser.ProcessMainDirective(IDictionary mainDirective)   at System.Web.UI.TemplateParser.ProcessDirective(String directiveName, IDictionary directive)   at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding)  --- End of inner exception stack trace ---   at System.Web.UI.TemplateParser.ProcessException(Exception ex)   at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding)   at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding)  --- End of inner exception stack trace ---   at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding)   at System.Web.UI.TemplateParser.ParseFile(String physicalPath, VirtualPath virtualPath)   at System.Web.UI.TemplateParser.ParseInternal()   at System.Web.UI.TemplateParser.Parse()   at System.Web.Compilation.BaseTemplateBuildProvider.get_CodeCompilerType()   at System.Web.Compilation.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider buildProvider)   at System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders()   at System.Web.Compilation.BuildProvidersCompiler.PerformBuild()   at System.Web.Compilation.BuildManager.CompileWebFile(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.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)

Does anyone have any ideas on how I might fix this problem?

Answer

Java Locks and Conditions


Say I have three threads, thread 1, thread 2, and thread 3 all sharing the same lock. Thread 2 acquires the lock, does some work and then blocks via a call to the await method. Thread 1 then acquires the lock, does some work, and during the middle of it, thread 3 tries to acquire the lock but is blocked since thread 1 is holding it. Thread 1 finishes working and, before terminating, signals thread 2 that it can reacquire the lock. So what happens then? Will thread 2 or thread 3 acquire the lock next?

Thank you so much for your time and help in advance.

Answer

Save pipeline output to a variable


I have two .jar file in a pipeline. 1.jar will output two lines, both of which will be the input of 2.jar. Now I want to store the each line of the intermediate output of 1.jar to variables A and B, while allowing 2.jar to take both lines as input.

java -jar 1.jar | XXX | java -jar 2.jar

As a detour, I could do

java -jar 1.jar | tee out | java -jar 2.jar

and read the file to save the variables, but I'd like a more straight-forward way of doing it.

Answer

There really isn't going to be a straight-forward way to do it. One of the problems is that any variable setting in the middle of a pipeline only affects that process in the pipeline, not the main shell. You might be able to contrive something with multiple file descriptors and process substitution and so on, but it will not be straight-forward.

HTMLEditorExtender width cannot fit %100


Using ajaxcontroltoolkit.as my horror film.

HTMLEditorExtender stays its prerendered width as it is even if I resize the Web Browser

it doesnt detect width resizements:Stays as how it is.

and need a full refresh of browser (F5) makes HTMLEditorExtender to re calcluate its width.

so.

is there a standart way to fix this problem ? otherwise I will use jquery to slap it.or remove this horror control.

<asp:TextBox ID="tbEditor" runat="server"   TextMode="MultiLine" Rows="10" style="width:100%">  </asp:TextBox>   <asp:HtmlEditorExtender ID="tbEditor_HtmlEditorExtender" runat="server"   Enabled="True" TargetControlID="tbEditor">   </asp:HtmlEditorExtender>  
Answer

Thank You!!

or method

.ajax__html_editor_extender_container  {   width: 100% !important;/*important is really important at here*/  }    <asp:TextBox ID="tbEditor" runat="server" TextMode="MultiLine" Rows="10" style="width:100%">  <asp:HtmlEditorExtender ID="tbEditor_HtmlEditorExtender" runat="server"   Enabled="True" TargetControlID="tbEditor">  </asp:HtmlEditorExtender>  

Error parsing attribute 'title': The 'title' property is read-only and cannot be set


I have been searching for days for an answer to this issue. I have found a few sites through Google where Google listed my error in the sample text only to discover that the same text does not actually exist in the page (this happened several times) or it turned out to be a different issue (with an easy fix that didn't work for me).

I am using Elmah in an ASP.NET web form project (v3.5). Elmah is working great, and successfully logging (in a SQL database). In the Global class, I am capturing the ErrorID in the Logged event handler and calling a couple of methods in a custom class.

protected void errorLog_Logged(object sender, ErrorLoggedEventArgs e)  {   ElmahLogManager logMgr = new ElmahLogManager(e.Entry, HttpContext.Current);   logMgr.LogErrorDetails();   string errorPageUrl = logMgr.GetErrorPageUrl();   if (!string.IsNullOrEmpty(errorPageUrl))   {   Response.Redirect(errorPageUrl);   }  }

For your reference, the first method (LogErrorDetails) logs extra details such as Session variables, and the second method (GetErrorPageUrl) returns the url with the ErrorID as a parameter. Both of these methods are working. The session data is being logged, and the url is returned (such as: "ErrorPage.aspx?id=DB9AFF21-A614-446E-8FF1-E35CFBE56C57").

The problem I am having is when the redirect happens, an System.Web.HttpException is thrown which of course logs a new error which raises this event again, and the whole thing happens over and over until the system says it's had enough that quits the loop.

The specific error I am getting is:

Error parsing attribute 'title': The 'title' property is read-only and cannot be set.

The error page is never reached (i.e. a breakpoint at the beginning of Page_Load or OnInit are never reached).

The stack trace doesn't show anything useful (to me), but in case it does to you, here it is:

System.Web.HttpParseException: Error parsing attribute 'title': The 'title' property is read-only and cannot be set.  ---> System.Web.HttpParseException: Error parsing attribute 'title': The 'title' property is read-only and cannot be set.  ---> System.Web.HttpException: Error parsing attribute 'title': The 'title' property is read-only and cannot be set.   at System.Web.UI.TemplateParser.ProcessError(String message)   at System.Web.UI.TemplateControlParser.ProcessUnknownMainDirectiveAttribute(String filter, String attribName, String value)   at System.Web.UI.PageParser.ProcessUnknownMainDirectiveAttribute(String filter, String attribName, String value)   at System.Web.UI.TemplateParser.ProcessMainDirective(IDictionary mainDirective)   at System.Web.UI.TemplateControlParser.ProcessMainDirective(IDictionary mainDirective)   at System.Web.UI.TemplateParser.ProcessDirective(String directiveName, IDictionary directive)   at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding)  --- End of inner exception stack trace ---   at System.Web.UI.TemplateParser.ProcessException(Exception ex)   at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding)   at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding)  --- End of inner exception stack trace ---   at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding)   at System.Web.UI.TemplateParser.ParseFile(String physicalPath, VirtualPath virtualPath)   at System.Web.UI.TemplateParser.ParseInternal()   at System.Web.UI.TemplateParser.Parse()   at System.Web.Compilation.BaseTemplateBuildProvider.get_CodeCompilerType()   at System.Web.Compilation.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider buildProvider)   at System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders()   at System.Web.Compilation.BuildProvidersCompiler.PerformBuild()   at System.Web.Compilation.BuildManager.CompileWebFile(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.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)

Does anyone have any ideas on how I might fix this problem?

Java Locks and Conditions


Say I have three threads, thread 1, thread 2, and thread 3 all sharing the same lock. Thread 2 acquires the lock, does some work and then blocks via a call to the await method. Thread 1 then acquires the lock, does some work, and during the middle of it, thread 3 tries to acquire the lock but is blocked since thread 1 is holding it. Thread 1 finishes working and, before terminating, signals thread 2 that it can reacquire the lock. So what happens then? Will thread 2 or thread 3 acquire the lock next?

Thank you so much for your time and help in advance.

Answer

Save pipeline output to a variable


I have two .jar file in a pipeline. 1.jar will output two lines, both of which will be the input of 2.jar. Now I want to store the each line of the intermediate output of 1.jar to variables A and B, while allowing 2.jar to take both lines as input.

java -jar 1.jar | XXX | java -jar 2.jar

As a detour, I could do

java -jar 1.jar | tee out | java -jar 2.jar

and read the file to save the variables, but I'd like a more straight-forward way of doing it.

Answer

There really isn't going to be a straight-forward way to do it. One of the problems is that any variable setting in the middle of a pipeline only affects that process in the pipeline, not the main shell. You might be able to contrive something with multiple file descriptors and process substitution and so on, but it will not be straight-forward.