A: 

I would maintain the sort order of the columns within the page itself as hidden input fields (with runat="server" specified). When a link is clicked, you can flip the direction of this field prior to postback. This gets around having to check for IsPostBack status.

Something like this:

<input type="hidden" id="TitleSortOrder" Runat="server" />
<asp:LinkButton id="TitleHeader" onclick="return(FlipSortOrder('Title'));" />

function FlipSortOrder(type)
{
  var sortOrder = document.getElementById(type + "SortOrder");
  sortOrder.value = sortOrder.value === "ASC" ? "DESC" : "ASC";
  return true;
}

In server-side code, you can refer to the value of the title sort direction using the TitleSortOrder.Value property.

To make this work in MySQL, you'll need to execute a dynamic query if you intend for the sorting to happen at the database level. This is similar to post http://stackoverflow.com/questions/1430598/dynamic-column-name-in-mysql/, but in the interests of keeping this all together, the pattern of executing dynamic SQL in MySQL looks like this:

SET @qry = 'your query here';
PREPARE stmt FROM @qry;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
David Andres