~mkw

Average guy, above average luck...the blog of M. Keith Warren

Browse by Tags

All Tags » C# Tips and Tricks (RSS)
ASP.NET TidbiTIP #3
HOWTO: Cause a page to escape any frames it may be embedded within /// <summary> /// If the page is loaded inside a frame, /// calling this method will cause the page to leave the frame and load by itself. /// </summary> /// <remarks>...
ASP.NET TidbiTIP #2
HOWTO: Use server side code to set focus onto a control on the client side... /// <summary> /// Sets focus to a control on the client side when the page is loaded /// </summary> /// <param name="control"> The control instance you wish...
ASP.NET TidbiTIP #1
HOWTO: Push a javascript alert using server side code protected virtual void MessageBox( string message) { RegisterStartupScript( System.Guid.NewGuid().ToString(), string .Format("<script language='javascript'>alert('{0}');</script>", message...
C# - using keyword
Most devs I work with are shocked to learn that the using keyword in the C# language is diatic. The obvious is for namespace inclusion but the less often seen use is for aliasing. For example, I hate having to reference the static members of ConfigurationSettings...
System.Diagnostics.DebuggerStepThrough
<System.Diagnostics.DebuggerStepThrough()> If you have some shared method that your code calls often (maybe something in a DAL) that performs some common task for you that you would rather not have to step through in the IDE all the time, simply...
Using inheritance to limit GetCustomAttributes array size
OK, here is the deal – I want to get back an array of all the custom attributes assigned to my class. In my instance I have three custom attributes I have applied to the class. When I call GetCustomAttributes against the type I only want to see...
More Posts