“System.Web.UI.WebControls.GridViewDeletedEventArgs”并不包含“RowIndex”的定义
usingSystem;usingSystem.Data;usingSystem.Configuration;usingSystem.Collections;usingS...
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;
public partial class Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
MyBind();
}
}
void MyBind()
{
string strCon = "data source=.;Initial Catalog=soline;integrated security=SSPI";
SqlConnection con = new SqlConnection(strCon);
SqlCommand cmd = con.CreateCommand();
cmd.CommandText = "select * from Goods";
con.Open();
SqlDataReader dr = cmd.ExecuteReader();
GridView1.DataSource = dr;
GridView1.DataBind();
}
protected void GridView1_RowDeleting(object sender, GridViewDeletedEventArgs e)
{
string strCon = "data source=.;Initial Catalog=soline;integrated security=SSPI";
SqlConnection con = new SqlConnection(strCon);
string a = GridView1.DataKeys[e.RowIndex].Value.ToString();
string sql = "delete from Goods where goodID=" + GridView1.DataKeys[e.RowIndex].Value;
SqlCommand cmd = new SqlCommand(sql, con);
con.Open();
cmd.ExecuteNonQuery();
con.Close();
MyBind();
}
} 展开
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;
public partial class Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
MyBind();
}
}
void MyBind()
{
string strCon = "data source=.;Initial Catalog=soline;integrated security=SSPI";
SqlConnection con = new SqlConnection(strCon);
SqlCommand cmd = con.CreateCommand();
cmd.CommandText = "select * from Goods";
con.Open();
SqlDataReader dr = cmd.ExecuteReader();
GridView1.DataSource = dr;
GridView1.DataBind();
}
protected void GridView1_RowDeleting(object sender, GridViewDeletedEventArgs e)
{
string strCon = "data source=.;Initial Catalog=soline;integrated security=SSPI";
SqlConnection con = new SqlConnection(strCon);
string a = GridView1.DataKeys[e.RowIndex].Value.ToString();
string sql = "delete from Goods where goodID=" + GridView1.DataKeys[e.RowIndex].Value;
SqlCommand cmd = new SqlCommand(sql, con);
con.Open();
cmd.ExecuteNonQuery();
con.Close();
MyBind();
}
} 展开
展开全部
后台 username.Attribute.add("onchange","return check();")
html端
function check()
{
var name=document.getElementByID("<%=username.clientID%>")
parent=(!/[a-zA-Z0-9]/
if(pattern.exec(name))
{
alert('用户名为字母和数字组合且在3到10个字符之间!');
name.focus();
return false;
}
基本这个意思
html端
function check()
{
var name=document.getElementByID("<%=username.clientID%>")
parent=(!/[a-zA-Z0-9]/
if(pattern.exec(name))
{
alert('用户名为字母和数字组合且在3到10个字符之间!');
name.focus();
return false;
}
基本这个意思
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
网易云信
2023-12-06 广告
2023-12-06 广告
UIkit是一套轻量级、模块化且易于使用的开源UI组件库,由YOOtheme团队开发。它提供了丰富的界面元素,包括按钮、表单、表格、对话框、滑块、下拉菜单、选项卡等等,适用于各种类型的网站和应用程序。UIkit还支持响应式设计,可以根据不同...
点击进入详情页
本回答由网易云信提供
展开全部
后台 username.Attribute.add("onchange","return check();")
html端
function check()
{
var name=document.getElementByID("<%=username.clientID%>")
parent=(!/[a-zA-Z0-9]/
if(pattern.exec(name))
{
alert('用户名为字母和数字组合且在3到10个字符之间!');
name.focus();
return false;
}
基本这个意思 手写没测试
html端
function check()
{
var name=document.getElementByID("<%=username.clientID%>")
parent=(!/[a-zA-Z0-9]/
if(pattern.exec(name))
{
alert('用户名为字母和数字组合且在3到10个字符之间!');
name.focus();
return false;
}
基本这个意思 手写没测试
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询