zoukankan      html  css  js  c++  java
  • asp:HyperLink 控件不同数据 跳转不同的页面

    <asp:HyperLink ID="hlDetail" CssClass="details" runat="server" OnPreRender="HyperLink_DataBinding"
    Text='<%# Eval("Id") %>' Target="_blank"></asp:HyperLink>

    重点在 OnPreRender 事件

    protected void HyperLink_DataBinding(object sender, EventArgs e)
    {
    HyperLink HyperLink = sender as HyperLink;
    int bid = 0;
    if (int.TryParse(HyperLink.Text, out bid))
    {
    //HyperLink.Attributes.Add("onclick", "checkOrder(this,'" + bid + "','" + AccountInfo.EmpId + "');");
    HyperLink.Text = "详情";
    Examine_OrderPool order = OrderList.SingleOrDefault(o => o.Id == bid);
    int flowtype = Convert.ToInt32(order.FlowType);
    switch (flowtype)
    {

    case (int)FlowType.RapidPlus:
    HyperLink.NavigateUrl = "../ExamineIMP/ExamineDetail.aspx?Bid=" + bid;
    break;

    case (int)FlowType.BuyVehiclePho:
    HyperLink.NavigateUrl = "../ExamineIMP/VMortgageExamineDetail.aspx?Bid=" + bid;
    break;

    }
    }
    }

  • 相关阅读:
    mysql外键添加error1215
    shell命令获取最新文件的名称
    centos7 apache提供文件下载
    centos7 时间设置
    微服务通信的类型
    angular-cli
    npm
    模块相关
    加油!冲冲冲
    软件评测
  • 原文地址:https://www.cnblogs.com/wdnrsjd/p/8026696.html
Copyright © 2011-2022 走看看