When you get the following error “The tools version “4.0? is unrecognized” or for any other version, in Visual Studio 2008, apply the following fix.
Make sure these keys are present in the registry. If not present, add it.
This should resolve this issue.

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\3.5] 
"DefaultToolsVersion"="2.0"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\2.0] "MSBuildToolsPath"="C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\3.5] "MSBuildToolsPath"="C:\WINDOWS\Microsoft.NET\Framework\v3.5\"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0] "MSBuildToolsPath"="C:\WINDOWS\Microsoft.NET\Framework\v4.0.20506\"
Category: visual studio 2008
Bookmark and Share
If you get Provider error '80004005' - Unspecified error after http://notepad.softwarevalley.net/view/13/microsoftodbc-microsoft-access-driver-the-microsoft-jet-data.aspx, you should try setting ConnectionTimeout for you Connection object to 20, for example, like this:

conn.ConnectionTimeout = 20
Source:
My self
Category: classic aspwindowsiis
Bookmark and Share
If you are using Classic ASP, you have probably seen this error before:
[Microsoft][ODBC Microsoft Access Driver] The Microsoft Jet database engine cannot open the file '(unknown)'. It is already opened exclusively by another user, or you need permission to view its data.

To fix this problem, you need to set full control on c:\windows\temp for the IUSR account like this:

1. Open c:\windows and locate temp folder.
2. Right click on the temp folder and choose Properties
3. Click on the Security tab, then on Edit, Add, Advanced and finally Find Now
4. On the Search results find IUSR and Click OK two times and in Group and user names select UISR and click on Full control and then Apply, OK and OK once more
5. After that, refresh the application and error from above should be gone.

Source:
My self
Category: classic aspwindowsiissecuritywin2k8server
Bookmark and Share
In Windows, whenever we right-click on Desktop or Explorer, we get "New" menu which contains shortcuts for various known file types. We can easily create new files using this handy "New" menu.



Sometimes we may want to remove a few unwanted items from "New" menu or we may want to add a few necessary items to "New" menu which are not present. So in this tutorial, I'll tell you how can you add / remove items to / from "New" menu:

A. To Add an Item in "New" menu:

1. Open regedit and expand "HKEY_CLASSES_ROOT" key.

2. Now look for the file type which you want to add in "New" menu, e.g. for adding MP3 file type look for .MP3 key.

3. Right-click on it and select "New -> Key" and give it name "ShellNew".

4. In right-side pane, right-click and select "New -> String Value". Give it name "NullFile" and press Enter.

5. Thats it. You'll immediately get the file type entry in "New" menu.

B. To Remove an Item from "New" menu:

1. Open regedit and expand "HKEY_CLASSES_ROOT" key.

2. Now look for the file type which you want to remove from "New" menu, e.g. for removing MP3 file type look for .MP3 key.

3. Expand it and delete the "ShellNew" key.

4. Thats it. The file type will be removed from "New" menu.
Category: windowsvista
Bookmark and Share

CSS drop down menu 8. Jul 2009

After playing with some javascript menus today, I decided to see if I could pull off a drop down menu without any javascript. I’ve seen it done before, so I thought I’d give it a shot. It actually ended up being pretty simple, so I thought I’d share the how-to.

I uploaded a demo of what I mean. If you take a look at the source, the basic elements of the menu are ul and li tags.

The first thing to do is differentiate the parent menu items from the menu items that only appear after you hover over the parent item. I did this with classes.

<div id="menu"> <ul id="item1"> <li class="top">menu item</li> <li class="item"><a href="#">menu item 1</a></li> <li class="item"><a href="#">menu item 2</a></li> <li class="item"><a href="#">menu item 3</a></li> </ul> </div>

You’ll see the parent item is marked with top, while the rest are marked item. Now I can get to hiding .item and letting .top continue to show. So I’ll add this to the style sheet.

#menu ul .item{display:none;}

And when I hover over the top of the unordered list, I want all list items with class item to appear again. Here’s what I’ll add to the style sheet.

