Thursday, January 6, 2011

innerText and textContent

In firefox, no innerText property, you have to go by textContent.
One line code to check this:
var hasInnerText = (document.getElementsByTagName("body")[0].innerText != undefined) ? true : false;

Two ways to Make Subversion ignore files and folders, suo file etc

two ways:
1. Add to Ignore list

2. Use TortoiseSVN → use Extended Context Menu → Delete (keep local). Press Shift and Right click on that file, goto TortoiseSVN context menu, then click Delete (keep local).

Can we use ASP.NET WebForms and MVC together in one project?

Yes.
1. Easiest way: Create a MVC project, add web form into it.
2. Another way:  Update your web forms project to support MVC on top it. Steps following:
- Add  references to System.Web.Abstractions, System.Web.Mvc and System.Web.Routing
- Update web.config. Compare your web form project to a empty MVC one
- Add routing code into Global.asax.cs
- Create folders for Controllers and Views

References:
http://blogs.imeta.co.uk/MGodfrey/archive/2009/03/31/663.aspx
This one is for MVC 1.0. You need to adjust for 2.0

http://www.sqlmag.com/article/aspnet2/MVC-and-Web-Forms-Two-Great-Tastes-Together-.aspx