Working with JSON dates in Javascript
/Date(1224043200000)/ var date = new Date(parseInt(jsonDate.substr(6))); date.toDateString();
/Date(1224043200000)/ var date = new Date(parseInt(jsonDate.substr(6))); date.toDateString();
HTML 5 includes a significant bump in what the browser itself can store (up from 4k for total cookie storage to something on the order of 5-10mb). Here’s a simple code sample that illustrates how to access local storage in HTML5: // First, make sure our browser supports HTML 5 local storage if (typeof(localStorage) == 'undefined' ) { alert('Your browser does not support HTML5 localStorage. Try upgrading.'); } else { try { // saves to the database using key/value localStorage....
DataSet ds = GetDataSetFromStoredProc("stored_proc_name", new SqlParameter("@parameter_name", value_id)); var retItems = from dstable in ds.Tables[0].AsEnumerable() select new ClassThing() { PrimaryKeyId = dstable.Field<int>("some_column_name") };
Amazon’s Cloudfront service is truly awesome. It’s a powerful, flexible, inexpensive way to get a content distribution network up and running so that you can play with the big boys on a startup budget. Getting up and running is a snap. First, make sure you’ve signed up for Amazon web services S3 and Cloudfront services. Signing up is free, but understand that Amazon charges modest fees for both S3 and Cloudfront....
When using the jQuery UI ’transfer’ effect for the first time, you might think the effect isn’t working. The documentation is sparse, but the call looks simple enough: // Use transfer effect $("#txtProduct").effect("transfer", { to: $("#test") }, 1000); If you add this to your page, add the html elements to make this work, and then run this code you’ll notice … absolutely nothing. That’s because you need to style the actual ’transfer effect’ itself....
The short answer is you can’t. But there is a very nice workaround. I was perusing StackOverflow and came across this article talking about how to capture information from deleted rows and then use them in a join using the deleted pseudo table: How do I delete from multiple tables using INNER JOIN in SQL server - Stack Overflow begin transaction; declare @deletedIds table ( id int ); delete t1 /* Notice this next line is using the 'deleted' pseudo table: */ output deleted....
So what do you do when you’re using the nifty new ’entity framework’ and you’re getting data back with LINQ queries and you’ve reached the point where you want to get data back based on criteria in a related table? Well, if you’re not using a stored proc to do it for you – you’ve got to do a join. The join syntax in LINQ is similar to SQL syntax, but not quite the same....
RedGate reflector and ASP.NET MVC2 rock. Using this extension method: /// <summary> /// If the given model field has validation errors, this will emit the given CSS class name /// </summary> /// <typeparam name="TModel"></typeparam> /// <typeparam name="TProperty"></typeparam> /// <param name="htmlHelper"></param> /// <param name="expression"></param> /// <param name="cssClassToEmit"></param> /// <returns></returns> public static MvcHtmlString ValidationCSSClassFor<TModel, TProperty>(this HtmlHelper<TModel> htmlHelper, Expression<Func<TModel, TProperty>> expression, string cssClassToEmit) { MvcHtmlString htmlString = null; // Figure out the expression text from the LambdaExpression using our nifty helper // (thank God for RedGate reflector or I would have never figured this one out) string expressionText = ExpressionHelper....