asp.net
문제의 buttonfield;;;
<asp:ButtonField CommandName="Button" Text="[삭제]">
<itemStyle Width="40px" />
</asp:ButtonField>
gridview에서 buttonfield는 OnClientClick속성이 없다.
난 자바스크립트 confirm을 써야하는데...
하지만 이미 onrowcommand로 이벤트가 걸려있기 때문에 다시 수정할라니 겁나서 ...
솔직히 내 소스 내가 잘 몰라서 ㅋㅋㅋ
암튼 닥치고 소스
바인딩할때 해당필드에 속성추가
protected void CommentGrid_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Cells[3].Attributes.Add("onclick", "javascript:return " +"confirm('정말로 지울까요?')");
}
}
'programming > ASP.NET' 카테고리의 다른 글
Custom Membership Provider 공급자 (0) | 2011.03.18 |
---|---|
web.config 파일 고찰 (0) | 2011.03.18 |
[펌] [ASP.NET] ASP Login 컨트롤 사용시 엔터키 사용하여 로그인 하기 (0) | 2010.11.03 |
gridview에서 원하는 값으로 변경하여 바인딩 (0) | 2009.08.08 |
GridView RowCommand 이벤트 (1) | 2009.08.01 |