jQuery Star Rating Plugin Web Method Call with ASP.Net

I started playing with the jQuery Star Rating Plugin v3.14. But, I could not really find a good way to make web method calls or a decent write up of how to use it with ASP.Net.

So, I added auto-submit-star to the markup for it to make the callback, added runat=”server”, and a hidden field with the record id.

<input name="star1" type="radio" class="auto-submit-star" runat="server">
<input name="star1" type="radio" class="auto-submit-star" runat="server">
<input name="star1" type="radio" class="auto-submit-star" runat="server">
<input name="star1" type="radio" class="auto-submit-star" runat="server">
<input name="star1" type="radio" class="auto-submit-star" runat="server">
<asp:HiddenValue id="hfRatingID" runat="server"/> 

After that, added the following script that performs the jQuery Web Method call

$(".auto-submit-star").rating({ callback: function (a, b) { 
PageMethods.RateIt( $(this).siblings('input[id*="hfRatingID"]').val(), a) 
}})

Then makes web method call to a static class in code behind

[System.Web.Services.WebMethod()]
[System.Web.Script.Services.ScriptMethod()]
public static void RateIt(int id, string value) // Method have to be static { 
// Make call to update DB rating value 
}

Now you should be able to make an asynchronous call for users to rate an item. Hope this helps.

WP7 Windows Phone 7 Wish List

Nokia has recently released the Lumia 900 which is the WP7 flagship model at a great price. I had some time to play with it and overall the hardware looks and feels solid. However, I have a few complaints such as no memory card slot, no battery replacement, or the ability to change the Sim card without some sort of tool. On the software front, the OS has not changed much since I sold my Samsung Focus last year.

Windows Phone 7 has been in the market more than a year and has failed to steal the spotlight from Android and iPhone. To most power users, it still does not feel like a smart phone but more like an improvement from a feature phone. I am going to list several things I wish WP7 had but will probably not materialize until WP8 during the 2012 holiday season and very likely will never be on a Lumia 900.

  1. Microsoft is pushing the cloud everywhere and WP7 is not the exception. You got 20GB available in your SkyDrive. Therefore, they decided to drop support for memory card slots. If it is up to Microsoft you are pretty much stuck with whatever memory came with your phone. The Samsung Focus came with an option to install one but it required formatting the phone and you would never be able to take it out without having to reformat.  With Micro SD card prices constantly going down and increasing in size, it makes me sad that WP7 does not have this option.
  2. This one is probably more for Audiophiles but it is not possible to store music in Lossless formats on a WP7 phone. On my Zune HD, I was able to store WMA Lossless songs. However, WP7 devices will downconvert your music files to a WMA Lossy codec when trying to copy Lossless files to it. Again, this is probably a space concern. Maybe they don’t want you downloading big files from the cloud. iPhones let you use ALAC and Androids and Blackberries will even let you play FLAC files. Continue reading “WP7 Windows Phone 7 Wish List”

If Cell Phone and ISP Companies ran the other utilities companies

Gone are the days when you could go into a store and get an unlimited data plan. Even though it is advertised as unlimited, that is seldom the case anymore. You got cable companies such as AT&T and Comcast that have caps of 150GB and 250GB a month respectively among others. Some companies will charge you a fee but others will deny service after a repeat offense. These caps are probably in place to prevent streaming subscribers to services such as Netflix, Hulu Plus, or Amazon Prime to hog all the bandwidth.
A few years ago it was mostly believed that if a consumer used a lot of bandwidth, he or she was using bittorrent and downloading illegal music and movies. This is not the case anymore, Netflix alone accounts for more traffic than bittorrent. Even Comcast was caught sniffing your data to find out if you were using bittorrent to then throttle and slow down you data.
Some years have passed, and now with smart phones being nearly ubiquitous users hogging the data is still a problem. Verizon will offer you 4GB of unlimited data, AT&T has similar caps and they will charge you extra if you go over. T-Mobile will not charge you extra but they will slow down your data after your allowance. Hours of using Music and Movie apps such as Pandora and YouTube will quickly deplete your data allowances. C-Spire, previously known as Cellular South, Continue reading “If Cell Phone and ISP Companies ran the other utilities companies”

