Monday, April 22, 2013

Using CSS Direct Descendant Selector with Tables

Recently I was attempting to use a  CSS 'direct descendant' selector (>) to set a bottom border on rows in a table. Because there were rows buried deeper in nested tables, I didn't want those to have the border. When I used the following CSS selector, it didn't work.

   table.employee > tr

Turns out, I needed to add a TBODY between the TABLE and TR, even though a TBODY was not showing in the page source because the TBODY is implictly added.


table.employee > tbody > tr
 
 

Thursday, April 4, 2013

Using Request.QueryString in Page_Load in SharePoint page layout


Below is an example of using the Request.QueryString collection in the Page_Load method in a SharePoint page layout. In this case we're looking for the variable named 'tab' and checking for various conditions.


try
{
  int index = System.Convert.ToInt32(Request.QueryString["tab"]);
  if (index > 1 && index < 5)
  {
    if (RadTabStrip1.Tabs[index-1].Visible)
    {
       RadTabStrip1.Tabs[index-1].Selected = true;
       RadMultiPage1.PageViews[index-1].Selected = true;
    }
  }
}
catch (Exception ex)
{
  //    Response.Write(ex.Message);
}