Start today, to do web, of course, it is necessary to start learning PETSHOP
First, install
The two types of SQL Server are required during the installation process, which will not be introduced. After entering, playing VS, and opens the project project of PETSHOP, and the luck prompt is as follows:
? / Mspetshop ?????????????
?? 'NT authority / network service' ?????
Solution
Step 1: Add 'NT Authority / Network Service' in the Administrator group
My computer -> Right button -> Management -> Local User and Group
Select "Group" -> Double-click Administrators -> Click Add "-> Click" Advanced "-> Click" Immediately "-> Select NetWork Service Users in the list below -> Two Click OK -> Join.
Step 2 Add to Network Service User in Enterprise Manager
Open SQL Server Enterprise Manager -> Select Database Instance -> Open "Security" Node -> Select "Log in" -> Click Right-click in the list -> Select New Login -> In the "General" tab, click the button "..." -> Select "Administrators" Group -> Click the "Member" button below -> Select "Network Service" -> Click Add button -> Click OK to return to "New Login" dialog -> Guaranteed the authentication type "Windows Verification" and "Allow Access" -> Click "OK" -> Close "Enterprise Manager"
Forgot important, add Mspetshop's access to these two DBs
third step
Run the ASP.NET program, the database connection string selects Windows authentication.
Solve it? Not good? Still honest, look at the book <<. NET program design technology insider >>
Well, I'm looking for a Web security topic.
ASP.NET verifies the legality of the requester after issuing a request to determine if this request is legal
Three kinds of verification
1. Windows verification: asp.net seeks help to IIS. After IIS is verified by the caller authentication, tell ASP.NET's identity of the caller. Of course, this verification result will pass each request. This verification occasion is mostly internal, and the fundamental goal of Windows verification is to map incoming requests to user accounts for web servers, allowing the use of OS built-in security mechanisms. To protect files and other resource files that are not illegally accessed by users who have not been granted
2. Passport Verification: Relying on the MS PASSPORT to verify the user's identity, the best example is MSN, more case everyone still downloads Passport SDK, MS website
3. Form verification: This is the login form in the web page to verify the user. For example, the login form of our general website
doubt? So how to let Asp.net know which type of verification I want, Oh, in the web.config file,
Find
Other Mode values have None, Windows, Passport
Ok, the problem is solved, these questions will not be said, or it is another chapter.
Open Default.aspx and find some statements that have not been seen
<% @ Page language = "c #" autoeventwireup = "false" enablesessionState = "readonly"%> <% @ register tagprefix = "petscontrol" tagname = "banner" src = "controls / banner.ascx"%>
<% @ Register tagprefix = "petscontrol" tagname = "navbarnomenu" src = "controls / navbarnomenu.ascx"%>
Ok, explain it.
The AutoeventWireUp property of the Page instruction is set to true (or if this property is missing, because it is true for true), the page frame will automatically call the page event, which is page_init and page_load method. In this case, no explicit Handles clause or delegate is required.
Obviously, in this page, just a pure static page, does not need to load the page event, so it can be false,
The explanation of MSDN is as follows
EnableSessionState Specifies whether a session status is enabled. True Indicates that the session status is enabled. False Indicates that the session status is not enabled. Readonly Specifies that the application can read but cannot modify the session state variable.
Third line <% @ register tagprefix = "petscontrol" tagname = "navbarnomenu" src = "controls / navbarnomenu.ascx"%>
Tagprefix
Alias associated with namespace.
TAGNAME
Alias associated with the class.
Namespace
Namespace associated with tagprefix.
SRC
With TagPRefix: Tagname to associate the location of the declarative user control file (relative or absolute).
AskSEMBLY
The assembly set to the namespace associated with TagPRefix.
Note that the assembly name does not include a file extension.
I know some of the concepts today, continue tomorrow.