#menu ul:hover .item{display:block;}

You could choose to use display:block or display:inline. The last important piece is the position of the menu.

#menu{position:absolute;}

I wouldn’t say this is necessary, but if you’d like the drop down to appear on top of the content below, it is. Otherwise, your CSS menu will just displace everything underneath it.

You can dig through more of the source from the demo if you’d like to see the styling of the menu. Most important of all, this is all web standards compliant, and keeps the HTML of the page beautiful. I’ve tested it successfully in Camino 1.5.1, Firefox 2.0.0.9, and Safari 3.0.3. It doesn’t work in IE6 though. If you’d like test it anywhere and see how it fairs, go for it.

note: this is an exercise, not the perfect drop down menu

Category: css
Bookmark and Share

If you have Firefox on your computer you should know that right after a new update has been installed, a Firefox Updated tab will automatically pop-up giving you the famous message : “You have been updated to the latest version of Firefox”. This tabs usually comes only once, upon opening Firefox for the first time, right after an update. Anyway, it may happen that this tab keeps opening by itself each time you start Firefox, along with a default Google tab. Let’s see how we can solve this issue.

Usually,  this issue is due when the Preference file doesn’t work properly, preventing Firefox from changing it once you first  saw the Firefox Updated message.  Here are a couple of solutions for you:

  1. Visit this page, directly available at Mozilla website and follow the steps to solve the issue.
  2. Install Mozbackup in Firefox and backup all of your Bookmark, saved passwords etc. Just do not back up the General Settings since they contain the issue you are trying to solve.
  3. Close Firefox
  4. Now, on Windows click Start, click Run… type %APPDATA%\Mozilla\Firefox and hit Enter.
  5. Rename profiles.ini to  profiles.ini.bak
  6. Open Firefox which will recreate a brand new profiles.ini.
  7. Restore your stuff by using Mozbackup again.
  8. Done!
Category: firefoxtricks
Bookmark and Share

Well, that was easy. I just searched for Microsoft SQL Server in the registry, since that was the beginning of the name in the Sync Center. Found this key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SyncMgr\Handlers

Go there and find the one (probably only two there, or else you would have had Sync Center showing up before, too) that says Microsoft SQL Server and delete that branch. If it makes you feel safer, export the branch before you delete it in case you want to restore it. But, after deleting that branch the Sync Center icon will go away. Mine was called this:

{08b0b2d5-3fb3-11d3-a4de-00c04f610189}

And I imagine yours will be, too.
Category: vista
Bookmark and Share

We made heavy use of the ASP.NET membership and profile system for Video.Show (a Silverlight 1.0 video community website system, available onCodePlex). In addition to storing basic profile information, we created a custom profile with some additional fields. It's a really easy way to add add some additional personalization to your site without having to add a bunch of tables to your database.

This is really simple if you're using a Website Project - you can just add additional properties to the profile section of your web.config, and a custom profile class is generated on the fly when you rebuild your application. That makes things ridiculously easy. First, we'd define the property in web.config:

<!-- In web.config -->
<profile >
  <properties>
    <add name="FavoritePasta" />
  </properties>
</profile>

Then you can refer to the Profile.FavoritePasta profile setting anywhere in your web application, and it's automatically mapped to the current user:
Profile.FavoritePasta = "Pumpkin Ravioli";
And you can access the data just as you would a session property:
<span id="user-favorite-pasta"><%= Profile.FavoritePasta %></span>

Not so fast, I'm using a Web Application Project

Yeah, here's the catch. If you're using the Web Application Project model, the custom build handling for the profile doesn't kick in, so those custom properties you've lovingly crafted in your web.config aren't going to be compiled into a custom profile class.

There's a Visual Studio 2005 add-in called WebProfile that reads your custom profile and creates a custom class for you. That's handy, but I passed on it. For one thing, I haven't heard that there's a VS 2008 version of this. Additionally, I don't like to require a custom add-in in order to get my code to work in case I want to add a new profile property - especially when I'm working on a project that's going to be distributed on CodePlex.

