Hi all,
i found this script from the adobe website and is it possible for some1 to convert this to vb....am not having much luck?
many thanks
i found this script from the adobe website and is it possible for some1 to convert this to vb....am not having much luck?
Code:
<script runat="server">
protected void dg_employees_SortCommand(Object sender, DataGridSortCommandEventArgs e)
{
// This function allows us to sort on the headers in the datagrid.
// Need these two attributes in the Datagrid:
// AllowSorting="true"
// OnSortCommand="dg_employees_SortCommand"
// Each BoundColumn (or TemplateColumn) that allows sorting needs this attribute:
// SortExpression="<column_name>" where <column_name> is the name of the column in the database
// The value of the SortExpression is used in the query string "sortOn".
// The query string is used in the ternary expression in the
// dataset (ds_employees) for the ORDER BY clause in the CommandText.
string sortDir = "";
if (Request.QueryString["sortOn"] == e.SortExpression)
{
// The sort expression matches what was sorted on last time
if (Request.QueryString["sortDir"] == "")
{
sortDir = "ASC";
}
else if (Request.QueryString["sortDir"] == "ASC")
{
sortDir = "DESC";
}
else if (Request.QueryString["sortDir"] == "DESC")
{
sortDir = "ASC";
}
}
else
{
// Have a new sort expression so always start out ASC
sortDir = "ASC";
}
// Redirect back to this page with the appropriate sort expression and direction.
Response.Redirect(Request.ServerVariables["SCRIPT_NAME"] + "?sortOn=" + e.SortExpression + "&sortDir=" + sortDir);
}
</script>
many thanks