Geeks With Blogs
Daily dotnet {notes on codes} June 2010 Entries
Reset aspx form values
Here is a common method that you can use anywhere, private void ResetFormControlValues(Control parent) { foreach (Control c in parent.Controls) { if (c.Controls.Count > 0) { ResetFormControlValues(c); } else { switch (c.GetType().ToString()) { case "System.Web.UI.WebControls.... ((TextBox)c).Text = ""; break; case "System.Web.UI.WebControls.... ((CheckBox)c).Checked = false; break; case "System.Web.UI.WebControls.... ((RadioButton)c).Checked = false; break; case "System.Web.UI.WebControls.... ......

Posted On Sunday, June 20, 2010 11:16 PM

Set Index Column to GridView

Often we may need an auto incremental column for index on gridview, we can achieve this by adding a Template field:

<asp:TemplateField HeaderText="Index">
           <ItemTemplate>
                  <%# Container.DataItemIndex + 1 %>
            </ItemTemplate>
</asp:TemplateField>

Posted On Sunday, June 20, 2010 9:59 PM

Copyright © Prasenjit | Powered by: GeeksWithBlogs.net