Email: info@zenconix.com

Durandal JS for aspx page

Published on: 01/30/14 6:35 PM

Category:Code SPA Tags: ,

Hello all,

In last post we have seen what can be possibilities for single page application here

Today I have face very complex problem. Actually its a little one, but because of less documentation on the internet and no reference it was quite difficult to solve. But after some study of framework, I got the solution

I have created some demos with Durandal framework. Its having some different folder structure and some different configuration but with demo  or starter kit of its, you will get to know its work with HTML and js very will but my requirement was, it should run with aspx page too. Means I want aspx page as view for that I could not find solution on internet and api documentation of the framework too.

But I have find solution

What I done is, I have made some changes in the framework itself It having one js file named viewEngine.js. The viewEngine module provides information to the view Locator module which is used to locate the view’s source file. The viewEngine also transforms a view id into a view instance.

It just parse the HTML and if it found any other file, then it use parseHTML function of jquery

but It take default extension as .html so I have change the default extension to .aspx so it will only render aspx pages.

Note: If you are following started kit of Durandal, and made changes as I mention above then you also need to change the file extension of shell.html to shell.aspx because by above changes it will just render aspx files not html files as view

Enjoy, Have a great day ahead

 

 


0 thoughts on "Durandal JS for aspx page"

  • Peter says:

    Hi Prasad

    Thanks for your post above. I am curious does this really work? what i mean is will the server process the ASPX page properly? I have a similar problem where i would like to use Durandal however i have 1 ASPX user control that is quite complex that i would like to keep – the question is will the control work properly on the aspx page? so if i route to my aspx page will the server process the aspx part of the control?

    Thanks

    Peter

  • Amit says:

    so suppose we build everything in this framework then it means entire source code is available to be downloaded by anyone? is not that really great for security??..

    • Hi Amit.
      Actually Duradal is Javascript framework. So in javascript, everything is visible. So every client side code is visible to user not server side code. Also you can implement XSS and XST to add security to your project.

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts

How Angular Application starts?

In this post we are going to take look on how angular application starts. For any angular application, entry point is index.html. In index.html file there is tag called as <app-root> In main.ts file <app-root> selector is picked up by the AppModule. Below is code snippet from main.ts file AppModule is module which is bootstrapped […]

Learn C# – Namespaces

What is Namespaces in C#? C# Programs are organized using namespaces. Namespaces are used to add separation of Code in C#. Namespaces can have following members inside it. Namespaces (nested) Classes Interface Delegates Structures Why to use Namespaces? Code Separation: With help of Namespaces, you can separate out set of code in C# Project.Example: if […]

Steps by step procedure to connect the database to Lumen

Create database in phpmyadmin Open .env file. NOTE: if .env file is with name, .env.sample, then rename it to .env Change following parameter in file DB_DATABASE=lumen DB_USERNAME=root DB_PASSWORD= Also check for following parameters if they are different than default setting DB_HOST=127.0.0.1 DB_PORT=3306 Next, as we are going to use Eloquent ORM, we need to un-comment […]