
September 25, 2010 23:35 by
Brian Keating |
A quick sample of how to use linq in your webpages
<% Model.ToList().ForEach(item =>
{ %>
<tr>
<td>
<%: Html.ActionLink("Edit", "Edit", new { id = item.AlbumId })%> |
<%: Html.ActionLink("Delete", "Delete", new { id = item.AlbumId })%>
</td>
<td><%: Html.Truncate(item.Title, 25)%></td>
<td><%: Html.Truncate(item.Artist.Name, 25)%></td>
<td><%: item.Genre.Name%></td>
</tr>
<% }); %>
I said quick ey! :-)
86ac0ff6-f5f1-44f6-81db-0ab03f8acd49|0|.0

September 10, 2010 12:07 by
Brian Keating |
So you've started up your very first 4.0 Workflow application.
You've added some arguments and want to know how to pass some information..
You can either use the Dictionary approach that exists since 3.0 or you can use the properites you've just created.
Thes scrren shots show a simple workflow with an input string UserName and an output string Greeting.

I added an assignment activity and set the "To" to be the output Arguement "Greeting"
And set the Value as follows.

To prove this works I've added a test fixture and implemented it as follows

So there you go. The quickie for today 
5e370799-ffb6-4eec-808a-2f0f641375d8|0|.0

September 8, 2010 21:17 by
Brian Keating |
A sample of using SyncronizationContext to post a message back to the UX thread
private void Window_Loaded(object sender, RoutedEventArgs e)
{
SynchronizationContext ctx = SynchronizationContext.Current;
ThreadPool.QueueUserWorkItem(_ =>
{
WebClient client = new WebClient();
string html = client.DownloadString("http://www.briankeating.net");
ctx.Post(state =>
{
tbDetails.Text = (string)state;
}, html);
});
}
9c3dc500-3ec3-4b94-96b1-c391fde6f967|0|.0

September 8, 2010 20:53 by
Brian Keating |
Hi All,
Been a while since I've writen some posts, been pretty hectic hours at work and weekends building a house so my chances to blog have been limited.
I intend over the coming few days to give a few tips and tricks on MCV2.
Here's on gottya..
Be carefull how you name your formal arguements in your controller functions.
You can see from the screenshot below that I created two args, "Name" and "name"
By default the first matching case insensitive value will be applied to both variables by MVC...
Usually this will be avoided by good naming conventions but be carefull nonetheless :-)

a4c9d13d-181f-45db-8fd1-ea3c5cb80ee6|0|.0