惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Threat Research - Cisco Blogs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
V
Vulnerabilities – Threatpost
GbyAI
GbyAI
P
Proofpoint News Feed
L
LINUX DO - 热门话题
P
Palo Alto Networks Blog
A
About on SuperTechFans
T
Tenable Blog
M
MIT News - Artificial intelligence
IT之家
IT之家
I
Intezer
D
DataBreaches.Net
爱范儿
爱范儿
T
Threatpost
C
CERT Recently Published Vulnerability Notes
云风的 BLOG
云风的 BLOG
博客园 - 三生石上(FineUI控件)
WordPress大学
WordPress大学
K
Kaspersky official blog
大猫的无限游戏
大猫的无限游戏
A
Arctic Wolf
Y
Y Combinator Blog
Cyberwarzone
Cyberwarzone
酷 壳 – CoolShell
酷 壳 – CoolShell
D
Darknet – Hacking Tools, Hacker News & Cyber Security
H
Help Net Security
Microsoft Security Blog
Microsoft Security Blog
Spread Privacy
Spread Privacy
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
AWS News Blog
AWS News Blog
博客园 - 聂微东
C
Check Point Blog
S
Securelist
有赞技术团队
有赞技术团队
雷峰网
雷峰网
aimingoo的专栏
aimingoo的专栏
Last Week in AI
Last Week in AI
Stack Overflow Blog
Stack Overflow Blog
MongoDB | Blog
MongoDB | Blog
D
Docker
G
GRAHAM CLULEY
T
The Exploit Database - CXSecurity.com
C
Cybersecurity and Infrastructure Security Agency CISA
T
Tailwind CSS Blog
L
Lohrmann on Cybersecurity
G
Google Developers Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
L
LangChain Blog

博客园 - .net

软件项目获取用户需求的沟通技巧(摘自IT168技术频道) 软件项目进度控制要处理好四个问题(摘自IT168技术频道) 软件外包项目实施过程中的关键因素(摘自IT168技术频道) Struts学习心得之Struts流程篇(3) -示例 续 转载 Struts学习心得之Struts流程篇(3) -示例 转载 Struts学习心得之Struts流程篇(2) 转载 Struts学习心得之Struts流程篇(1)转载 初学Java Applet程序设计基础 将一个数据库添加到服务器中 开发中的临时内容 开发个人财务管理系统(一)建数据库 SQL查询语句使用方法参考二 SQL查询语句使用方法参考一 用RichTextBox控件来做一个文本编辑器 微软的一项Agent技术(动画小精灵) .NET中如何获得IP地址和主机名 response.bufferoutput cookie的使用 测试cookie关键字是否存在
datagrid中使用dropdownlist编辑模版时遇到问题
.net · 2005-04-30 · via 博客园 - .net

前2天我做的财务管理系统中需要用到datagrid控件来显示用户信息,为了能够编辑用户信息,我参照微软的asp.net入门套件ASP.NET Time Tracker Starter Kit (VBVS)中在datagrid中使用编辑模版。 在问题没解决之前,点击datagrid中的编辑始终报下面错误:
’==================

‘===================
下面是datagrid的html文件:


最初的页面显示如下:


按下编辑后的页面:
 
对于编辑列中的edit,update,cancel需要用到下面的是件:

 '编写从 DropDownList 中检索当前选定值的代码,并执行数据库更新
    Protected Sub dguserdetail_UpdateCommand(ByVal source As ObjectByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dguserdetail.UpdateCommand
 
Dim item As DataGridItem = dguserdetail.Items(dguserdetail.EditItemIndex)
        
If e.CommandName = "Update" Then
    
If e.Item.ItemType = ListItemType.EditItem Then '只有在编辑按下以后才能提交
                Dim username As String
                
Dim password As String
                
Dim email As String
                
Dim authority As String
                
Dim authorityId As Integer
username 
= CType(e.Item.FindControl("username"), Label).Text
password 
= CType(e.Item.FindControl("txtpassword"), TextBox).Text
email 
= CType(e.Item.FindControl("txtemail"), TextBox).Text
authority 
= CType(e.Item.FindControl("ddauthority"), DropDownList).SelectedItem.Value
authorityId 
= IIf(authority = "系统管理员"10)
' Save the dguserdetail object.
            Try
     SqlHelper.ExecuteNonQuery(strconn, 
"updateuser", username, password, email, authorityId)
            
Catch
            
End Try
End If
' Quit in-line-editing mode.
   dguserdetail.EditItemIndex = -1
   SetBind()
End If

End Sub