Blog Archives

Adding a Stylesheet to a Master Page in C#

I just updated the code for the Row and Column Highlight for Gridview Control lab. I decided to put the CSS specific to that feature in its own style sheet. Since I am using Master Pages for the labs, I

Tagged with: , , ,
Posted in ASP.NET, C#

Validate Web Page Against W3C Validator in .NET

During one of the redesigns of DeepFitness.com, I decided to make sure all the articles validated to XHTML.  The post Converting HTML to XHTML Programmatically in .NET shows how I did that.  FreeTextBox did an excellent job assisting with the

Tagged with: ,
Posted in ASP.NET, C#

W3C Validation for ASP.NET Data Controls

If you’ve had the W3C Validator curse your ASP.NET 2.0 code for not being XHTML, it may not be your fault. The ASP.NET engines sees the W3C validator as down-level browser and renders non-XHTML compliant code. Your code is most

Tagged with: , , ,
Posted in ASP.NET

Set SelectedDate on ASP.NET Calendar Control to Today

When you want to set the default SelectedDate on an ASP.NET Calendar Control use DateTime.Today not DateTime.Now. calReleaseDate.SelectedDate = DateTime.Today;

Tagged with: , ,
Posted in ASP.NET

Clear GridView Control in ASP.NET

Clearing a populated GridView control can be done in just 3 lines of code. Create an empty DataTable and then bind it to the Gridview. DataTable dt = new DataTable(); GridView1.DataSource = dt; GridView1.DataBind();

Tagged with: ,
Posted in ASP.NET