Webpart usage Problems

Source: Internet
Author: User
Download the webpart demo from Microsoft webcast.
After reading the video, I did it myself. When using dropdownlist to change the displaymode of webpartmanage,
The following error occurs:

"/Demowebpart" Application Program Server error.

This page currently disables the specified display mode. Make sure that personalized settings are enabled for the current user.
Parameter Name: Value

Note:An error occurred while executing the current Web request. Check the stack trace information to learn about this error andCodeDetailed information about the cause of the error.

Exception details:System. argumentexception: This page currently disables the specified display mode. Make sure that personalized settings are enabled for the current user.
Parameter Name: Value

Source error:

Row 26: break; Row 27: Case "D": row 28: webpartmanager1.displaymode = webpartmanager. designdisplaymode; row 29: break; row 30: Case "B ":

Source file:E: \ demowebpart \ default. aspx. CSRow:28

Open the downloaded demo with vs2005 and run it after modifying the database connection of Web. config. The same error is reported, which was found at Google,
One person has encountered such a problem, but no one can solve it after it is sent. I want to send it to the garden to see if any of my friends have met and solved it.

The error code returned when running is as follows (in red ):

Protected void dropdownlistincluselectedindexchanged (Object sender, eventargs E)
{
Switch (dropdownlist1.selectedvalue)
{
Case "C ":
Webpartmanager1.displaymode = webpartmanager. catalogdisplaymode ;
Break;
Case "E ":
Webpartmanager1.displaymode = webpartmanager. editdisplaymode;
Break;
Case "D ":
Webpartmanager1.displaymode = webpartmanager. designdisplaymode;
Break;
Case "B ":
Webpartmanager1.displaymode = webpartmanager. browsedisplaymode;
Break;
Default:
Webpartmanager1.displaymode = webpartmanager. browsedisplaymode;
Break;
}
}
Appendix: Demo http://files.cnblogs.com/szflying/DemoWebPart.rar downloaded from webcast

 

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.