-
Channel you
Do you admire the interface/functionality of Channel10/Channel8/channel whatnot? Did you know that the source of those sites was available? I didn't (but should have, I think), but I noticed it today on Codeplex.
-
MVC coding in VB (part 416)
The bits move on, and only the code keeps changing.
My complaints in the last post are no longer valid. As of the 4/16 release of the MVC framework, VB no longer has that weird behaviour. Now, all action methods must return an ActionResult, so they become functions in both VB and C#.
Of course, you already knew that because you're not behind on your reading, and you've already read ScottGu's post on this. I just read blogs for a living (partly), unfortunately the posts I want to read oftimes get pushed back because of it.
-
MVC coding in VB
Don't ask why, but I decided to try to use the porridge that was "just right" in VB while trying to create a site using the new ASP.NET MVC framework. As I will no doubt forget the syntax to use in about 42 seconds, I'm including it here. Others may find it useful as well.
ActionLinks:
<%=Html.ActionLink(Of ViewEngines.CategoryController) _ (Function(c As ViewEngines.CategoryController) c.Add(), _ "Add Category")%>
Form definition:
<% Using Html.Form(Of ViewEngines.CategoryController) _ (Function(c As ViewEngines.CategoryController) c.Update(ViewData.CategoryID), _ FormMethod.Post)%>
The Function(c as ViewEngines.CategoryController) c.blah syntax is the equivalent syntax to the shorter, more symbolrific C# syntax: c => c.Add()....
-
Part 2 of 2 on SubSonic
I see that my second (and for now at least final) article on SubSonic is up on DotNetSlackers. Hopefully someone will find it useful and informative. This one is intended to be more practical than the overview I did last time. It builds out some of the functions of a blog engine using SubSonic queries and controls.
Thanks again to Sonu, Karl and the rest of the DNS team.
-
SubSonic article on DotNetSlackers
Thanks to Sonu (and Karl, and the rest of the DNS team), my (first) article on SubSonic is now up on DotNetSlackers. This one is intended to be an introduction, and I'll hope to continue professing my platonic admiration for said framework in the new year.
-
(Google) Charting my way
I see that Google has yet another new API, this time for plotting charts. So, let's take some of the ultra-secret data from my time tracker of choice, and see what it produces:
Source URL (on one line):
http://chart.apis.google.com/chart?cht=p3 &chd=s:LILDEE3OG &chs=250x100 &chl=Admin|CompA|Break|CompC|Internal|Lost%20time|CompM|WoW|Writing &chco=ff0000,2C327C,00ff00,FF9900,e2e2e2,000000,0000ff,480D06,c0c0c0
The parameters are cht=chart type, chd=data (in an unusual format, IMO), chs=size, chl=labels and chco=colours.
Now to figure out a use for it...
-
Mental note - IE and table row (TR) styles
I was working on a site (that shall remain nameless), and one of the goals was to have a nice background for one of the rows in the layout table. (yes. moving on.) I naively did this:
<tr class="fancyBackground"><td...
Where:
.fancyBackground { background-image:url('url-to-image.png');background-repeat:no-repeat;}
Unfortunately, IE interpreted it as though I had asked:
<tr><td class="fancyBackground"></td> <td class="fancyBackgound"></td> <td class="fancyBackgound"></td></tr>
Meaning that the background restarted with each new cell. Kent (and moreso Customer) not happy. The fix I used:
<tr><td class="fancyBackgoundNaughty"></td> <td class="fancyBackgoundInternet"></td> <td class="fancyBackgoundExplorer"></td></tr>
Where:
.fancyBackgoundNaughty{background-image:url('url-to-image.png');background-repeat:no-repeat;background-position: 0px 0px; width:135px; }
.fancyBackgoundInternet {background-image:url('url-to-image.png');background-repeat:no-repeat;background-position: -135px 0px; width:350px;}
.fancyBackgoundExplorer {background-image:url('url-to-image.png');background-repeat:no-repeat;background-position: -485px 0px; }
Now you can all...
-
UG talk in "The Peg"
While all the cool kids are off in TO for "The Game", and the mondo-cool kids are heading to Vancouver for "The Teach", I find myself back once again in the Casa Nobura-Spafford in Winnipeg. What's the occasion? I'm actually going to be at the next iteration of the Winnipeg .NET User Group.
Why? Someone asked. (Someone I can't say no to)
When? Thursday, Nov 22nd (two days from now and counting)
Where? 1700 Richardson Building 17th Floor, One Lombard Place (you know, the big old one)
Who? Well, you already know that one (me -- duh)
What? The technology formerly known as SubSonic...
-
Securing Web.config
One worry that many have is the information in the web.config file, especially items you might have in your appSettings and/or connectionString sections. It might be older news to some, but you can lock down sections to feel a little safer. (I knew there was something there, but I hadn't researched the code until last week, so it was new for me)
Locking a section:
Configuration config = WebConfigurationManager.OpenWebConfiguration("/");
ConfigurationSection sect = config.GetSection("appSettings");
if (!sect.SectionInformation.IsProtected) {
sect.SectionInformation.ProtectSection("RsaProtectedConfigurationProvider");
config.Save();
}
Unlocking a section:
Configuration config = WebConfigurationManager.OpenWebConfiguration("/");ConfigurationSection sect = config.GetSection("appSettings");if (sect.SectionInformation.IsProtected) { sect.SectionInformation.UnprotectSection(); config.Save();}
The appSettings section is then encrypted with...
-
Why slow? Get YSlow
Web pages are funny things. They *seem* like they're standalone thingies hiding behind URLs, but they're actually a mess of possibly multiple requests that are rendered independently. It's a wonder they work at all some times. Making them work fast shouldn't be rocket surgery, but with so many slow sites out there, I guess it is. Yahoo has released a tool to help you identify areas that need improvement. The new tool is YSlow. It's a plugin for the incredible Firefox plugin Firebug. Running YSlow on a site gives you reports on the individual objects that make up your Web...