Clicky

Once again I want to talk about URLs and who doesn’t know that I’m a big fan of friendly, clean and pretty URLs in my applications! When you write an application (for example a blog engine) you have multiple choices to create unique URL for a single post; you can include an integer ID (myblog.com/458) or a GUID instead of integer or the best way, a friendly URL like myblog.com/hey-i-am-a-clean-url. This value should be unique and should not be changed if your blog post title is changed; so we should have a separate column in our database table to store this friendly URL. I wrote a simple JavaScript code that receives your blog post title, clean it from non alphanumeric characters and replaces them with a dash, change all characters to lower case and make it ready to be sent to your business logic handler:

<script type="text/javascript" language="javascript">
    function parseUrl(url) {
        var cleanUrl = (url + " ").replace(/[^a-zA-Z0-9]+/g, "-");
        return cleanUrl.slice(0, cleanUrl.length -1).toLowerCase();
</script>

and this two lines of code to fill URL field automatically as user types the post title (using jQuery:

<script type="text/javascript" language="javascript">
    $(document).ready(function() {
        $("#postTitle").keyup(function() { $("#postUrl").val(parseUrl($("#postTitle").val())) }
        );
    });
</script>

 

This is very useful if you’re building applications using ASP.NET MVC and have control over URLs using routing engine. This is also helpful for WebForms developers who use routing in WebForms or rewrite extension less URLs using IIS7, ISAPI_REWRITE and etc.

Let your URLs be more friendly against search engines ;)

kick it on DotNetKicks.com


 
Categories: ASP.NET | ASP.NET MVC | JavaScript | SEO | Tutorial

If you live in Iran and are MCI carrier subscriber and also you have an iPhone, you might ask yourself how to enable voicemail on your iPhone. I give you some quick steps to enable voicemail on your iPhone:

  1. Click on Phone icon and then Keypad and dial *5005*86*09912#
  2. Press call and wait.
  3. Now you can access your voicemail box by tapping Voicemail in Phone.
  4. To enable forwarding calls in various situations go to step 1 and dial these commands instead:
    • Forwarding all calls to voicemail: *21*09912#
    • Forwarding calls when your phone is busy: *67*09912#
    • Forwarding calls when no reply from you: *61*09912#
    • Forwarding calls when your phone is unreachable: *62*09912#

 

Please note that voicemail service should have been already activated on your account. It’s not activated by default when you purchase your SIM Card.


 
Categories: iPhone | Tips and Tricks | Tutorial

Right after Apple upgraded its iPhone OS to v.3.0 and introduced new Push Notification feature many companies and developers started to write new applications or update their existing apps to use this new cool feature. One of them was BNO News which sends out breaking news alerts in four different ways: 1- Twitter, 2- Email, 3- Friendfeed, 4- iPhone. First three services are free but the last one is not free. You have to pay for their application as well as a monthly subscription fee to receive alerts on your iPhone. I was thinking to find a way to receive these alerts for free and I find a tricky way that I want to share with you here. You have to follow these steps to enable BNO alerts on your iPhone without paying them a penny!

  1. Download and install TextFree Lite on your iPhone. It’s free.
  2. Create a TextFree account which gives you a unique @textfree.us email address to receive messages.
  3. Create a new GMail account at http://mail.google.com/mail/signup
  4. Go to BNO mail subscription page and subscribe using your new GMail address.
  5. Login to your new GMail account and wait until BNO confirms your subscription then go to GMail Settings > Forwarding and POP/IMAP

    GmailSettings
    GmailForwarding 

    Now put your textfree.us email address in the text box labeled with “email address” (see above) and save your settings.
  6. You’re done! Each time BNO sends an alert to your GMail address it is automatically forwarded to your textfree.us and therefore you receive a Push Notification alert on your iPhone!

 

Do you know why we used GMail account in the middle of our trick and didn’t use textfree.us address directly? BNO rejects subscription requests from all @textfree.us or similar services email addresses!

Hope you enjoy this trick ;)


 
Categories: Download | iPhone | News | Tips and Tricks | Tutorial

November 23, 2008
@ 01:20 PM

A few years ago, when I had begun learning ASP.NET and Web Development, I found a nice and lovely guy who was very professional at that age. We were both university students (in different universities) then and was studying Mathematics; me, Pure Mathematics and he, Applied Mathematics. Almost every night, we were chatting using poor dialup connections and he was opening new doors of knowledge to me. He was a professional and pioneer developer and coder at age of 20-21.

I’m talking about my dear friend, Soheil Rashidi. But you may ask why I’m talking about this nostalgia?! Soheil had a website dedicated to Persian language developers to provide articles and useful resources for them. We call it iDevCenter (or iDC). About 2-3 years ago Soheil suddenly stopped iDC because of what he calls an ‘Unresponsive Model’. Now I can officially and proudly announce re-launch of one of my most favorite Persian websites in field of coding and development. Yeah iDevCenter.com is back!

New iDevCenter is completely different from what is was 2 years ago. iDevCenter v3.0 is a powerful Link Directory + a nice Wiki. All old iDevCenter members can login to their accounts using the same username and password (except one poor person that only I and Soheil know :-D). All information are categorized using tags and you can easily find relevant information.

If you’re Iranian or know Persian language I invite you to take a deep look at how Soheil rocks on iDevCenter.com!

 

And special message for my dear Soheil: A world of congratulations and sweet dreams for you :-*


 

We are getting closer to official release of Microsoft ASP.NET MVC. There are couple of tutorials and videos to get started with this new approach to enterprise web applications development. I found an eight part series of tutorial (in both C# and VB) on ASP.NET Website; good news is that all of these tutorial parts are available in PDF format too. I downloaded all of them and compress them in a single .rar file.

You can download it at http://www.sharplife.net/Files/ASPNETMVCTutorialPDFVersion.rar (approx. 1.7 MB).

 

Enjoy ;-)


 
Categories: .NET General | ASP.NET | ASP.NET MVC | C# | Download | Microsoft | Tutorial | Web Development