我有子标题来显示三种不同的信息。我现在的问题是,当我点击主标题时,它需要显示来自带有条件的子标题的2个信息。我怎么能得到这项工作。目前我只能在点击子标题时看到这些信息,点击主标题时会显示空白页面。用于选择子标题的代码我使用的是查询字符串。
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
PageSize = System.Configuration.ConfigurationManager.AppSettings["OrderPagedResultSize"].AsInt(); ;
CurrentPendingOrderPage = 0;
CurrentConfirmedOrderPage = 0;
CurrentRejectedOrderPage = 0;
SetDefaultSeoEntities();
AssignResourceValues();
BindOrderList();
pnlPending.Visible = (Request.QueryString["order"] == "pending") ? true : false;
pnlConfirmed.Visible = (Request.QueryString["order"] == "confirmed") ? true : false;
pnlRejected.Visible = (Request.QueryString["order"] == "rejected") ? true : false;
}
}
protected void pending(object sender, EventArgs e)
{
Response.Redirect("OrderHistory.aspx?order=pending", true);
}
protected void confirmed(object sender, EventArgs e)
{
Response.Redirect("OrderHistory.aspx?order=confirmed", true);
}
protected void rejected(object sender, EventArgs e)
{
Response.Redirect("OrderHistory.aspx?order=rejected", true);
}
在aspx文件中我将此方法称为:
<div class="col-md-9">
<div class="col-md-12 innerTitle">
Order Summary
</div>
<div class="col-md-12">
<div class="account">
<div class="col-md-4 text-center" id="confirmed"><b><asp:LinkButton OnClick="confirmed" runat="server">Confirmed Order History</asp:LinkButton></b></div>
<div class="col-md-4 text-center" id="pending"><b><asp:LinkButton OnClick="pending" runat="server">Pending Order History</asp:LinkButton></b></div>
<div class="col-md-4 text-center" id="rejected"><b><asp:LinkButton OnClick="rejected" runat="server">Rejected Order History</asp:LinkButton></b></div>
</div>
</div>
主标题中显示的条件是待处理订单为空时,如果未显示待处理订单摘要,则显示已确认的订单摘要。一个信息,每个摘要我使用网格视图来显示它。
待处理页面将通过以下代码清空控件:
private void BindPendingOrderList()
{
GetOrdersResponse pendingOrdersResponse = new GetOrdersResponse();
if (Session["LoginCustomerRole"].ToString() == "Customer") pendingOrdersResponse = GetPendingOrdersByCustomer();
else if (Session["LoginCustomerRole"].ToString() == "CustomerAdmin") pendingOrdersResponse = GetPendingOrdersByCustomerGroupId();
PendingOrderPageControl.LoadPager(pendingOrdersResponse.TotalCount, CurrentPendingOrderPage, PageSize);
grdvwPendingOrder.DataSource = pendingOrdersResponse.Orders;
grdvwPendingOrder.DataBind();
if (pendingOrdersResponse.TotalCount > 0) PendingOrderPageControl.Visible = true; else PendingOrderPageControl.Visible = false;
}