This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//JSON is supported in IE8+. Otherwise use Json2 or something library | |
//to convert from json string | |
JSON.parse(jsonString); //or | |
jQuery.parseJSON( jsonString ); | |
//JSON to string | |
JSON.stringify({ attestationId: attestationId, haveReadDoc: haveReadDoc, willComply: willComply }), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Would delete all the files in a directory. | |
protected void DeleteFiles() | |
{ | |
FileInfo[] files = new DirectoryInfo(Server.MapPath(WebConfig.ProfilePhotoPath)).GetFiles(WebConfig.ProfilePhotoPrefix + "*" + User.ID + ".*"); | |
foreach (FileInfo file in files) | |
{ | |
try | |
{ | |
file.Delete(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<asp:DropDownList runat="server" ID="SomeDropDown" AutoPostBack="true" | |
DataTextField="FirstName" DataValueField="Id" AppendDataBoundItems="true"> | |
<asp:ListItem Text="All" Value="-1" /> | |
</asp:DropDownList> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//<a href="#" onClick="return false;"> //Most accepted Solution | |
//<a href="javascript:void(0)"> ... </a> //Problem: breaks when linking images in IE | |
//return this from the method. | |
return false; | |
//or using jquery | |
e.stopPropagation(); //stop the event from bubbling | |
e.preventDefault(); // stop the default functionality |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--http://www.sqlteam.com/article/how-to-insert-values-into-an-identity-column-in-sql-server | |
SET IDENTITY_INSERT IdentityTable ON | |
INSERT IdentityTable(TheIdentity, TheValue) VALUES (3, 'First Row') | |
SET IDENTITY_INSERT IdentityTable OFF | |
--Note that the next value will be whatever you reseed with + 1, so in this case I set it to 10 so that the next value will be 11. | |
--This SEED should get updated itself if any Id higher than the seed is used |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Changes to API Methods | |
SCORM1.2 SCORM2004 | |
LMSInitialize(“”) Initialize(“”) | |
LMSFinish(“”) Terminate(“”) | |
LMSGetValue(parameter) GetValue(parameter) | |
LMSSetValue(parameter_1,parameter_2) SetValue(parameter_1,parameter_2) | |
LMSCommit(“”) Commit(“”) | |
LMSGetLastError() GetLastError() | |
LMSGetErrorString(parameter) GetErrorString(parameter) | |
LMSGetDiagnostic(parameter) GetDiagnostic(parameter) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- For SQL Server 2005 and above | |
ALTER TABLE Foo ALTER COLUMN Bar ntext COLLATE Latin1_General_CS_AS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (Keywords.Trim().Length > 0) | |
{ | |
string[] keywordFilterArr = Keywords.Split(' '); | |
query = keywordFilterArr.Where(str => str.Trim().Length > 0) | |
.Aggregate(query, (current, str) => current.Where(u => u.FirstName.Contains(str) || u.LastName.Contains(str))); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chkBoxList.Items.Cast<ListItem>() | |
.Where(i => i.Selected) | |
.Select(i => int.Parse(i.Value)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%@ Register TagPrefix="scott" TagName="footer" Src="Controls/Footer.ascx" %> |
NewerOlder