Legal Notice
The opinions expressed herein are my own personal opinions and do not represent my employer’s view in anyway.Top Posts
- C# DateTime to UNIX timestamps
- C# Use HttpClient to GET JSON from API endpoint
- C# JWT Token Get Expiry Timestamp
- C# Azure Table Storage QueryAsync, Paging and Filtering
- .NET Core MVC Web API - control DateTime format in JSON output using JsonSerializerOptions
- Serialization and deserialization of 'System.IntPtr' instances are not supported. Path: $.TargetSite.MethodHandle.Value
- C# Authorization in .NET Core API's using Attributes, TypeFilterAttribute and IAuthorizationFilter
Archive
Meta
Tag Archives: Javascript
JavaScript ReferenceError: Can’t find variable: __doPostBack
This error can occur in asp.net pages. In certain situations .net will fail to create the __doPostBack JavaScript function and the hidden __EVENTVALIDATION input field. The situations that can cause this are: When using asp:ImageButton or asp:LinkButton controls AND: When viewing … Continue reading
Posted in .net, c#, General .NET
Tagged BrowserDefinitions, Browsers, ClientTarget, Javascript, __doPostBack
1 Comment
.NET DateTime to JSON UNIX JavaScript datetime
When posting datetimes to web services or REST services, you might need to convert the standard .NET DateTime to a UNIX format. Please note than neither REST, nor JavaScript has its own DateTime format. But some systems based on REST … Continue reading
showModalDialog returnValue is undefined in Google Chrome
For some reason, when using a Javascript showModalDialog from an ASP.NET project, Google Chrome will return an empty (“undefined”) returnValue. This error has been known by the Google Chromium team since 2010, and they have yet to fix it. Fortunately … Continue reading
Validate CheckBoxList using a CustomValidator
In this article I explain how you can validate that at least one checkbox is checked in an asp:CheckBoxList using an asp:CustomValidator, and how to make it work server side and client side. None of the built in .net validators … Continue reading
Posted in .net, c#, General .NET
Tagged .NET, CheckBoxList, ClientValidationFunction, ControlToValidate, CustomValidator, isvalid, Javascript, server side validation, validation
6 Comments
Javascript string encoding in C#
In a previous post I explained how you can use the C# System.Uri.EscapeDataString() to encode strings to be later decoded by the equvivalent JavaScript decodeURIComponent(). The method above is still valid when encoding HTML tags, but fails short when encoding … Continue reading
Posted in .net, c#, General .NET
Tagged decodeURIComponent, encoding, EscapeDataString, Javascript
4 Comments
Modal windows does not resize automatically
I’m not sure if this is a bug or a feature, but when using modal windows in Internet Explorer, your HTML is not updated when the window.onresize event is fired. This is pretty annoying, since it is possible and even … Continue reading
Waiting for gg.google.com
I am developing a Google Maps module for Sitecore, and when I test it in Firefox my Google Javascript won’t load. All I get is: “Waiting for gg.google.com…”. It seemes to be a problem with certain versions of Firefox and Firebug. If Firebug … Continue reading
decodeURIComponent() equivalent in C#
The Javascript decodeURIComponent() function decodes a string that was URI encoded with the encodeURIComponent() Javascript function. If you wish to encode a string in C# that can be decoded with decodeURIComponent you have to use the EscapeDataString function: The escaping … Continue reading