GridView的模版列问题 onclick", "是要在点击后的js没错 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 CheckBox chk; if (e.CommandName == "del") { foreach (GridViewRow dvr in GridView1.Rows) { chk = (CheckBox)dvr.FindControl("CheckBox1"); if (chk.Checked) { string id = e.CommandArgument.ToString();//前台把主键值绑定在按钮上 string id1 = dvr.Cells[1].Text;//通过页面上的绑定列取得主键 //通过GridView的DataKeys集合取得主键 string id2 = GridView1.DataKeys[(int)dvr.RowIndex].Value.ToString(); } } }是做的是删除的例子 多种得到主键值方法你得到主键值 放到SESSION中 同时再写个Response.Redirect("url");不就行了? 确实就是不跳转也不提示页面错误..连个javascript错误也不提示呢..高手都来看看啊..到底是哪出问题了... 要的效果就是点击按钮跳转页面(不要新开一个页面).传值的问题不需要考虑..我只要跳转,,1~!~!~!~! if (e.CommandName == "模板列中跳转按钮的cmdName"){ Response.Redirect("mubiao.aspx");}这个是你要的不传值的 protected void BlackboardGV_OnRowCommand(object sender, GridViewCommandEventArgs e) { try { if (e.CommandName == "delete") { Myblackboard.HealthEducate_blackboard_Delete(Convert.ToInt32(e.CommandArgument)); Response.Redirect("BlackboardList.aspx"); } else if (e.CommandName == "edit") { Response.Redirect("BlackboardEdit.aspx?Blackboard_ID=" + Convert.ToInt32(e.CommandArgument)); } } catch { } } 上面代码写在模板列事件里建个模板列 放个按钮 把事件写在模板列里你03时使的是DataGird 现在你用的GridView 当然不一样以前datagrid 有Item属性很方便现在的GridView都要先实力化行才能用两个控件不一样的地方多了 关于微软企业库批量更新的问题 求优秀ASP.NET源码 asp.net 自定义控件 CheckBox改造 gridview 的怪问题 求公务用车管理详细的需求说明 这个问题应该在智力问?求高人指教 使用vs.net2003新建项目时,提示“automation”服务器不能创建对象?? SmartNavigation="true" 与 response.redirect有冲突?? 使用windows窗体控件链接web service的安全问题?再加100回复有分 怎样获取文件名称? 超级强的无限通讯接口需要的兄弟联系我。 清空本页面所有TextBox的Text,如何实现
if (e.CommandName == "del")
{
foreach (GridViewRow dvr in GridView1.Rows)
{
chk = (CheckBox)dvr.FindControl("CheckBox1");
if (chk.Checked)
{
string id = e.CommandArgument.ToString();//前台把主键值绑定在按钮上
string id1 = dvr.Cells[1].Text;//通过页面上的绑定列取得主键
//通过GridView的DataKeys集合取得主键
string id2 = GridView1.DataKeys[(int)dvr.RowIndex].Value.ToString();
}
}
}是做的是删除的例子 多种得到主键值方法
你得到主键值 放到SESSION中 同时再写个Response.Redirect("url");不就行了?
连个javascript错误也不提示呢..
高手都来看看啊..
到底是哪出问题了...
要的效果就是点击按钮跳转页面(不要新开一个页面).传值的问题不需要考虑..
我只要跳转,,1~!~!~!~!
{
Response.Redirect("mubiao.aspx");
}
这个是你要的不传值的
{
try
{
if (e.CommandName == "delete")
{
Myblackboard.HealthEducate_blackboard_Delete(Convert.ToInt32(e.CommandArgument));
Response.Redirect("BlackboardList.aspx");
}
else if (e.CommandName == "edit")
{
Response.Redirect("BlackboardEdit.aspx?Blackboard_ID=" + Convert.ToInt32(e.CommandArgument));
}
}
catch
{
}
}
现在的GridView都要先实力化行才能用两个控件不一样的地方多了