asp.net girdview 问题
删除功能一按 就出现:索引超出范围。必须为非负值并小于集合大小。
参数名: index
public partial class _Default : System.Web.UI.Page
{
public static SqlConnection create()
{
SqlConnection con = new SqlConnection("server=.;uid=sa;pwd=4184085dsc;database=data;");
return con;
}
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
bind();
}
public void bind()
{
SqlConnection con = create();
con.Open();
SqlCommand cmd = new SqlCommand("select * from db", con);
SqlDataReader sdr = cmd.ExecuteReader();
gv1.DataSource = sdr;
gv1.DataBind();
sdr.Close();
con.Close();
}
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
gv1.EditIndex = e.Ne
相关问答:
本人使用swfobject.js在本机可以正常播放,但发布到win2003服务器就无法播放,网上找了许多都说需要配置MIME类型,我配置了也没有成功,请高手指点一下
服务器是否支持,路径是否正确
有的服务器可能不支持
......
ASP.NET 错误 无法识别的标记前缀或设备筛选器“asp”
代码如下:
<%@ Page Language="C#" ContentType="text/xml" AutoEventWireup="true" CodeFile=" ......
在弹出框中点击一个按钮,怎么调转到另一个浏览器,并且在该浏览器打开两个页面
你的意思应该是
response.write("<script>alert('确认'); window.location.href('xxxx.aspx'); </script>"); ......
HTML code:
<div>
<asp:TextBox runat="server" ID="txt"></asp:TextBox>
<img src="pic.aspx" alt="点击更换图片!" onclick=&quo ......