JavaScript Confirm Does Not Work?

whorobj

New Member
I use girdview. and for deleting I use LinkButton in each row.\[code\]protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e){ if(e.Row.RowType == DataControlRowType.DataRow) { ((LinkButton)e.Row.Cells[12].Controls[0]).Attributes.Add("onClick", "return false;" ); }}\[/code\]Now, I would expect nothing to happen when I \[code\]Link Button\[/code\] is clicked because \[code\]OnClick\[/code\] returns \[code\]false\[/code\]. Right?BUT \[code\]protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { if(e.CommandName=="SIL") { String _id = GridView1.DataKeys[Int32.Parse(e.CommandArgument.ToString())].Values["id"].ToString(); dsodeme_onkayitTableAdapters.odeme_onkayitTableAdapter _todeme = new dsodeme_onkayitTableAdapters.odeme_onkayitTableAdapter(); _todeme.DeleteQueryID(_id); Response.Redirect("musteri_onkayit_odeme_al.aspx?username=" + lbUserName.Text); }}\[/code\]is being invoked. The \[code\]RowCommand\[/code\] is running and deleting the records.Please help me find the problem. I use Vista Home Premium and IE8. Is that the problem?
 
Back
Top