fokisaver.blogg.se

Weather web slices
Weather web slices













  1. Weather web slices how to#
  2. Weather web slices install#
  3. Weather web slices full#
  4. Weather web slices password#

In this sample, we will use ASP.NET Membership to store the user credentials. DEMO 2 - Using cookies to store user credentials (ASP.NET Membership)Ĭookie-based authentication is flexible and easy to implement however, you should not save any sensitive information (for example, username and password) in plain text in order to avoid security prompts.ĭownload source code: FormsAuthentication.zip

Weather web slices how to#

The next scenario demonstrates how to save sensitive information more securely.

Weather web slices full#

You have full control over cookies from the Web Slice code however, you should avoid storing username and passwords in plain text inside a cookies, as cookies can be easily modified or attached from a malicious user. WebSlice_StoringProfile.Style = color įigure 3: Reading profile from the Web Slice The background color of the Web Slice is set by : protected void Page_Load(object sender, EventArgs e)

  • Render the HTML snippet dynamically (as in Figure 3).
  • Load the content from the display source.
  • When the user selects a color from the drop-down list on the main page (Figure 2), ASP.NET will save the user preference inside a cookie with an expiration time of 31 days with the following code in : protected void ddlColors_SelectedIndexChanged(object sender, EventArgs e)Īs soon as the user adds the Web Slice to Internet Explorer 8, ASP.NET will:

    weather web slices

    The ProfileProvider class simplifies the interaction with the CookieHelper class by providing two methods: GetColor and SaveColor. The CookieHelper class (Figure 1) encapsulates these actions to allow you to more easily read, write, and delete cookies. Likewise, to delete a cookie, subtract a year from its expiration date.

    weather web slices

    In order to make a cookie persistent across different browser sessions, you need to specify the cookie's expiration, such as: public static void WriteCookie(HttpCookie cookie)Ĭookie.Expires = (31)

  • CookieHelper.cs simplifies the process of storing and retrieving values from a cookie.
  • ProfileProvider.cs defines a custom class that reads and writes the color value to the user's profile (in this case, a cookie).
  • DisplayWebSlice.ascx renders the Web Slice content by reading the cookie and setting the background color.
  • DisplayPage.aspx is the alternative display source for the Web Slice.
  • WebSlice.ascx represents the drop-down control used to select a color.
  • Default.aspx is the page loaded by the browser.
  • weather web slices

    Although this demo has been built by using ASP.NET 3.5, you can adapt this concept to any other Web technology or language. This allows us to render different content in the Web Slice preview window. The Web Slice in this demo uses an alternative display view. For more information, please refer to ASP.NET Cookies Overview overview. In this sample we use cookies to store the user profile in the Web site and later retrieve the same information from within the Web Slice. You can use cookies to store non-sensitive information, user preferences, Web Slice settings, and so on. Visual Studio Web Developer 2008 Express EditionĭEMO 1 - Using cookies to store user profileĬookie-based authentication is broadly supported and works regardless of the security settings of the Web Slice.

    Weather web slices install#

    In order to run and build the samples, you will need to install one or more of the following: You will find three different demos attached to this article, one for each of these scenarios. Web Slices in Internet Explorer 8 can authenticate to their Web site using any of the following:

    Weather web slices password#

    For example, a Web Slice could automatically supply a username and password in order to retrieve email from a Web server. Many scenarios require some sort of security layer to authenticate the user by remembering credentials across different browsing sessions, a Web Slice becomes more user-friendly. Web Slices can leverage some of the security features of a standard Web page or Really Simple Syndication (RSS) feed.

  • DEMO 3 - Using HTTPS+Digest on IIS to secure the Web Slice.
  • DEMO 2 - Using cookies to store user credentials (ASP.NET Membership).
  • DEMO 1 - Using cookies to store user profile.
  • This topic contains the following sections: This topic covers the security model of Web Slices and includes samples of authenticated scenarios in ASP.NET.

    weather web slices

    To learn how to create Web Slices, refer to Subscribing to Content with Web Slices. Web Slices allow you to subscribe to parts of a Web page and view updates directly from the Internet Explorer Favorites bar.















    Weather web slices