Yesterday I was working on a project which had the AJAX Extensions in use. It’s primarily a .NET 2.0 application and I had .NET Framework 3.5 SP 1 installed on my system. It was working normally and all of a sudden I got this error that: Unknown server tag ‘asp:ScriptManager’
It was strange because every thing [...]
^[a-zA-Z0-9_\.\-]+$
Allows only Alphanumeric characters with a period(.), Underscore(_) and a Hyphen (-). No spaces or other characters allowed.
I’ve found this tool called The Regulator, for validating and testing the regular expressions very useful. I think some of you might find it fairly useful as well. The interface is pretty neat, very simple to use. In case you find it a bit confusing, press F1 to checkout the basics. It’s pretty much straight [...]
I’ve been having this issue with mobile development for quite sometime that I couldn’t get the mobile browser accurately by just using the Request.Browser.isMobileDevice property and I’ve found this piece of code here
Looks pretty useful.
public static bool isMobileBrowser()
{
//GETS THE CURRENT USER CONTEXT
HttpContext context = HttpContext.Current;
//FIRST TRY BUILT IN ASP.NT CHECK
if (context.Request.Browser.IsMobileDevice)
{
return true;
}
//THEN TRY CHECKING FOR [...]
It’s simple, yet not very obvious. All you have to do is to change the normal behavior of the commas you use in the Where function to act as an OR. You’d do it like this:-
ObjES.Query.es.DefaultConjunction = esConjunction.Or;
ObjES.Query.Where(<<Go ahead with using the commas that usually defaults to an AND conjunction>>);
oh and I almost forgot to [...]
Hello friends,
Here’s a nice little piece of code you can use to change file attributes of a particular file, its particularly useful when you’re trying to delete a read only file.
string savedCardFilePath = “My absolute file path”;
if (File.Exists(savedCardFilePath))
{
/*
* Remove readonly attribute off of the file if it exists before execution
*
**/
if(File.GetAttributes(savedCardFilePath) == FileAttributes.ReadOnly)
File.SetAttributes(savedCardFilePath, FileAttributes.Normal);
File.Delete(savedCardFilePath);
}
Happy new year folks, 09′ started off for me with a very strange bug. I was working on a form and decided to use TinyMCE in it for multi-line text editing and it was working A-OK in FF3, Chrome and Safari but not on IE 7. God that was a real pain in the butt [...]
You can pass multiple columns in like this:-
collection.Query.OrderBy(collection.Query.ProductID.Descending, collection.Query.CategoryID.Ascending)
There is a common issue that you can’t manipulate session objects in http handlers, the files with ASHX extension Well normally you can read the contents in the session via context.Session but you can add/remove/modify that in there. So how do you do this:
The answer is simple: Just implement the IRequiresSessionState interface. It [...]
Javascript Calendar/DateTime Picker control
I got this nice little gadget from a friend of mine who also didnt know where it originally came from. This one’s made by Nick Baicoianu in 2006 and distributed under the GNU license. It had problems with Firefox 3 where it wasn’t showing anything in the dropdown for the years. [...]