Wednesday, January 30, 2013
Change app behaviour when debug="true" on web.config
To check if debug="true" on web.config, check the following:
HttpContext.Current.IsDebuggingEnabled
Why should I care?
Take the example
try{
//a lot of code that makes something
}catch (Exception ex){
//Make the error handling of some sort, like log the error...
if(HttpContext.Current.IsDebuggingEnabled){
return ex.Message;
}else{
return "A error ocurred with the app, please retry again later or contact our it department";
}
}
Wednesday, January 23, 2013
Full intelisense mvc umbraco 6
From Jeavon Leopold @crumpled_jeavon @ twitter
Tip for#WebMatrix #Umbraco developers, when editing MVC Views in#umb6 add "@using Umbraco.Web;" to top of cshtml for full Intellisense
Tip for
Tuesday, January 8, 2013
Get last day of the month in C#
DateTime.DaysInMonth(d.Year, d.Month)
Thursday, January 3, 2013
Url Picker uComponents
uComponents.DataTypes.UrlPicker.Dto.UrlPickerState picker = uComponents.DataTypes.UrlPicker.Dto.UrlPickerState.Deserialize(curr.GetProperty<string>("propAlias"));
string target = picker.NewWindow ? "_blank" : "_self";
string text = picker.Title;
string url = picker.Url;
string target = picker.NewWindow ? "_blank" : "_self";
string text = picker.Title;
string url = picker.Url;
Subscribe to:
Posts (Atom)