Last post Aug 07, 2019 06:25 PM by dpant
Aug 07, 2019 06:25 PM|dpant|LINK
For those of you interested in taking a journey back to the future, here is how you can enable the
XML Script declarative language in a modern ASP.NET web application project.
My working setup is Windows 10, Visual Studio Community 2017 and the project is a ASP.NET Application (.NET Framework) using the default
Web Forms project template.
To have the browser understand the xml-script type you have to reference the
PreviewScript.js file in the ScriptManager control. This file is embedded as a web resource in the
Microsoft.Web.Preview assembly. Interestingly enough, the assembly can still be downloaded officially from Microsoft as part of the
Microsoft ASP.NET Futures (May 2007) package. In turn, this package requires
ASP.NET AJAX Extensions 1.0 which is available from Microsoft, too.
After having installed ASP.NET AJAX Extensions 1.0 and ASP.NET Futures (in that order) add a reference to
Microsoft.Web.Preview in your project (right click References -> Add reference -> Assemblies -> search for Microsoft.Web.Preview and check it).
Then, in your master page you can add the following reference in the ScriptManager control:
<asp:ScriptReference Name="PreviewScript.js" Assembly="Microsoft.Web.Preview" />
And then in your content web page you can use xml-script declarations, for example:
<application load="page_load" />
And that was it! Have fun.