protected void odSource_Selected(object sender, ObjectDataSourceStatusEventArgs e) { if (e.ReturnValue.GetType() == typeof(Int32)) { ViewState["TotalCount"] = e.ReturnValue; } }