Requset如何控制Detailview和Gridview我需要VB.代码 [英] Requset how to Controll Detailview and Gridview I need VB. code

查看:63
本文介绍了Requset如何控制Detailview和Gridview我需要VB.代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以帮助我开发一个数据库Web应用程序,并且我现在使用详细信息视图进行数据输入,现在我的问题是在详细信息视图中,用户在插入数据后将用户重定向,然后单击插入或取消命令以主页下面的示例曾用于取消,但无法正常工作
谢谢

Hi any one can help me i develope one database web application and i''m using detail view for data entry for now my problem is in the detail view the user after insert data to redirect the user click insert or cancel command to home page the following example used to cancel but it dosen''t work
thanks

Protected Sub Detailview_Itemcommand(ByVal sender As Object, ByVal e As DetailsViewInsertedEventArgs)
       If e.AffectedRows = 1 Then
           Response.Redirect("~/Home.aspx")
       End If
   End Sub

推荐答案

e.AffectedRows = 1返回False值,在控件上使用CommandName,并将"cancel"设置为"cancel"按钮,然后检查以下内容:
e.AffectedRows=1 Returns a False value, use CommandName on your Control, and Set "cancel" to your cancel button, and check this:
if(e.CommandName == "Cancel") Response.Redirect("~/Home.aspx")


这篇关于Requset如何控制Detailview和Gridview我需要VB.代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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