如何在表中选择要编辑的行时将数据导入文本框 [英] How to get data into textboxes when selecting a row in a table for editing

查看:63
本文介绍了如何在表中选择要编辑的行时将数据导入文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个这样的MVC查看页面,其中包含书籍详细信息列表。



BName BCategory BDesc BPrice行动



汽车汽车工程700编辑|删除

s Automobile s 5487编辑|删除







当我点击编辑链接时,它应该移到页面和书的细节选择进行编辑应显示在相应的控件中

BName的文本框

BCategory的下拉菜单

BDesc的文本框

BPrice的文本框





我该怎么办?



PLease帮助!

解决方案

当你点击编辑按钮然后你应该传递id从代码隐藏中选择这样的查询... :)



  TableName  *  class =code-keyword>其中 id = @id 





然后在DataTable的帮助下填写所有文本框...:)


I Have a MVC View page like this which contains list of book details.

BName BCategory BDesc BPrice Action

Automobile Automobile Automobile Engineering 700 Edit | Delete
s Automobile s 5487 Edit | Delete



when i click on edit link it should move to page and the deatils of the book selected for edit should be shown in the corresponding controls
textbox for BName
dropdown for BCategory
textbox for BDesc
textbox for BPrice


what should i do?

PLease help!

解决方案

when you click on edit button then you should pass id to select query from codebehind like this...:)

Select * from TableName where id=@id



Then fill all the textboxes with the help of DataTable...:)


这篇关于如何在表中选择要编辑的行时将数据导入文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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