在同一视图中进行MVC编辑 [英] MVC Edit in the same view

查看:94
本文介绍了在同一视图中进行MVC编辑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友,
我有个问题.我正在使用MVC2.0 vs2010.
当我在索引视图中单击编辑"按钮时,控制权随数据传递到编辑视图.

我想停留在同一视图(例如索引视图),并提供在同一.aspx页上编辑数据的功能.

单击编辑时,应在文本框中自动填充数据.

可以从控制器调用任何视图,但是有问题.当第一次运行索引页面时,具有例如记录和
如果我在索引页面中添加一个编辑部分,则在运行索引视图时,它将显示文本框,其中包含每条记录的数据.

Hello friends,
I have a problem. I am using the MVC2.0 vs2010.
when i click on edit button in index view, control passes to the edit view with the data.

i want to stay at the same view(say index view) and provide functionality to edit data at the same .aspx page).

data should be filled automatically in text boxes when click on edit.

any view can be called from controller but having problem that. when first time running index page, that has eg. records and
if i add an edit section in my index page, it will show text boxes with filled data for each record,when running index view.

推荐答案

您可以完全控制显示哪个视图.让控制器返回索引"视图而不是编辑"视图,并根据需要显示控件
You have complete control over which view is displayed. Have the controller return the Index view rather than the Edit view and display controls as necessary


这篇关于在同一视图中进行MVC编辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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