This page looks plain and unstyled because you're using a non-standard compliant browser. To see it in its best form, please visit upgrade to a browser that supports web standards. It's free and painless.

理昂的技養專欄 會員登入 會員註冊

Add the following line to the appSettings section of the outside web.config file:

    <add key="webpages:Version" value="1.0.0.0"/>
 

1. Change System.Web.Mvc from 4.0 to 3.0 for all projects in solution after convert solution from VS2010 solution file to VS2011 one

2. Change System.Web.WebPages from 2.0 to 1.0 for all projects in solution after convert solution from VS2010 solution file to VS2011 one

 3. recaptcha compile error:

Add reference to nopCommerce_2.50\packages\recaptcha.1.0.5.0\lib\.NetFramework 2.0\Recaptcha.dll

if there is no Recaptcha.dll, install it by NuGet plugin.

Step 1: Dump log file by starting VS2010 and skip plugins and extensions
    "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe" /resetskippkgs /log
    
Step 2: Open log file by notpad
    %APPDATA%\Microsoft\VisualStudio\10.0\ActivityLog.xml
    
Step 3: Search keyword in log file

Step 4: Find lost packages from VS2010 ISO

Step 5: Deploy VS2010 components individually
    http://msdn.microsoft.com/en-us/library/ee225240.aspx

Packages:

1. Windows 8 Consumer Preview

2. Visual Studio 2011 Ultimate Developer Preview

 

Steps:

1. New VM Settings:

CD/DVD: legacy emulation (Windows 8 bug to read CD/DVD on VMWare)

Remove floppy disk (When install Windows 8 will cause unattend installation and install VMWare Tools fail)

2. Install Windows 8

3. Install VMWare Tools

4. Download VS2011 by layout and run it to download packages to a folder

5. Install VS2011 from the folder

That's all...

1. Enable Visual Studio 2010 Intellisence for enterprise library configuration file
Step 1: Open configuration file
Step 2: Setup XML Schema 
To enable the Enterprise Library XML schema in Visual Studio, open the configuration 
file, open the XML menu, and click  Schemas . In the XML Schemas dialog, locate 
the Enterprise Library schema and change the value in the  Use column to  Use this 
schema. Then click  OK.

In computer sciencecross-cutting concerns are aspects of a program which affect other concerns. These concerns often cannot be cleanly decomposed from the rest of the system in both the design and implementation, and can result in either scattering (code duplication), tangling (significant dependencies between systems), or both.

For instance, if writing an application for handling medical records, the bookkeeping and indexing of such records is a core concern, while logging a history of changes to the record database or user database, or an authentication system, would be cross-cutting concerns since they touch more parts of the program.

Use TempData collection to preserve data and pass to the redirect target action.

For example:

 (閱讀全文)
The most frequent use of a redirect is in action methods that process HTTP  POST requests. As we 
mentioned in the previous chapter, POST requests are used when you want to change the state of an 
application. If you just return HTML following the processing of a request, you run the risk that the user will 
click the browser’s reload button and resubmit the form a second time, causing unexpected and 
undesirable results. 
To avoid this problem, you can follow the pattern called Post/Redirect/Get. In this pattern, you receive a 
POST request, process it, and then redirect the browser so that a GET request is made by the browser for 
another URL. GET requests should not modify the state of your application, so any inadvertent 
resubmissions of this request won’t cause any problems.

Issue: Cannot use $("#myform").validate({ rules: ..., messages:..., ...}); to add validation objects.

 (閱讀全文)
webPages:enabled with value false prevents .cshtml or .vbhtml files in the Views folder from being directly accessible from a web browser.
RSVP 是法文 "repondez s'il vous plait" 的縮寫,意思是:請回應("please respond".)
public static bool PublicInstancePropertiesEqual(
                        T self, T to, params string[] ignore
                    ) where T : class
{
    if (self != null && to != null)
    {
        Type type = typeof(T);
        List ignoreList = new List(ignore);
        foreach (System.Reflection.PropertyInfo pi in 
            type.GetProperties(System.Reflection.BindingFlags.Public | 
                               System.Reflection.BindingFlags.Instance))
        {
            if (!ignoreList.Contains(pi.Name))
            {
                object selfValue = type.GetProperty(pi.Name).GetValue(self, null);
                object toValue = type.GetProperty(pi.Name).GetValue(to, null);
                if (selfValue != toValue && (selfValue == null || 
                                             !selfValue.Equals(toValue)))
                {
                    return false;
                }
            }
        }
        return true;
    }
    return self == to;
}

The checked keyword is used to control the overflow-checking context for integral-type arithmetic operations and conversions. It can be used as an operator or a statement according to the following forms.

The unchecked keyword is used to control the overflow-checking context for integral-type arithmetic operations and conversions. It can be used as an operator or a statement according to the following forms.

checked/unchecked(expression)

Or

checked/unchecked {} 

Before do SaveChanges(), set entry to modified state as follows:

DbContext.Entry(<item>).State = System.Data.EntityState.Modified; 

Or

DbContext .Entry(<item>).CurrentValues.SetValues(<newitem>); 

As title. It does this only  for “simple” types, such as  int ,  string,  DateTime , and so on.