i am building a site. There are two choices for me.
asp.net mvc 3.0 + ajax.
build whole site with ajax(javascript). Firstly, use ajax to get data with json format, and then fill the whole page with the data. In this way, the page will be produced only via javascript.
Could anyone tell me the advantages and disadvantages of these two ways?
Thanks in advance.
Javascript is not for building entire markup and rendering it. Don't shoot yourself in the foot.
Use ASP.Net MVC to build your site. Along side of ASP.Net MVC use jQuery/javascript to build ajax functionality.
If you choose the second option, it won't work in browsers with no JavaScript support. This may not seem all that important to you, but consider: most search engines don't support JavaScript. If search engines can't get the content on your site, it won't get ranked well.
Related
I have successfully developed a simple grid using MVC 4 and kendo UI. Everything works as expected and I dont have an issue with it. The other day, I was talking to another developer who told me that I could completely bypass MVC and just use a Javascript to read from SQL Server(my data source) and call it on my HTML page. There, I could use Kendo UI helpers to display the page the way I wanted.
My question is, is that possible? And if it is possible, is it advisable? I primarily work only with databases and this is the first time I am playing with MVC, Kendo and HTML as such, so please bear with me.
Thanks for the help.
Your colleague is absolutely right. You can use the client version of Kendo UI and write jQuery code on HTML/.cshtml/aspx... files and connect to your MVC/Web API controllers or a RESTFul/HTTP service using Ajax calls. This will work like a charm.
This is advisable only if you are good with Javascript/jQuery. This method will provide better user experience and you can easily build Single Page Applications which is the future of web apps.
if you see Kendo UI demos, all the examples are built on pure HTML pages using jQuery.
I hope I answered your question clearly, but in case you need any clarifications, feel free to ask.
Now I'm working with asp.net mvc, it's good framework. But, in future, I want to work with php or ruby to develop views for my asp.net MVC site.
I am not sure what this concept is called but I know something exists.
I think, I must generate pages with clear html, javascript and use json for transfer data. What patterns I can use and how implement navigation?
Any other thing exists to do this?
Well in case if you wish to create your VIEWS for asp.net MVC site using PHP code you can opt for PHP View Engine.
It allows you to write ASP.NET MVC views in the PHP language.
http://phpviewengine.codeplex.com/ is link you can follow.
This way all your ASP.NET code for Controller And Model will be intact and you can create your views in PHP.
I hope this is what you would be looking for.
Another view engine for php is sharpy I hope this also could be one for you. On top of that I am not sure anything is there for ruby.
I want maximum unbounded from C# for quick implement on server-side
php or ruby.
Based on this comment, your only option to have server-side code return data in a standard format (like JSON) and rely heavily on client side templating to turn data into HTML.
LinkedIn had a similar problem. They had three different server side technologies and had a hard time re-using components. There is a good write-up about their experience here and a pretty through comparison of different templating technologies here.
Consider using Mustache (http://mustache.github.com/) as your view engine. It will allow both PHP, .NET and JS to consume the views and render with server-generated content. Nustache has a library for ASP.NET MVC as well to make the transition easy.
I am ASP.NET MVC to develop my application on web. This app requires a grid to display, sort, and modify the data. User can perform all crud operation using this grid and needs to hide any column as per need. I have searched a lot on internet to find any free HTML based control which fulfill this requirement but I did not find.
I just want to have a grid which fulfill the above requirement either that only based on java script or it have some dependencies on ASP.NET MVC frame work like other grids which are based on server side scripting which generates HTML on run time.
Any kind of help will be appreciated.
You may take a look at the Telerik Grid.
Here are some links that may help:
Ext Js - Javascript solution... maybe a little overkill, but tons of stuff out of the box.
Tutorial - Using CRUD Operations with jQuery igGrid, Entity Framework and ASP.Net MVC3
StackOverflow - Some more javascript solutions here.
I've currently got a service that produces xml files every 10 seconds containing server information. I'm looking for a way to display this on a web page.
I have been looking on the web for the best way to do this and it seems that using AJAX would be good as it allows the loading of dynamic content to be done in the background.
However how can i use AJAX? Should i add a ASP.NET website to my visual studio project? OR should i look to use javascript & AJAX in something like dreamweaver?
I'm very new to programming so i only really have a bit of experience in vb.net.
Any help would be much appreciated!!
I'd use an ASP.NET page and use the built-in AJAX ScriptManager and UpdatePanel controls. They are very easy to incorporate.
Also, you don't want to bombard people with Raw XML, so learn to use XSLT. I would suggest rendering it on the server using the XSLCompiledTransform. Do this on the server, as you can mix and match the ASP.NET controls and HTML server controls. I would suggest creating a <div runat="server">, place this in the UpdatePanel, and render XML via XSLT to this.
I'm not a .net developer so i don't know nothing about .net controls. But maybe you should take a look into jQuery and its ajax capabilities.
http://api.jquery.com/jQuery.ajax/
I want to use the asp.net ajax client side framework on a bare-bones HTML page. Firstly, is it possible? If yes, then can someone point me in the right direction?
Yes, it is possible. You need to include MicrosoftAjax.js and start using it. For further reference you can check the following links:
Microsoft Ajax Client Reference
Using Microsoft Ajax with PHP
In a word you need to include the file and start using the API. What exactly do you need from ASP.NET Ajax? Have you considered using jQuery instead? My experience tells that ASP.NET Ajax is suitable for ASP.NET only cases (web-forms, server controls, partial rendering etc) whereas jQuery is more close to the metal and works with all server platforms.