This file contains hidden or 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
<script type="text/javascript"> | |
$(document).ready(Ini); | |
function Ini() { | |
$(document).find("#form1").validationEngine(); | |
Codigo... | |
} | |
function CheckStatus(sender, args) { | |
var prm = Sys.WebForms.PageRequestManager.getInstance(); |
This file contains hidden or 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
frmFATCA = "$('#frmFATCA').remove();$('<form>', {" + | |
"'method': 'post'," + | |
"'action': '" + url + "'," + | |
"'id': 'frmFATCA'," + | |
"'html': '" + content + "'," + | |
"'target': 'thedialog'," + //target mismo nombre del iframe para abrir url en un iframe | |
"'style': 'display:none'" + | |
"}).appendTo(document.body);"; |
This file contains hidden or 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
public static string FirstLetterToUpper(this string str) | |
{ | |
if (str == null) | |
return null; | |
if (str.Length > 1) | |
return char.ToUpper(str[0]) + str.Substring(1); | |
return str.ToUpper(); | |
} |
This file contains hidden or 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
public static string ToTitleCase(this string str) | |
{ | |
return CultureInfo.CurrentCulture.TextInfo.ToTitleCase(str.ToLower()); | |
} |
This file contains hidden or 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
function validateEmail(sEmail){ | |
var filter = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/; | |
if (filter.test(sEmail)) { | |
return true; | |
} | |
else { | |
return false; | |
} |
This file contains hidden or 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
function syntaxHighlight(json) { | |
json = json.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>'); | |
return json.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g, function (match) { | |
var cls = 'color: darkorange;'; | |
if (/^"/.test(match)) { | |
if (/:$/.test(match)) { | |
cls = 'color: #00CDFF;'; | |
} else { | |
cls = 'color: #E9573F;'; | |
} |
This file contains hidden or 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
function isJson(str) { | |
try { | |
JSON.parse(str); | |
} catch (e) { | |
return false; | |
} | |
return true; | |
} |
This file contains hidden or 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
public class StaticPropertyContractResolver : DefaultContractResolver | |
{ | |
protected override List<MemberInfo> GetSerializableMembers(Type objectType) | |
{ | |
var baseMembers = base.GetSerializableMembers(objectType); | |
PropertyInfo[] staticMembers = | |
objectType.GetProperties(BindingFlags.Static | BindingFlags.Public); | |
baseMembers.AddRange(staticMembers); |
This file contains hidden or 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
public static T DictionaryToObject<T>(IDictionary<string, string> dict) where T : new() | |
{ | |
var t = new T(); | |
PropertyInfo[] properties = t.GetType().GetProperties(); | |
foreach (PropertyInfo property in properties) | |
{ | |
if (!dict.Any(x => x.Key.Equals(property.Name, StringComparison.InvariantCultureIgnoreCase))) | |
continue; |
This file contains hidden or 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
public static string ToTitleCase(this string str) | |
{ | |
return CultureInfo.CurrentCulture.TextInfo.ToTitleCase(str.ToLower()); | |
} |
OlderNewer