Not Equal C && !=C && 不等于西
RSS icon Email icon Home icon
  • Disable Browser Cache for Specific Page in ASP.NET MVC 3

    Posted on May 21st, 2015 Sean Add comments

    Generally when you click the “Back” or “Forward” button on the browser, the page won’t refresh unless you tell the browser not saving the cache for it. To implement “Disable Browser Cache” for specific page in ASP.NET MVC 3, just simply use the “OutputCacheAttribute” from MVC 3 framework:

  • 1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading...Loading...
    19 views
  • jQuery $.ajax()/$.get() function always get same value for IE

    Posted on June 19th, 2014 Sean Add comments

         When I was trying to use jQuery $.ajax() or $.get() function retrieve some random value from the server side, it’s working fine on firefox or chrome, but not IE. The server side code like below (written in ASP.NET MVC):

         The client side code:

         I’m supposed to get a random number every time I click the link, but in IE, always same one returned. Regarding Craic Computing’s Blog, that’s because IE will cache the value first returned, and trade rest requests as identical by default, so it won’t update the value since the request URL never change.
         To fix this issue, just disable cache in the jQuery function as following:

  • 1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading...Loading...
    16 views
  • Mailbox unavailable for IIS 6 smtp service

    Posted on January 18th, 2014 Sean Add comments

         After created a smtp virtual server and enable the smtp service, if the web application still got error such “Mailbox unavailable. The server response was: 5.7.1 Unable to relay for name@email.com”, need to do following:

    1. Open “IIS 6 Manager”
    2. Under local computer name, find SMTP virtual server, and open properties for it
    3. On “Access” tab, click “Relay” on “Relay restrictions” section
    4. Choose “Only the list below”, then add loopback ip “127.0.0.1” and server ip to the list
    5. Restart smtp service
  • 1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading...Loading...
    9 views
  • Predicates in Lambda Expression for Entity Framework Code First

    Posted on July 24th, 2013 Sean 1 comment

         If I have 2 entities of “People” and “Car”, and “1” People can have “Many” Car, my code first class could be like below:

    Read the rest of this entry »

  • 1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading...Loading...
    398 views
  • Change Visual Studio Workspaces for Team Foundation After Client Name Changed

    Posted on February 2nd, 2013 Sean Add comments

         As part of source control in visual studio team foundation, ever user has their own workspace tie to the computer name of client and username on Team Foundation Server. If any one needs to change the computer name on client computer or the username, should use “tf.exe” command from the visual studio like following:

    1. Make sure Team Explorer has been installed. (most likely it’s there if VS2010 installed)
    2. Open a command line window and go to folder “C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE” (or “C:\Program Files(x86)\Microsoft Visual Studio 10.0\Common7\IDE” if on Windows 7)
    3. Run the command
  • 1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading...Loading...
    31 views