umbraco note-MVC
2015-05-22 09:42
393 查看
SurfaceController
1.Creating an action to partake in a Child Action Macro. To define this is very simple and follows
the exact same MVC principles to creating a Child Action...just add a ChildActionOnlyAttribute to your
action method.
[ChildActionOnly]
public ActionResult DisplayTwitterFeed()
2.Creating a child action to simply be used as a normal MVC child action which get rendered using
@Html.Action or @Html.RenderAction.
3.Create an action to handle some posted form data:
[httpPost]
public ActionResult HandleMyFormSubmission(MyFormModel model)
4.Maybe you'd like to track all links clicked on your page. you could use jquery to update all of your
links on your page to point to your custom action URL with the real URL as a query string. Then your
custom action will log the real link address and redirect the user to where they want to go.
--------------------------------------------------------------------------------------
// e.g. if modelstate is invalid
return CurrentUmbracoPage();
// redirecting back to original page after a successful post
return RedirectToCurrentUmbracoPage();
// Redirecting to another page after a successful post
return RedirectToUmbracoPage(12345)
1.Creating an action to partake in a Child Action Macro. To define this is very simple and follows
the exact same MVC principles to creating a Child Action...just add a ChildActionOnlyAttribute to your
action method.
[ChildActionOnly]
public ActionResult DisplayTwitterFeed()
2.Creating a child action to simply be used as a normal MVC child action which get rendered using
@Html.Action or @Html.RenderAction.
3.Create an action to handle some posted form data:
[httpPost]
public ActionResult HandleMyFormSubmission(MyFormModel model)
4.Maybe you'd like to track all links clicked on your page. you could use jquery to update all of your
links on your page to point to your custom action URL with the real URL as a query string. Then your
custom action will log the real link address and redirect the user to where they want to go.
--------------------------------------------------------------------------------------
// e.g. if modelstate is invalid
return CurrentUmbracoPage();
// redirecting back to original page after a successful post
return RedirectToCurrentUmbracoPage();
// Redirecting to another page after a successful post
return RedirectToUmbracoPage(12345)
相关文章推荐
- Note on <Pro ASP.NET MVC 4> - 01
- SpringMVC + summernote 删除图片时移除本地资源文件(3)
- umbraco mvc角度看问题
- [Phalcon-framework] Phalcon framework - Dependency Injection/Service Location And the MVC architecture note 1
- mynote springMVC拦截器配置
- ASP.NET MVC (Umbraco)中如何设置网站超时自动退出
- ASP.NET MVC Note1
- ASP.MVC-NOTE
- [Study Note] Maintainable MVC Series
- <Professional ASP.NET MVC 5> - Note 01
- <Professional ASP.NET MVC 5> - Note 02
- SpringMVC + summernote 重写回调函数onImageUpload方法(2)
- Asp.Net MVC 路由引擎 Routing
- MVC,Android体系结构,常用设计模式
- Top JavaScript MVC Frameworks
- 系列文章--从零开始学习ASP.NET MVC 1.0
- 信息发布系统 Jquery+MVC架构开发(9)view2
- SpringMVC 的<mvc:resources>使用映射路径展示文件服务器上的图片
- Jquery的bootstrap在线文本编辑器插件Summernote
- MVC中访问路径