jQuery event conflicts with ASP.NET Update Panel

There is a problem when I attached click event to ASP page inside Update Panel control.
I put click event onto a button using jQuery.

$("#btn").click(function () {
	alert("clicking button");
});

After asynchronous load is triggered by update panel, clicking that button will not show any alert anymore.
Seems click event are detached.
The fact is any event control which put using client side or jQuery will failed inside update panel. Why?

Continue reading

Click Event on Row Gridview

Recent days, I got requirement to make gridview clickable and click event has to redirect user to Edit page. After few googling, I found a simple way to do it. Actually I did this for SPGridview (Sharepoint) and it’s also work for ASP gridview. I’ll try to expose the different of them in next post later.

<SharePoint:SPGridView ID="gridView" runat="server" OnRowDataBound="gridView_RowDataBound" OnSelectedIndexChanged="gridView_SelectedIndexChanged" DataKeyNames="ID" >

Continue reading