开发者

ASP .net MVC - Master page

I am new to MVC. Where to write C# code to common functionalis开发者_运维问答ts that is comming under master page(Eg: Login)?


Create partial *.ascx view for login in shared folder and add it to master page like this:

<% Html.RenderPartial("LoginUserControl"); %>


Html.RenderAction() / Html.Action(), which do not require a Model to be passed. That is, what @x2 suggested is OK if the control is not dependent on any model, but if it is, use one of the above methods.

See: The difference between Html.Action and Html.RenderAction

And: http://haacked.com/archive/2009/11/18/aspnetmvc2-render-action.aspx

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