Courses / Events and Registrations App Bug - 2sxc

I have the same problem with a new system and it is a very old bug.
Registration fail.
https://github.com/2sic/app-events-and-courses/issues/1
I am looking for a workaround.
Thanks Thomas
I tried three diffrent systems but no success.
var course = AsDynamic(App.Data["Course"].List[Convert.ToInt32(Request.QueryString["cid"])]);
Error: System.Web.HttpCompileException (0x80004005):
d:\home\site\wwwroot\Portals\43\2sxc\Courses_Course-Registration.cshtml(12):
error CS0021: Cannot apply indexing with [] to an expression of type
'System.Collections.Generic.IEnumerable'
at
System.Web.Compilation.BuildManager.PostProcessFoundBuildResult(BuildResult
result, Boolean keyFromVPP, VirtualPath virtualPath) at
System.Web.Compilation.BuildManager.GetBuildResultFromCacheInternal(String
cacheKey, Boolean keyFromVPP, VirtualPath virtualPath, Int64 hashCode,
Boolean ensureIsUpToDate) at

I assume this is some very old code - because the List object changed in 2017. So first of all let's get you going:
Read this blog - it tells you what changed and how to fix it: https://2sxc.org/en/blog/post/fixing-the-breaking-change-in-2sxc-9-8-list-instead-of-dictionary
Since you installed a new system (that's what I understand), could you point me to where you got the code - so I can have the original fixed?

Related

Error when clicking an image button in Microsoft Edge

when I use the recently updated Microsoft Edge, it has the following problem. It does not have it when I use other browsers like IE, Chrome, etc or previous versions of Microsoft Edge.
When I click an image button, it shows the error message of "Input string was not in a correct format"
and the Stack Trace is below:
[FormatException: Input string was not in a correct format.]
System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +7488663
System.Number.ParseDouble(String value, NumberStyles options, NumberFormatInfo numfmt) +115
System.Double.Parse(String s, NumberStyles style, NumberFormatInfo info) +192
System.Web.UI.WebControls.ImageButton.LoadPostData(String postDataKey, NameValueCollection postCollection) +189
System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection) +14
System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +690
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1743
Please help and advise what the problem is
It would seem that in your click event, you try to set some value from the page to a Double variable, but the original string is not a valid number format. The differences in browsers might be caused by the browsers use different locale settings (different locales might use . or , as decimal separator, or also thousands separators might come into play if number is large enough).
To give more help, we would need more details from your code related to the button (edit your question to provide more info).

Sitecore Content Editor breaks when opening a specific item in a specific language

I am facing this weird error in a live Sitecore instance.
It is multi-language, english and french. It has over a thousand content items.
With two items(that is what we found so far) I am having this problem.
I am able to open the item in its english version but when I try to switch language to french nothing happens. If I select any other item, switch to French, and then try to open this problematic item, Content Editor breaks and stop responding.
This error is being logged in Sitecore`s log:
4236 12:00:36 INFO HttpModule is being initialized
4236 12:00:36 ERROR Could not decrypt value85953F0F(...trimmed...)B2A
Exception: System.Web.HttpException
Message: Unable to validate data.
Source: System.Web
at System.Web.Configuration.MachineKeySection.EncryptOrDecryptData(Boolean fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Boolean useValidationSymAlgo, Boolean useLegacyMode, IVType ivType, Boolean signData)
at System.Web.Security.FormsAuthentication.Decrypt(String encryptedTicket)
at Sitecore.Security.Authentication.AuthenticationHelper.GetSavedUser(String cookieName)
Does anybody have a suggestion of what is happening or what I might try to solve it?
Using Fiddler, I also saw that the POST and RESPONSE are ok, like any other language switch on items.
Also tried to use "Raw Values", and it still breaking my content editor.
Really appreciate any help, tks
The reason Content Editor was breaking was a weird character was input in a Multi-Line text field.
Probably copied from a word document.


Errors in the ScriptResource.axd always end with the same query string

I get a few errors in my logs every day with the ScriptResource.axd
at System.Web.Handlers.ScriptResourceHandler.Throw404()
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 have done quite a bit of research and managed to reduce the of times this error is occuring. However I have noticed that the query string always ends the same, from the &"t=" onwards.
ScriptResource.axd?d=Q...1&t=eeeeeeeeb4904b79
(URL shortened for readability, and it's not indexed by search engines)
Is this significant, just a coincidence or is it meant to be that way?
It's normal to see the same "t" variable on the querystring. ASP.NET uses that parameter "cache bust" and ensure that a fresh version is forced down to the client after each build.

Why is my server side exception not causing my code to break in VS2010?

I'm running an ASP.NET project on IIS locally, and an exception is getting reported back to the web browser after a postback has been handled.
In VS2010, if I look at Debug->Exceptions..., every exception type is checked to break when thrown.
Here's the exception I'm seeing in my browser popup:
Line: 868
Error: Sys.WebForms.PageRequestManagerServerErrorException: Input string was not in a correct format.
Here's the response back to the browser I got from Fiddler:
41|error|500|Input string was not in a correct format.|
Of course I googled, and most posts say that attempting to parse a string to an int can cause this. I don't think I'm doing anything like that.
======Edit=======
Removed updatepanel, and now I get:
[FormatException: Input string was not in a correct format.]
System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +12630469
System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +224
System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +483
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3691
=================
thanks,
Mark
Problem was that for a button I had in my grid, I was setting the CommandArgument, which I should not be doing. This is used by the GridView to get the row index in case it doesn't have the actual row owning the button.
The exception is happening before your code is even invoked. Maybe this? Sys.WebForms.PageRequestManagerServerErrorException 12031
I don't know about breaking your debugger. By default, this type of error won't break your code. You should have a proper try{}catch{} statement setup for the code that handles your data manipulation. You could even have some debug variables that you could output in your catch{} to help you locate your error if your dealing with lots of data. Run your debugger and iterate through it to find the error.

Invalid Viewstate

I always got this error guys on my site.Anybody got a solution.
Stacktrace
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)
Query String
d=J_c3w3Q59U-PnoRlWBPOJMVgHe_9Ile9wANEXiRFLzG8mequestManager._initialize('ctl00%24ScriptManager1'
I noticed that there are strings that got appended on the last part of ScriptResource.axd which are not part of the querystring(equestManager._initialize('ctl00%24ScriptManager1').I don't know how this string ends up here.I am using MS ajax, webforms and IIS7 on a shared hosting plan.
This is a bug caused by IE8 users, you can read about it here: http://blogs.msdn.com/ieinternals/archive/2009/07/27/Bugs-in-the-IE8-Lookahead-Downloader.aspx
The basics are that when IE8 processes the page, it sometimes just leaves 4kb out of it, and if your <script src="ScriptResource.axd?.... started and gets truncated, when the page is rejoined with 4k missing, up until the matching quote to close the src="" is used, resulting in a very strange request to your server.
Update: It's been fixed now with KB980182 (4/1/2010)

Resources