Xpode.com        Click here to Print this article.

ASP.NET interview questions: - How to use a checkbox in a data grid?

Following are the steps to be done:-

  • In ASPX page you have to add Item template tag in data grid.

<ItemTemplate>

<asp:CheckBox id="CheckBox1" runat="server" AutoPostBack="True" OnCheckedChanged="Check_Clicked"></asp:CheckBox>

</ItemTemplate>


If you look at the Item template, we have “OnCheckChanged” event. This “OnCheckChanged” event has “Check Clicked” subroutine is actually in behind code. Note this method, which is in behind code, should either be “protected” or “public”

Following below is the subroutine, which defines the method

Protected Sub Check Clicked (By Val sender As Object, By Val e As EventArgs)

‘Do something

End Sub


Above is the ASP.NET interview questions & also see the following video on Authentication, Authorization, Principal and Identity objects: -



http://
http://www.questpond.com/

Contributed by:
Shivprasad koirala Koirala
I am a Microsoft MVP for ASP/ASP.NET and currently a CEO of a small E-learning company in India. We are very much active in making training videos , writing books and corporate trainings. Do visit my site http://www.questpond.com for .NET, C# , design pattern , WCF , Silverlight , LINQ , ASP.NET , ADO.NET , Sharepoint , UML , SQL Server training and Interview questions and answers

Resourse address on xpode.com
http://www.xpode.com/Print.aspx?Articleid=705

Click here to go on website