HOWTO: Creating Personalized Channels using ASP

ID: Q174687


The information in this article applies to:
  • Microsoft Internet Explorer (Programming) versions 5.0, 4.0, 4.01


SUMMARY

Internet Explorer 4.0 introduces the concept of Active Channels as a means to deliver personalized and up-to-date information to subscribed users, through the use of Channel Definition Format (CDF) files. Using Active Server Pages (ASP) with Microsoft Internet Information Server (IIS), a content provider on the Internet can dynamically generate a custom CDF file to deliver personalized information to users, based on user preferences. This article discusses a sample scenario where a personalized channel could be used using ASP, including the details of implementation.


MORE INFORMATION

A software company could provide an active channel that will allow users to receive the latest information on software products, including support information on these products. In order to be effective, a personalized channel could be employed so that a user gets information only on products he or she is interested in, not every product manufactured by that company.

The following are the steps to illustrate how a software company, such as Microsoft, could create a personalized channel for this purpose, using ASP:

  1. First create an .htm page that will allow users to select the Microsoft products they would be interested in getting information on. (For simplicity, this example includes only two of the major Microsoft products currently available.) Save the file as Products.htm.

    Note that this .htm page includes a FORM, with a Subscribe button that, when clicked, invokes the file Gencdf.asp, which you will create in step 2.
    
    <HTML>
       <TITLE>Microsoft Custom Subscription List</TITLE>
    
       <FONT FACE="VERDANA,ARIAL,HELVETICA" SIZE="2">
       <H1>Microsoft Custom Product Subscription List</H1>
    Subscribe to your favorite Microsoft Internet product/s below
    to get the latest product information and access to support:
    
    <FONT FACE="courier" SIZE="3">
    <PRE>
      <FORM METHOD="GET" ACTION="GenCDF.asp">
      <input Type="checkbox" Name="IE4"     VALUE="1">Internet Explorer
      <input Type="checkbox" Name="InetSDK" VALUE="1">Internet Client SDK
    </Pre>
    </FONT>
    
    <input Type=SUBMIT Value="Subscribe" Name="Validate" >
    </FORM>
    </HTML> 


  2. Create the .asp file that uses the information generated from Products.htm above to dynamically generate the personalized CDF file. Save this file as Gencdf.asp.
    
     <%@ LANGUAGE=VBScript %>
     <%
        IE4     = Request ("IE4")
        InetSDK = Request ("InetSDK")
     %>
    
     <% Response.ContentType = "application/x-cdf" %>
    
     <?XML VERSION="1.0"?>
     <CHANNEL HREF="http://www.microsoft.com">
        <TITLE>Sample MS Custom Channel</TITLE>
        <ABSTRACT>Demo Channel on how to get a customized subscription
         using ASPs</ABSTRACT>
    
        <SCHEDULE>
           <INTERVALTIME DAY ="1" />
           <EARLIESTTIME HOUR="1" />
           <LATESTTIME   HOUR="5" />
        </SCHEDULE>
    
     <% If Not IE4 = 0 Then %>
        <CHANNEL HREF="http://www.microsoft.com/ie/ie40">
           <TITLE>IE4</TITLE>
           <ABSTRACT>IE4 Product Page</ABSTRACT>
           <ITEM HREF="http://www.microsoft.com/iesupport">
              <TITLE>IE4 Support Page</TITLE>
              <ABSTRACT>This is where you can get all your questions on
               IE4 answered. :)</ABSTRACT>
           </ITEM>
        </CHANNEL>
     <% End if %>
    
     <% If Not InetSDK = 0 Then %>
        <CHANNEL HREF="http://www.microsoft.com/workshop/prog/inetsdk">
           <TITLE>Internet Client SDK</TITLE>
           <ABSTRACT>Internet Client SDK Product Page</ABSTRACT>
           <ITEM HREF="http://www.microsoft.com/support/inetsdk">
              <TITLE>Internet Client SDK Support Page</TITLE>
              <ABSTRACT>This is where you can get all your questions on
               IE4 programmability answered. :)</ABSTRACT>
            </ITEM>
        </CHANNEL>
     <% End if %>
     </CHANNEL> 
    CDF files that are dynamically generated through Active Server Pages should have the following line inserted at the top of the CDF file (before any CDF lines):
    
          <% Response.ContentType = "application/x-cdf" %> 
    This ensures that servers return the MIME/content type "application/x-cdf." Problems with CDF files being displayed inside the browser as HTML text rather than presenting a subscription wizard are very likely caused by the server returning an incorrect MIME type of "text/html." Note: As an alternative for IIS 4.0 site authors, the CDF file can be created with a .cdx extension instead of .asp, and the MIME content type line above can be omitted. For simplicity, the <LOGO> tags have been omitted in the sample CDF file. As a result, the default satellite dish logo is displayed in the desktop channel bar and in the channel pane.


  3. To try it, put these two files (Products.htm and Gencdf.asp) on the same directory on an IIS Server. From the Internet Explorer address bar, type in the http address to Products.htm (http://<server location>/Products.htm), and select the products you're interested in. (Note that simply clicking on Products.htm from Windows Explorer--that is, launching the file locally--will not work, as this will cause the GenCDF.ASP to get launched using the file protocol which does not work for ASP files.)


  4. Click Subscribe. This should launch the "Add Channel" wizard. If all is well, you should see the "Sample MS Custom Channel" appear on the channel pane, as well as at the bottom of the desktop channel bar. Clicking on the "Sample MS Custom Channel" from the desktop channel bar should bring up the Microsoft home page, as well as subchannels for the selected products. (If no products were selected, no subchannels should appear.)



REFERENCES

"Creating Active Channels" section of the Internet Client SDK documentation CDF Reference in the Internet Client SDK documentation

For more information, please see the MSDN Web Workshop:

http://msdn.microsoft.com/workshop/default.asp

Additional query words:

Keywords : kbChannels kbIE400 kbIE401 kbIE500 kbDSupport InetSDKInfoDev
Version : WINDOWS:4.0,4.01,5.0
Platform : WINDOWS
Issue type : kbhowto


Last Reviewed: July 23, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.