Fortunately, it's not very hard to implement a custom profile. First, we'll write a class that inherits from System.Web.Profile.ProfileBase. I added a few static accessors, too:

using System.Web.Profile;
using System.Web.Security;

namespace VideoShow
{
    public class UserProfile : ProfileBase
    {
        public static UserProfile GetUserProfile(string username)
        {
            return Create(username) as UserProfile;
        }

public static UserProfile GetUserProfile() { return Create(Membership.GetUser().UserName) as UserProfile; } [SettingsAllowAnonymous(false)] public string Description { get { return base["Description"] as string; } set { base["Description"] = value; } } [SettingsAllowAnonymous(false)] public string Location { get { return base["Location"] as string; } set { base["Location"] = value; } } [SettingsAllowAnonymous(false)] public string FavoriteMovie { get { return base["FavoriteMovie"] as string; } set { base["FavoriteMovie"] = value; } } } }

 
Now we need to  hook that up in the profile section of web.config - notice that I've included inherits="VideoShow.UserProfile" in the profile declaration:
 
<profile inherits="VideoShow.UserProfile">
  <providers>
    <clear />
    <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider"
	connectionStringName="VideoShowConnectionString"/>
  </providers>
</profile>
 
With that done, I can grab an instance of the custom profile class and set a property:
 
//Write to a user profile from a textbox value
UserProfile profile = UserProfile.GetUserProfile(currentUser.UserName);
profile.FavoriteMovie = FavoriteMovie.Text;
profile.Save();

Part of the reason for the accessor is to allow display of profile information for users other than the current user - for instance, a public profile page which displays information about other users in the system.

//Write to a user profile from a textbox value
UserProfile profile = UserProfile.GetUserProfile(displayUser.UserName);
Response.Write(profile.FavoriteMovie)

And of course, I can still databind to it as well:

<span id="user-favorite-movie"><%= VideoShow.UserProfile.GetUserProfile().FavoriteMovie %></span>

A few disclaimers:

  • This isn't news, it's been out since ASP.NET 2.0 shipped. Still, it's pretty handy to know about, and if you're like me you may have forgotten or never really dug into some of the ASP.NET 2.0 goodies.
  • This isn't the ultimate solution in terms of entity modeling. Custom profile information is stored in two columns in the aspnet_Profile table (delimited strings in one column, another column for binary serialized objects). That means that the only real way to read or write custom property values is via the profile API. That's not a real problem unless you need to query or join on information stored in a custom profile setting.

Further information:

Profiles in ASP.NET (K. Scott Allen)

Essential ASP.NET 2.0, Chapter 5 (Fritz Onion)

Category: asp.netsecurityc#
Bookmark and Share

This is my first time posting an IT solution. Hopefully someone will google this and find it helpful. It's really a simple solution but I wished someone posted this and save me 2 days of headache. For a while I had a dillema on how to show ad on a 100% ajax web site. It's totally unfair to show only 1 impression of ads while the user is browsing your site. Currently, I'm using Google's Adsense and they don't give any help on Ajax Web thus I had to come w/ my own solution. Of course there was some help on the web to do this but it was a combination of results + my own solution that made it work.

Ok~ so let see what is fair use of this adsense. In my opinion (yours may differ..even Google), if there's a content change in your web site then it's fair to show a new ads on your page. Since I'm using AJAX, the best place to refresh the ad would be where you're making your HTTP request to the server. Example!

var oXmlHttp = createXMLHttp();

oXmlHttp.onreadystatechange = function() { 
     if (oXmlHttp.readyState == 4) {
          var storyDiv = document.getElementById(layerName); 
          storyDiv.innerHTML = oXmlHttp.responseText; 

           refreshAd(); 
      }
};

refreshAd() will refreash the ad. No better place then here. Do not put this under any onClick/onChange/onAnything behavior as it will only complicate your page like onClick="doSomething();refreshAd();" 

