News

Archives

Blogs

Syndication:

December 2008 Entries


Rendering a Control as a String

Have you ever run across a situation where it would be nice to render an ASP.NET control as a string? For example, let's say that you had to dynamically generate a control at runtime and then embed it's HTML within a <div>. Fortunately, all ASP.NET controls expose the RenderControl() method. Don't get too excited just yet, the RenderControl() method doesn't simply return a string. Instead, the RenderControl() method takes an HtmlTextWriter as input and renders the control into it. Not so fast...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

My Favorite Visual Studio Tips

1. Ctrl+Shift+V Ctrl+Shift+V will cycle through the items in the clipboard ring. This allows you to copy multiple things before even attempting to paste them and then paste them in order at a later point. Keep in mind that the clipboard ring holds up to 20 items. 2. Line Numbers Line numbers make it much easier to discuss your code with someone else, especially during code reviews or technical demos. To add line numbers to your code Click Tools menu and select Options... Expand the Text Editor tree...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati