ASP.NET MVC中的页面重定向 [英] Page redirection in ASP.NET MVC

查看:150
本文介绍了ASP.NET MVC中的页面重定向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!

首先,我找不到合适的类别来发布此内容.请帮助我找到一个:D

问题:

请考虑以下情形.

您有一个实体的编辑"操作(GET和POST),该实体有多个页面链接到该实体(获取编辑").返回链接到编辑操作的页面的最佳方法是什么?在查询中添加回发网址?

例如,在MyCart/3中,我们有一个编辑产品链接
/Product/Edit/5?postbackTo = MyCart/3  (但使用URL编码)

从Producer/45开始,我们有此链接
/Product/Edit/5?postbackTo = Producer/45

有没有更好的选择?

谢谢
//Johan


JohanK

Hi!

First of all, I did not find a suitable category to post this in. Please help me to find one :D

The question:

Consider the following scenario.

You have a Edit action (GET and POST) for an entity that multiple pages link into (GET EDIT). What is the best way of getting back to the page that linked to the edit action? Adding a postback url in the query?

Example, from MyCart/3 we have a edit product link
/Product/Edit/5?postbackTo=MyCart/3   (but url encoded)

And from Producer/45 we have this link
/Product/Edit/5?postbackTo=Producer/45

Is there a better way to do this?

Thanks
// Johan


JohanK

推荐答案

您应该发布在 ASP.NET论坛中,特别是在
You should post this in the ASP.NET Forums, specifically in the ASP.NET MVC forum.


这篇关于ASP.NET MVC中的页面重定向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