An Example Of The Need To Use Absolute URLs
I have been doing some work around twitter and ASP.NET MVC. The way twitter authentication works, is that I have a page that creates a twitter URL, redirects the user to twitter,
the users accepts to use the application associated with the website, and twitter redirects the user to a callback URL, the completes processing of the user credentials. In order to set a callback URL dynamically (especially in development, when the callback is likely a localhost one), we need to send the absolute URL to twitter.
Other examples might include having a “permanent URL” for some resource (product, blog post, etc..), or maybe a link to be used in emails or so. There can be many usages, so, let’s see how to do it!
How We Did It In Webforms
In webforms, the easiest way to do it was to use the Control.ResolveClientUrl() method.
Typically you pass a URL relative to the current code file (.aspx, .master or .ascx file). and it returns the corresponding absolute URL of that. Of course when the file is a control or a master page file, we don’t always want/have a path relative to this file. The work around for this was passing a relative URL that starts with “~/”. As you probably know, “~/” represents the root of the website.
Read the full post ... (584 words, 3 images, estimated 2:20 mins reading time)
.NET FAQ, ASP.NET, ASP.NET Controls, ASP.NET MVC
Thanks a lot everybody who attended my Razor session in DeveloperDeveloperDeveloper Sydney 2011. It was pretty exciting not just as my first time speaking in Australia (usually I do talks in Egypt), but even loving to attend all the other sessions as well, It was real fun!
I have enjoyed all the sessions I attended. The great talks with different people before and after my session all way long to city afterwards were priceless too. You guys all rock!
Presentation Slides
You can watch the PowerPoint slides here or on SlideShare:
Code / Demos:
I have uploaded all the demo code (and the PowerPoint file) to Github so that you can clone, fork, or download it easily.
You can check the code on:
If you prefer a direct download link (zip).
Thanks again and hope to meet you all in future events.
Permanent link to this post (160 words, 2 images, estimated 38 secs reading time)
ASP.NET MVC, DDDSydney, Local Events
MvcConf
Assuming some of you have attended live or watched the recordings for the past MVCConf conference. It’s a virtual conference concerned (as the name tells) about everything related to Web MVC Frameworks in .NET (ASP.NET MVC, FubuMVC, Spark, …).
Videos from the previous MvcConf event can be found at:
http://www.viddler.com/explore/mvcconf/videos/ and http://tekpub.com/conferences/mvcconf
MvcConf 2
They plan to have a second event after the great success of the first one. And they started a call-for speakers. See:
http://www.mvcconf.com/
Quoting Details
When:
Tuesday Feb 1st 8AM – 5PM CST
Where:
Virtual
Register:
Check back 1/17
Call For Speakers
If you would like to speak at this years conference. Fill out the Speaker Proposal form.
An Awesome Conference
MvcConf is a virtual conference focused on one thing: writing awesome applications on top of the ASP.Net MVC framework. Your brain will explode from taking in so much hard core technical sessions. Sounds fun eh?
This is a community event and we want the best and brightest sharing what they know.
We intend to record each session and make them available online for viewing. We intend to make the videos available free of charge, depending on conference sponsorships.
Read the full post ... (230 words, 2 images, estimated 55 secs reading time)
.NET, ALT.NET, ASP.NET, ASP.NET MVC, General News, Local Events, Microsoft News, MVC

Another internal company email I sent today and found useful enough to share in the wild (after few modifications)…
Hey all,
There is an online conference (streamed over the Internet, you don’t have to go to physical place) tomorrow called MVCConf; in addition to the MVC in the name it’s related to so many .NET and SQL and jQuery related stuff.
You may want to attend as many sessions as you can.
The conference is going to be TOMORROW July 22 from 8 AM to 5 PM CDT (that means UTC – 5 time, considering Abu Dhabi is UTC + 4, the mentioned time is 9 hours late than Abu Dhabi, so, 8 AM CDT = 5 PM for us, 5 PM CDT = 2 AM for us).
Of course you do not have to attend all the sessions. Actually you cannot, because they have 3 parallel tracks. (3 sessions at a time).
The conference is streamed over Microsoft Live Meeting.
Register from:
See you online :)
Let me add here that the conference agenda can be found at:
Read the full post ... (267 words, 3 images, estimated 1:04 mins reading time)
.NET, ALT.NET, ASP.NET, ASP.NET MVC, Local Events, Microsoft News, MVC
This post gets enough said about how the Razor parser works.
http://blog.andrewnurse.net/CommentView,guid,89b7bd90-52d7-4d49-b87d-4e888f285b4c.aspx
The guy, Andrew Nurse, is the one who wrote the parser! (from Haack’s note)
After reading it and a quick chat with @Haacked on twitter, it seems all your “escape” kind of Razor expressions (that is meaning: when mixing code and text without spaces etc…) will look like @(someCode)someText. This is coming from an example, to escape a C# identifier that’s also a keyword, say “class”, you’d be using @(@class). The @(…) style is the new <%: … %> but only required for escape situations.
Also, it seems that switching from being equivalent to <%: … %> to being equivalent to <%= … %> by using some Razor notation is not gonna make it. You need to do it through doing some classes implementing IHtmlString interface.
Of course I’m not so sure that’s exactly the case. Anyway, Razor is only available now in WebMatrix mini-IDE, not much MVC love yet (pretty soon). Just thought it might be interesting…
Permanent link to this post (175 words, 2 images, estimated 42 secs reading time)
ASP.NET, ASP.NET MVC, MVC, Razor