Monday, October 18, 2010

DevReach 18+19 October Sofia, Bulgaria (part3)

...continued

.Net tips and tricks

1. SQL injection prevention
<%: ... %> -- for ASP.net and it prevents SQL injection etc
Use it instead of <%=...%>

2. Trace it
-- better for debugging

add as a attribute in the page xml ->  
Trace=True 
makes the other traces to be colored in red


3. Caching
http://tinyurl.com/c275vt - Update Callback

He's showing some web caching with load testing.

<% OutputCache ... - he increased the performance for a page showing database entries from 25 requests/sec to 250 req/sec.

4. use IDisposable when net using WCF
http://tinyurl.com/az52gy
and "using()"

5. Action / Func keywords for lambda
Don't Repeat Yourself - principle :) We know it. Nothing new.
Action is for better logging.

6. Extension methods:
Search for some extension methods to improve given sites. 

7. Testing different vesions of configurations
custom config sections


8. WebForms - don't use Labels too much
9. WebForms - ViewState - be careful with its usage
- move the viewState to the bottom of the page because of bots collect a few thousand bytes from a page to scan it. Put your data to the top!

10. Some tools he uses everyday
LinqPad - linqpad.net
Reflector - reflector.red-gate.com - similar to Java Decompiler - see the source of a class file
FireBug - for Firefox
Fiddler - for IE
ViewState Decoder - http://tinyurl.com/2msmev


L.K.

No comments:

Post a Comment