views:

159

answers:

2

Using the instructions from Paul Johnson's Web Widgets page I created my own custom widget. However because I was deploying to IIS 6.0 I utilized the web.config change recommended to render the page since the IIS 7.0 configuration management option was not available in IIS 6.0.

The widget renders correctly when debugging with VS 2008. However once the files and the updated web.config are deployed to the Windows 2003 Server running IIS 6.0 and the address referenced the error rendered is "The page cannot be found".

The development machine is a Windows Vista machine, however since VS 2008 uses its own internal web server and not Vista's IIS 7.0 for debugging I did not believe this would have been an issue.

Any help debugging this issue would be much appreciated.

+2  A: 

His instructions are incomplete. You will also need to add a script mapping in the application configuration for .jss to the aspnet_isapi.dll in windows\microsoft.NET\framework\vXXXX\ directory.

IIS6 doesn't do the intergrated pipeline that is intrinsic to Cassini and is default in IIS7.

Edit: Details

  • In IIS manager open application properties.
  • Select Home Directory tab
  • Click Configuration...
  • Select entry in mappings list for .aspx, click Edit...
  • Highlight and copy contents of Executable text box, click Cancel
  • Click Add...
  • Paste into Executable text box
  • Enter .jss in Extension text box
  • Enter GET. HEAD in Limit to: box
  • You might need to disable Verify that file exists

Ok that lot out.

Now a URL that has the extension .jss will be handed over to ASP.NET for handling.

AnthonyWJones
A: 

A couple of other changes I had to make...

Config change (handler should map to EventsWidget, not WidgetBase):

<system.web>
<httpHandlers>
<add verb="GET,HEAD" path="eventswidget.jss" type="Demo1.Handlers.EventsWidget, Demo1" validate="false" />
</httpHandlers>
</system.web>

EventsWidget.BuildOutput should return Javascript (depending on how you set the 'script' tag in Default.aspx):

Public Overrides Function BuildOutput() As String
    Dim sOutput As String = "document.write('<br><b>Hello World</b>');"
    Return sOutput
End Function
MattH