Posted by Joe | Posted in ASP.NET, C#, Linq | Posted on 23-11-2009
Download source
With Linq to SQL lazy loading is used by default. That means that if one object contains another object, the child object will only be loaded when first accessing it. Using Load Options it is possible to tell Linq to SQL to also load the child object at the same time as loading it’s parent.
Read the rest of this entry »

Posted by Joe | Posted in ASP.NET, C# | Posted on 20-11-2009
I have FormView and on changing to Edit mode I wanted to set focus to the first textbox. I thought I’d do this hooking into the ModeChanged event but this doesn’t work as the textbox hasn’t been rendered.
I then tried overriding the Render method and setting the focus after rendering; at this point the control was created but I get an exception to say focus can only be set in PreRender, but in PreRender the control won’t be available.
One way I found to get this to work was to set the focus in a handler for the DataBound event of the FormView.
Read the rest of this entry »

Posted by Joe | Posted in C# | Posted on 17-11-2009