开发者

ASP.NET MVC: Return Control via controller for ajax call

Explanation of scenario:

I have a jquery window that will load up with a map control. This map control is a shared control in an asp.net MVC application. The way I've been told by Jquery developers is to use a $('').load(''); function to call into a controller which returns the control. Is this the best way? If so, how do i use the controller to return the control and in what format do i return it.

If开发者_开发问答 this way is not right, could you please suggest an alternate way with tutorials to accomplish this please.

Thanks.


Just create partial view containing this control and define action:

public PartialViewResult MapControl(params)
{
    //Prepare model
    return PartialView("PartialViewName", model);
}

Then you can use jQuery.load() method. How does this control work?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