Say NO to the SMS “Tax”

No SMSAs you may already know, the “evil” telecom companies want to squeeze every cent they can out of you by making up fees. SMS or Short Message Service is what is usually described as texting by your carrier. In the last decade before the explosion of smartphone, SMS used to fill a gap where there was little to no connection to the Internet. SMS functioned though SMS centers hence requiring its own infrastructure.

Nowadays, this is completely irrelevant as most smartphones typically use standard mail protocols such as SMTP over TCP/IP. Meaning, if you have a smartphone, it is very likely you are being charged for something that should be covered by your data plan alone. Of course, I am not familiar with pricing from all cell phone companies; however, if you are on a “bundle” plan and texting is part of it, most likely they are just getting a bundle of money from you. Otherwise, if it is clearly spelled out as a separate fee, you might want to consider just not paying for it and using alternatives that require your data plan alone.

There are several apps out there, each one with its limitations, but with more features than SMS.  So far, Kik is my favorite cross platform messaging app as it is free and it is available for iOS, Android, BlackBerry, and WP7. The makers of Kik are currently being sued by RIM, the maker of BlackBerry Messenger Continue reading “Say NO to the SMS “Tax””

Limit the number of items the user can select in a ListBox with JQuery

This little script is able to grab all the listboxes on the page.

      $(document).ready(function() {
          $("select").change(function() {
             if ($(this).find('option:selected').length > 5) {
               this.options[this.selectedIndex].selected = false;
             }; }); }); 

pretty sleek huh?

What to do with a small SSD?

As with most technologies, SSD is actually becoming affordable. There are several entry level drives that vary from $80 to $120 in price and 20GB to 60GB in size. However, I strongly advice to step it up to a bigger drive because you are going to run into several issues and annoyances if you go with a small capacity SSD.
First of all, since the drives are so small, the OS will most likely take half the space of the drive. You then install Office, Visual Studio, Photoshop, or any other big app that will benefit from the performance gains and you’ll start running out of space.
Putting media in a mechanical drive should go without saying. Then take a look at hibernation, if you are not on a laptop, you might want to consider disabling it. Hibernation uses an amount of space equivalent to the amount of RAM you have on your computer. 4GB is pretty common and 8GB is starting to become the norm, meaning that would be space you will have to live without. To disable it in Windows 7, open a command prompt and type

powercfg -h off

Next, if you already have something in place to regularly back up your computer, consider disabling system restore. Go to the Control Panel, select to view by Large Icons instead of Category, pick System, and then System Protection. There, you can click on the Configure button, and you will be able to disable System Restore for your booting drive.
After that there is Pagefile.sys, a file in Windows that acts as virtual memory. If you have a large amount of RAM, you can easily do away with this file, make it smaller, or move it to another drive. Simply, go to System again, click on Advance System Properties, in the Advanced tab, click on the performance section the settings button. That will open the Performance Options window where you should click on the Advance tab, then on the Change… button in the Virtual Memory Section. Some sources advocate these changes for small performance gains or to extend your drive’s life, but the jury is still out on that. For certain, they will save you space in your drive.

However, the latest intel chipset on the market, Z68, has a clever way to handle these small drives. It will allow you to use Smart Response Technology (aka SSD caching). It acts as cache for a mechanical drive. It will speed up your system automatically without having to deal with all the nuisance of a small SSD maintenance or SSDs in general.
Continue reading “What to do with a small SSD?”

Did you know.. why your primary drive is labeled C: ?

If you don’t remember the days we rolled down car windows, watched the Thundercats, or actually had to remember stuff because of lack of smartphones, you might have wondered (or not!) why your main drive on a Windows box is assigned the letter C:. Anyways, I will tell you that the letters A: and B: were usually reserved a decade or two ago for floppy drives and sometimes for removable media such as tape drives. Apple was the first one to release a desktop without it and it is usually credited with the floppy’s demise. However, it would be common to have a 5 1/4 inch A: and a 3 1/2 inch B: drive. Now, this raises the question, why aren’t USB thumbdrives assigned these letters? Hence, they have to fight with optical drives and secondary hard drives for other letters. It is sometimes a guess to figure out which letter my thumbdrive is assigned to (or not!).