开发者

JSON & ASP.NET webforms

  1. Does JSON, JQuery & ASP.NET 2.0 webforms go together or is it only preferred in MVC with ASP.NET 3.5 & 4.0?
  2. While using JSON, would gridviews and repeate开发者_开发技巧rs controls be of any use (binding with JSON data) or do I format the results in custom tables myself ?
  3. Would my business object classes still be of any use while using JSON ?
  4. What is the ideal combination for JSON with ASP.NET (JQuery+ASP.NET AJAX+ JSON) ? 5.Can anyone post me a link/code snippet of simple CRUD application with JSON and ASP.NET webforms ?

Thank you.


I would really recommned you to move on to MVC, since it is far more better than ASP.NET Webforms. but still here are my answers to your questions.

  1. yes, they can easily be used together, and they will make user experience more richer than simeple ASP.Net.

  2. You can use JTemplates, Mustache script and other scripts for binding with JSON data. and you would never require GridView or Repeater control for this.

  3. yes, they would be useful to some extent. but most probably your business logic will be exposed on client side, when working with jquery, json and ajax.

  4. your data will be in JSON format, and ASP.NET will be used as backend layer. AJAX will be used to call ASP.NEt pages/handlers to fetch data from database asynchronously. adn you can use jquery for manipulating data on clientside and then display on the UI.

  5. Sorry, I could not find any such link over google. let me search more, I might find one to share with you.


a reminder:

Even the framework makes them look working in same scope, ASP .NET & javascript(jQuery, JSON) lives in thier own scopes. ASP .NET(back end) generate nothing more than html, css, javascript to browers(front end). Then, browers interpret the html, javascript, css. They don't really work together. Also, JSON is nothing fancy than a notation as its name(JavaScript Object Notation)

e.g.

code:

$("#<%= Textbox1.ClientID %>").val("mywork");

what really happens in html

$("#Textbox1").val("mywork");


  1. I've used JSON & JQuery in an ASP.NET website quite successfully. (non-MVC)

  2. You can bind JSON to ASP.NET elements, but I'm not sure it is worth the effort

  3. Do you mean .NET objects? Check out System.Web.Script.Serialization.JavaScriptSerializer

  4. You should take care not to employ too much interaction if you help it. Use JQuery for client side interaction only.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