javascript - Sending partial view Vs. string -
i converting webforms project mvc3 , found web method returns string represents html page like: "<div>test....</div>". later assigned division in page using javascript. doubt whether same sending partial view representing html code. or better method?
public actionresult testmethod() { return partialview("testview"); } or
public string testmethod() { string htmlcontent="<div>..</div>"; return htmlcontent; }// , populating division in view content ?
returning partialview correct method maintains separation of concerns between view , controller.
this allows pass model controller , utilise razor formatting.
Comments
Post a Comment