Microsoft KB Archive/174687

= How To Creating Personalized Channels using ASP =

Article ID: 174687

Article Last Modified on 5/11/2006

-

APPLIES TO


 * Microsoft Internet Explorer 4.0 128-Bit Edition
 * Microsoft Internet Explorer 4.01 Service Pack 2
 * Microsoft Internet Explorer 5.0

-



This article was previously published under Q174687



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:

  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.  Microsoft Custom Subscription List

 Microsoft Custom Product Subscription List Subscribe to your favorite Microsoft Internet product/s below to get the latest product information and access to support:

   Internet Explorer Internet Client SDK </Pre> </FONT>

<input Type=SUBMIT Value="Subscribe" Name="Validate" > </FORM> </HTML> </li> <li> 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"> 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"> IE4</TITLE> <ABSTRACT>IE4 Product Page</ABSTRACT> <WWITEM HREF="http://www.microsoft.com/iesupport"> IE4 Support Page</TITLE> <ABSTRACT>This is where you can get all your questions on          IE4 answered. :)</ABSTRACT>      </WWITEM>    </CHANNEL> <% End if %>

<% If Not InetSDK = 0 Then %> <CHANNEL HREF="http://www.microsoft.com/workshop/prog/inetsdk"> Internet Client SDK</TITLE> <ABSTRACT>Internet Client SDK Product Page</ABSTRACT> <WWITEM HREF="http://www.microsoft.com/support/inetsdk"> Internet Client SDK Support Page</TITLE> <ABSTRACT>This is where you can get all your questions on          IE4 programmability answered. :)</ABSTRACT>       </WWITEM>    </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. </li> <li>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://%3Cserver 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.)</li> <li>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.)</li></ol>

<div class="references_section">