Category: ASP.Net
-
Understanding Read-Only Properties with Object (Refererence Types)
using System; using System.Text; namespace TestReadOnly { class Program { static void Main(string[] args) { MyClass1 myObject1 = new MyClass1(); // myObject1.MyObject2 = new MyClass2(); // clearly illegal // legal, reference is read-only, not object myObject1.MyObject2.x = 1; Console.WriteLine(“myObject1.MyObject2.x: {0}”, myObject1.MyObject2.x); // also legal, similar to above, anotherObject2 is just a reference to the same […]
-
Debug NUnit Tests With Visual Studio
1. Set a break point in a unit test 2. Open NUnit 3. In Visual Studio, go the tools Menu and choose Attach to Process (or Ctrl-Alt-P) 4. Choose nunit out of the list 5. Run tests. Make sure you run the test where your breakpoint is if you don’t run all tests.
-
Linq to SQL
Background: Linq to Sql is a lightweight data access protocol for the .Net framework. It supports filtering and other lambda features in code, allowing the programmer to treat their data source as if it were a collection of objects that support flexible features. In this way, it can be thought of as an ORM mapper, […]
-
Help With Path Issues
First, here’s a good way to see what you have available in code… <form id=”form1″ runat=”server”> <div> <% For Each key As String In Request.ServerVariables.AllKeys%> <p><%= key %>: <%=Request.ServerVariables(key)%></p> <% Next %> </div> </form> But in general all you need to do is read the following: http://weblogs.asp.net/scottgu/archive/2006/12/19/tip-trick-how-to-run-a-root-site-with-the-local-web-server-using-vs-2005-sp1.aspx
-
App_Code and Namespaces
When working in Asp.net, I discovered something interesting about namespace. Before I explain what that is, a little background… If a page accesses it’s masterpage through the typical this.Master way, then any custom methods you’ve written aren’t accessible as it as typed as a MasterPage, not your class that inherits it (presumably something like _MyMasterPage). […]