zoukankan      html  css  js  c++  java
  • GridView根据linkButton值不同跳转不同页面(原创)

    网上看了很多文章,罗哩罗嗦都说不清,自己写了个简单方法,欢迎大家指正!

    前台使用模板列:

     <asp:TemplateField HeaderText="任务类型" HeaderStyle-Width="60px">
                        <ItemTemplate>
                            <asp:LinkButton ID="lblType" CommandName='<%#Eval("Task_Type")%>'  Text='<%#Eval("Task_Type")%>' runat="server"></asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>

    后台代码:

     protected void gvList_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "子项目")
            {
                Response.Redirect("ItemDetail.aspx? no={0}");
            }
            if (e.CommandName == "施工任务")
            {
                Response.Redirect("ProjShedule.aspx? no={0}");
            }
            if (e.CommandName == "一般任务")
            {
                Page.ClientScript.RegisterClientScriptBlock(this.GetType(), Guid.NewGuid().ToString(), "alert(\"一般任务不可以拆分!\")", true);
            }

        }

    原创,转载请注明,谢谢!

  • 相关阅读:
    【大胃王】2013暴食女王巅峰战(安吉拉x三宅x正司x木下)熟肉+高能
    破解 CrackMe#1 [UBC] by bRaINbuSY
    栈实现符号平衡检测
    简单的栈
    数独算法
    win32绘图基础
    Win32基础知识整理
    Win32最简单的程序
    初学layer
    android 虚线
  • 原文地址:https://www.cnblogs.com/Golf9527/p/1595785.html
Copyright © 2011-2022 走看看