Perfect WCF Ria services login function (10)

Source: Internet
Author: User

No time has been spent studying silverlighit Ria services. I always think this seriesArticleThere is no value yet. Cool has always been a perfect place for Ria services. That is, its login function, which has been written before, can also run normally. But .. Many database management systems have developed essential user group permissions, so today we provide a complete Silverlight Ria services login example. We hope that our friends who use Ria services can better use it.

In this example,CodeIs quite simple. I mainly mention two points:

1. Define the following configuration information in the web. config file of the web project:

<System. Web>

<Rolemanager enabled = "true" defaultprovider = "myroleprovider">
<Providers>
<Add name = "myroleprovider" type = "slriaservicerose. Web. myroleprovider"/>
</Providers>
</Rolemanager>
</System. Web>

2. In the app. XAML. CS file of Silverlight. Instantiate webcontent into the app

Public app ()
{
Initializecomponent ();

Webcontext = new webcontext ();
Webcontext. Authentication = new formsauthentication ();
This. applicationlifetimeobjects. Add (webcontext );
}

The Code of other parts is relatively easy to understand.

PS: After logging in, you can download the source project file from the attachment in this article.

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.