// Need to pass unique URI each time to make sure that your browser does not cache the result! This is needed for Firefox specifically!
function refreshAd() {
      var currentTime = new Date(); 
      googlead.location = "pages/ad.jsp?s=" + currentTime.getTime(); 
}

That's right! I'm using IFRAME.. I can already see you're not surprised as if you already know the solution. There's really no other option since any other solutions will be breaking Google's TOS. 
<iframe id="googlead" name="googlead" href="" src="" width="100%" height="100" scrolling="no" frameborder="0" marginwidth="0" marginheight="0"/> 

Create a globally access IFRAME named "googlead" or whatever you desired. To make sure that this page does not get cache, always pass a unique parameter. In this case I used client's system time. You could use other algorithm to create unique random characters but for lazy people like me will use what I did.

Great! I got my IFRAME to refresh on every HTTP/AJAX request.. but what the hell! it only shows Public Service Ad. I want to show ads that's related to my site!
Now in order for Google to content search your page... the content has to be inside wherever you put your google adsense script. For now this is what I had.

--ad.jsp-- 
<script type="text/javascript">
<!-- 
google_ad_client = "googleID";
google_ad_width = 728; 
google_ad_height = 90; 
google_ad_format = "728x90_as"; 
google_ad_type = "text"; 
google_ad_channel =""; //-->
</script> 
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> 


No wonder I'm getting PSA, there's no content!! now if I put a content then it shows litterally on your page.. which becomes stupid. Showing Ad and showing key word contents to the user will quickly condemn your site to hell. Now how can I put the content that's not visible to the audience? By pure stupid dumb luck, I found out that you can write invisible contents in your IFRAME by setting absolute height (that's right it took 2 days..my other solutions were too complicated and all failed).
<iframe id="googlead" name="googlead" href="" src="" width="100%" height="100" scrolling="no" frameborder="0" marginwidth="0" marginheight="0"/> 
For my ad I only need height of 100, so if I write anything below then it's invisible to the user and visible to the google content search engine! beautiful!! I just love dumb simple solution!

Ok~ now I put
<script type="text/javascript">
<!-- 
google_ad_client = "googleID";
google_ad_width = 728; 
google_ad_height = 90; 
google_ad_format = "728x90_as"; 
google_ad_type = "text"; 
google_ad_channel =""; //-->
</script> 
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> 
<br/><br/><br/><br/> 
<% if (yourKeyWord != null) { 
           print your key words here!
      } else { 
          print your general key words in case you don't have any. Example "Vacation Money Dating" better than PSA's!      
} %> 


Voila! Now I have total control of the content key words for google engine! In this case I used JSP where I save the content in my session and display on this page. But, I'm sure this techinque will work on whatever programming language.

Category: ajax
Bookmark and Share

Window.onload() is a workhorse of traditional javascript code. It’s been used by coders for years to kick start the client side magic as soon as everything on the page loads up.

But sometimes waiting for a page to load just isn’t quick enough.

A few large image files will quickly reveal that window.onload() can be painfully slow. So when I was creating a web app for internet marketers recently, I had to have something faster.

Some quick research into possible workarounds for the window.onload() issue brought me to some code by Brother Cake. If all you need is a fast way to kick start your javascript then their code might be something to try.

But if you’re going to be doing some DOM (Document Object Model) javascript coding then why not use jQuery and have your cake and eat it too (horrible pun - sorry).

jQuery has a handy little function that launches your javascript as soon as the Document Object Model is ready… which happens before the page has finished loading.

$(document).ready(function(){
  // Your code here...
});

You can use it to launch any kind of javascript you like. It doesn’t have to be reserved for jQuery style coding. And there’s nothing wrong with telling jQuery to launch several different functions at once.

Similar to many init() functions you may have seen before… just a lot faster.

You’ll see this code used again and again in the examples I give you on 15 Days of jQuery.

Category: jquery
Bookmark and Share
Page 1 of 2 Previous »

Free subscriptions

Enter your email address to receive an email when new note is been added.
We will never share your address, and you can unsubscribe in every email.

$19 VPS Wide Skyscraper