The first Web parts page

Source: Internet
Author: User

The following blog posts will introduce Web parts,

First, let's explain the functions of Web parts,

Web parts is an integrated set of controls,

Users can use Web parts and personalized mechanisms to customize the user's own appearance or style,

That is, users can directly modify the content, appearance, and behavior of webpages,

These modifications can be applied to all users on the website or individual users, which means that,

Allows users to dynamically access web applications.ProgramIn this way, developers do not need to intervene too much,

At the same time, the user experience is greatly improved.

Here, I will explain why Web parts combined with profile personalization mechanism?

In fact, it is easy to connect, because Web parts is for individual users or group users,

You can save the settings in the database permanently,

Since it is stored in the database, it must be a data table. Since it is for individual users or group users,

The profile mentioned above is not sufficient,

Therefore, we use Web parts and the profile mechanism to implement the above functions.

At the beginning, I still don't want to introduce too much theoretical content,

As long as you understand what this Web parts is,

Then, I will show a demo, which is more conducive to your understanding of what Web parts is,

Now, let's take a look at the basic prerequisites for using Web parts,

First of all, since it is combined with profile to accomplish the large series of functions described above,

The use of the profile mechanism must depend on the background database,

The database must contain the 11 tables registered by Microsoft,

Therefore, the most basic prerequisite is that you must first use the aspnet_regsql. exe tool to register the database,

At the same time, because Web parts is intended for individual or group users,

Therefore, you must perform authentication first. You can only perform Web parts operations after authentication,

Therefore, you need to give a login. ASPX page,

The final step is to enable the forms authentication mode.

Let's take a look at a Web parts instance,

I believe you will be very interested in Web parts after reading this instance.

First, I created a. ascx user control.

(We would like to remind you that it is best to drag Web parts into the Zone in the form of user controls in the future.

Instead of directly dragging the Server Control in, this can also be done, but there are defects,

I will explain the defects later)

The user control is very simple, and an image is displayed in a table.

Then let's look at the. ASPX page.

Then I read the results (the purpose of this blog post is to briefly demonstrate the results and let everyone have a bottom)

Run this page directly. Because the verification is successful, the page will jump to the loginurl page defined in Web. config,

Then I log on with Xiaozhen

After successful logon, the system will automatically jump back to the page defined above.

Then I press the Minimize button.

Then press the restore button.

As for the close button, the same is true. We will not demonstrate it,

Then I close the browser,

In the aspnet_personalizationperuser data table of the website database that was registered at the beginning,

You will find one more record in this data table,

You can view the username Based on the userid, and you will find that it is the Xiaozhen you just logged on,

When you use Web parts, all your operations are saved in the database,

Therefore, qualified members who pass the verification will log on to the website,

The data saved by the last user is retrieved from the data table for display,

So we can open this page again and log on to Xiaozhen to test it,

You can see that the last user exited when the above image was expanded,

Therefore, this time the page has been loaded, it will also appear in an expanded form,

Of course, if you minimized this Web parts last time,

So what you see first after logging on again is a minimal Web parts,

If you disabled the Web parts last time,

So this time it will also be closed (there is nothing on the page)

As mentioned above, I even demonstrated the most basic thing about Web parts,

Let everyone have an impression on this Web parts !!!

2010-2-12

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.