asp.net mvc 2 - another approach to returning some thing to browser in mvc with ajax call instead of using response.write -


I have my MVC 2.0 project, which processes something and after each, some messages (string) Returns. To write(). And this message returned to the browser with a bad format. I want to return a message to a specific HTML device and add everyone to the end of the contents of the Div Tag. How does this happen now?

After this incident everyone picked up and brought back the message in the browser.

  Public Zero onProgressEvent (System.Object source, CustomEventArgs customEventArgs) {if (customEventArgs. Level> 5) {Response.Write (customEventArgs.Message + "& lt; br / & gt; ; "); Response.Flush (); }}  

jQuery Your friend is here if you have an action call to an AJAX If you make a call, you can either return Jason object or partial view.

My priority is to return a partial view and as a result the contents of the divisor have to be changed.

Therefore; Public workspace jQueryTagDelete (string SomeParametersMaybe) {return partial view ("tag list", tag .orderbie (x = & gt; x.keyword1)); }

and you have jquery code; deleteTag (tagName) {$ .post ("/ admin / jQueryTagDelete", {tag: tagName} function (RETURNED_HTML) {document.getElementById ("divTags"). InnerHTML = RETURNED_HTML; }); }


Comments