Install Visual Studio 2010 to Windows 7 64Bit
I have issues when installing Visual Studio 2010 to Windows 7 64 bit. The prereqs fails installing with that 2908 error.
I have tried everything thrown at different forums as solutions for this.
Finally found the solution, it is all about the versions of this file: mscoree.dll in your C:\windows\system32\
If this file's version is 4.0.31106.0, you need to stop here, try to find other sources with your issues.
If the file's version is 2.0.50727.4927, lucky you, you just found your solution here.
All you need to do, is to find this file with version 4.0.31106.0 from other computer, and copy it to your folder, nothing much need to be done else, even not need to restart the computer, you can continue the visual studio 2010 installation.
FindControl() extension methods, FindControl(), FindControlsByType() and FindControlRecursive()
Imagine, you have 20 TextBox in your page, you want to empty each of the TextBox value. How you are going to do it?
Is it perfect to do the job this way?
var txtControls = this.FindControlByType<TextBox>();
foreach (var control in txtControls)
{
control.Text = string.Empty;
}
.NET only offers us FindControl(), what we need is to create some extension methods that can extend the functionalities, such as FindControlsByType() and FindControlRecursive().
private static void FindChildControlsByType<TControl>(this Control root, List<TControl> childControls) where TControl: Control
{
foreach (Control control in root.Controls)
{
if (control.GetType() == typeof(TControl))
childControls.Add((TControl)control);
FindChildControlsByType<TControl>(control, childControls);
}
}
public static List<TControl> FindControlByType<TControl>(this Control root) where TControl: Control
{
var childControls = new List<TControl>();
FindChildControlsByType<TControl>(root, childControls);
return childControls;
}
To an extend, here are another extension methods that I am using very often.
public static TControl FindControlRecursive<TControl>(this Control root, string id) where TControl : Control
{
if (root.ID == id)
return (TControl) root;
foreach (Control ctl in root.Controls)
{
Control foundCtl = (TControl) ctl.FindControlRecursive<TControl>(id);
if (foundCtl != null)
return (TControl) foundCtl;
}
return null;
}
public static TControl FindControl<TControl>(this Control control, string id) where TControl : Control
{
return (TControl) control.FindControl(id);
}
How to access the sub controls in the PagerTemplate in DataPager .NET control
At least for me, I can not use MyDataPage.FindControl("LblPage") to find my LblPage control in the PagerTemplate.
I have to use an recursive way to locate it.
public static Control FindControlRecursive(Control container, string id)
{
if (container.ID == id)
return container;
foreach (Control control in container.Controls)
{
Control foundControl = FindControlRecursive(control, id);
if (foundControl != null)
return foundControl;
}
return null;
}
Visual Studio 2008 Themes
List below are 8 Visual Studio 2008 themes that I am using or have used before. The default Font for all the themes is "Courier New", and Size is "12".
In order to have a clear view of the themes, I screenshotted all themes with the same code. Since the space is pretty limited, I tried my best to have comments, variables...etc. covered in the code.
I did spend some time on them, hope you will like them. Thanks.
From Yahoo: How TO: 34 Rules to Speed Up Your Web Site
Just copy it from a Yahoo article, I think this is really useful for the website designers.
The Exceptional Performance team has identified a number of best practices for making web pages fast. The list includes 34 best practices divided into 7 categories.
Minimize HTTP Requests
80% of the end-user response time is spent on the front-end. Most of this time is tied up in downloading all the components in the page: images, stylesheets, scripts, Flash, etc. Reducing the number of components in turn reduces the number of HTTP requests required to render the page. This is the key to faster pages.
One way to reduce the number of components in the page is to simplify the page's design. But is there a way to build pages with richer content while also achieving fast response times? Here are some techniques for reducing the number of HTTP requests, while still supporting rich page designs.
Combined files are a way to reduce the number of HTTP requests by combining all scripts into a single script, and similarly combining all CSS into a single stylesheet. Combining files is more challenging when the scripts and stylesheets vary from page to page, but making this part of your release process improves response times.
CSS Sprites are the preferred method for reducing the number of image requests. Combine your background images into a single image and use the CSS background-image and background-position properties to display the desired image segment.
Image maps combine multiple images into a single image. The overall size is about the same, but reducing the number of HTTP requests speeds up the page. Image maps only work if the images are contiguous in the page, such as a navigation bar. Defining the coordinates of image maps can be tedious and error prone. Using image maps for navigation is not accessible too, so it's not recommended.
Inline images use the data: URL scheme to embed the image data in the actual page. This can increase the size of your HTML document. Combining inline images into your (cached) stylesheets is a way to reduce HTTP requests and avoid increasing the size of your pages. Inline images are not yet supported across all major browsers.
Reducing the number of HTTP requests in your page is the place to start. This is the most important guideline for improving performance for first time visitors. As described in Tenni Theurer's blog post Browser Cache Usage - Exposed!, 40-60% of daily visitors to your site come in with an empty cache. Making your page fast for these first time visitors is key to a better user experience.
How to Set or Change the HeadText values in GridView control
GridView control offers us to bind the data and list the data in columns with nice format. However, when I want bind the HeadText properties for the columns of the data, I have to use this way:
--------------------------------------------------------------------------------
MyGridView.Columns[0].HeadText = "Head Text For Column 1"; MyGridView.Columns[1].HeadText = "Head Text For Column 2";
--------------------------------------------------------------------------------
Just FYI, *_*








