So it is a Single-Page Application without History and without Back button?
That is pretty nothing
I want Gmail style where you get url updated when you query https://mail.google.com/mail/ca/u/0/?ui=2&shva=1#search/test
you can load individual items via Ajax https://mail.google.com/mail/ca/u/0/?ui=2&shva=1#inbox/13bvdf5c8ecd11b6 and click Back button
If you reload you should have a javascript handler which processes the url after hash and decides which Ajax method to call. Whithout all this it is a school level application
Thanks, I actually changed a little the Internet template - I load all views as partial views via ajax.
$(window).bind('hashchange', function (e) {
var hash = parent.location.hash.replace("#", "");
if (hash) {
$.ajax({
url: "/Home/" + hash,
success: function (result) {
$('#container').html(result);
}
});
}
});
And use this type of links
|<a href="#task">Back to List</a>
That gives me advantage of scaffolding. Seems enough, the only problem, I need to put all controller methods into HomeController and all views into Views/Home/ Any better idea?
But it seems better idea then using hundreds of lines of mannual javascript which I saw in SPA Template:
todoList.js +
todoList.bindings.js +
todoList.dataAccess.js = 250 lines for a simple ToDo task. And yet without history
chaoren
Member
11 Points
36 Posts
Single-Page Application
Nov 23, 2012 06:34 AM|LINK
What happened with Single-Page Application? Seems like all is down:
http://www.asp.net/single-page-application/an-introduction-to-spa/downloads is empty
http://blog.stevensanderson.com/2012/03/06/single-page-application-packages-and-samples/ is not working
http://www.johnpapa.net/spa/ sample is down
What is the current state and what will be next steps?
XIII
All-Star
182789 Points
23485 Posts
ASPInsiders
Moderator
MVP
Re: Single-Page Application
Nov 23, 2012 07:24 AM|LINK
Hi,
if you install the Visual Studio 2012 Fall update: http://www.asp.net/vnext/overview/fall-2012-update/aspnet-fall-2012-update-release-notes#_New_Templates, then you'll notice the new template called Single Page Application. In the videos of BUILD 2012 they'll show the demo with a todo list application as well.
Grz, Kris.
Interested in Azure, ASP.NET (MVC), jQuery, WCF, EF, MS SQL, ...
Keep the forums clean: report to the moderation team!
chaoren
Member
11 Points
36 Posts
Re: Single-Page Application
Nov 23, 2012 10:23 AM|LINK
Thanks, got it
So it is a Single-Page Application without History and without Back button?
That is pretty nothing
I want Gmail style where you get url updated when you query https://mail.google.com/mail/ca/u/0/?ui=2&shva=1#search/test you can load individual items via Ajax https://mail.google.com/mail/ca/u/0/?ui=2&shva=1#inbox/13bvdf5c8ecd11b6 and click Back button
If you reload you should have a javascript handler which processes the url after hash and decides which Ajax method to call. Whithout all this it is a school level application
XIII
All-Star
182789 Points
23485 Posts
ASPInsiders
Moderator
MVP
Re: Single-Page Application
Nov 26, 2012 09:18 AM|LINK
Hi,
you could try to go for sammy.js or history.js.
Grz, Kris.
Interested in Azure, ASP.NET (MVC), jQuery, WCF, EF, MS SQL, ...
Keep the forums clean: report to the moderation team!
chaoren
Member
11 Points
36 Posts
Re: Single-Page Application
Nov 26, 2012 11:03 AM|LINK
Thanks, I actually changed a little the Internet template - I load all views as partial views via ajax.
$(window).bind('hashchange', function (e) {
var hash = parent.location.hash.replace("#", "");
if (hash) {
$.ajax({
url: "/Home/" + hash,
success: function (result) {
$('#container').html(result);
}
});
}
});
And use this type of links
|<a href="#task">Back to List</a>
That gives me advantage of scaffolding. Seems enough, the only problem, I need to put all controller methods into HomeController and all views into Views/Home/ Any better idea?
But it seems better idea then using hundreds of lines of mannual javascript which I saw in SPA Template:
todoList.js +
todoList.bindings.js +
todoList.dataAccess.js = 250 lines for a simple ToDo task. And yet without history