Don't use boolean method parameters.
Why? Because it makes your code unreadable and inextensible.
e.g. render(true) is meaningless but render(PageMode.Readonly) is semantic and unambiguous.
Don't use boolean method parameters.
Why? Because it makes your code unreadable and inextensible.
e.g. render(true) is meaningless but render(PageMode.Readonly) is semantic and unambiguous.
public JsonResult Receive(int[] ages) { return Json(string.Format("ages {0} received", String.Join(",",ages))); }
$(function() { $("#PostArray").click(function() { var arr = new Array(); arr.push(1); arr.push(21); arr.push(23); $.ajax({ url: '/Home/Receive', type: 'POST', contentType: 'application/json', dataType: 'json', data: JSON.stringify({ages: arr }), success: function(data) { alert(data); } }); }); });Download Example
Here's a great resource - 100 cool (and, in some cases, super-cool) jQuery plugins
Here are a couple of SQL statements I seem to use on a regular basis.
SELECT DISTINCT b.name + '.' + a.[name] FROM sys.objects a INNER JOIN sys.schemas b ON a.schema_id = b.schema_id INNER JOIN syscomments c ON a.object_id = c.id WHERE c.[text] LIKE '%CPRS%' -- AND a.[type] = 'P' -- stored procedure -- AND a.[type] = 'V' -- view -- AND a.[type] = 'FN' -- function etc.
SELECT f.name AS ForeignKey, OBJECT_NAME(f.parent_object_id) AS TableName, COL_NAME(fc.parent_object_id, fc.parent_column_id) AS ColumnName, OBJECT_NAME (f.referenced_object_id) AS ReferenceTableName, COL_NAME(fc.referenced_object_id, fc.referenced_column_id) AS ReferenceColumnName, COL_NAME(fc.parent_object_id, fc.parent_column_id) FROM sys.foreign_keys AS f INNER JOIN sys.foreign_key_columns AS fc ON f.OBJECT_ID = fc.constraint_object_id WHERE OBJECT_NAME (f.referenced_object_id) = '[TABLE_NAME]' AND COL_NAME(fc.parent_object_id, fc.parent_column_id) = '[COLUMN_NAME]'
Twitter Bootstrap is my best friend. Here are a few resources:
If you have more to add to this list let me know.