In-depth analysis of Portal Starter source code (1)

Source: Internet
Author: User
Tags microsoft website
In-depth analysis of Portal Starter source code (1)
Learning ASP.net does not work. It is helpful to read some classic source code.
Find several examples on the Microsoft website. Select the Portal because the example is the largest and can be used as a simple Portal.
Portal workflow:
1. Read the website settings file PortalCfg. xml and cache it in context. This process is completed by the Application_BeginRequest () event in Global. asax.
2. When the customer accesses the Portal, execute Default. aspx and Default. aspx to determine whether the client is Mobile or a browser. If the client is the latter, direct the customer to topdefault. aspx.
3. DesktopDefault. aspx completes the presentation of each topic on the website and the loading of corresponding modules in each topic.
Analyze the Application_BeginRequest () event in Global. asax:
Sub Application_BeginRequest (ByVal sender As Object, ByVal e As EventArgs)
'Default homepage access
Dim tabIndex As Integer = 0
Dim tabId As Integer = 1
'Get TabIndex from querystring
If Not (Request. Params ("tabindex") Is Nothing) Then
TabIndex = CInt (Request. Params ("tabindex "))
End If
'Get TabID from querystring
If Not (Request. Params ("tabid") Is Nothing) Then
TabId = CInt (Request. Params ("tabid "))
End If
'Add the PortalSettings object to the context
'Portalsetting is defined in ComponentsConfiguration. vb. It is used to load the elements of corresponding columns according to the imported tabIndex and tabId.
'Context is used to cache the settings of corresponding columns.
Context. Items. Add ("PortalSettings", New PortalSettings (tabIndex, tabId ))
'Read the configuration info from the XML file or retrieve from Cache
'And add to the context
The 'configuration class is defined in ComponentsConfiguration. Its function is to operate the PortalCfg. xml file of the Portal website.
'Cache the setting file to the Context so that any part of the website can access these settings.
Dim config As Configuration = New Configuration ()

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.