Category Archives: ASP.NET

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 … Continue reading

Posted in ASP.NET, C# | Tagged , , , | Leave a comment

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 … Continue reading

Posted in ASP.NET, C# | Tagged , | Leave a comment

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 … Continue reading

Posted in ASP.NET | Tagged , , , | Comments Off

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;

Posted in ASP.NET | Tagged , , | 1 Comment

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();

Posted in ASP.NET | Tagged , | 1 Comment