12
返回列表 发新帖
楼主: liyihongcug

如何在Web服务端根据条件来控制一个input Botton的客户端控件可见

[复制链接]
论坛徽章:
18
授权会员
日期:2005-10-30 17:05:33美羊羊
日期:2015-03-04 14:48:58马上有车
日期:2014-02-18 16:41:112014年新春福章
日期:2014-02-18 16:41:11紫蜘蛛
日期:2012-02-21 15:06:16嫦娥
日期:2012-02-21 15:05:212012新春纪念徽章
日期:2012-01-04 11:49:54ITPUB十周年纪念徽章
日期:2011-11-01 16:20:282009日食纪念
日期:2009-07-22 09:30:00数据库板块每日发贴之星
日期:2009-02-26 01:01:03
11#
 楼主| 发表于 2011-11-15 21:49 | 只看该作者
Asp.Net分页控件Asp.Net分页控件Asp.Net分页控件Asp.Net分页控件Asp.Net分页控件

http://d.download.csdn.net/download/LQ_651119244/2555764
http://forjoanna.blog.sohu.com/59448240.html
问题http://topic.csdn.net/u/20090420 ... e-05611e206627.html

使用道具 举报

回复
论坛徽章:
18
授权会员
日期:2005-10-30 17:05:33美羊羊
日期:2015-03-04 14:48:58马上有车
日期:2014-02-18 16:41:112014年新春福章
日期:2014-02-18 16:41:11紫蜘蛛
日期:2012-02-21 15:06:16嫦娥
日期:2012-02-21 15:05:212012新春纪念徽章
日期:2012-01-04 11:49:54ITPUB十周年纪念徽章
日期:2011-11-01 16:20:282009日食纪念
日期:2009-07-22 09:30:00数据库板块每日发贴之星
日期:2009-02-26 01:01:03
12#
 楼主| 发表于 2011-11-16 15:30 | 只看该作者
我的 代码
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using System.Data;
//
using DBU;
using Model;
using DAL;
using BLL;
using common;
using System.Web.UI.HtmlControls;
namespace OA.Net.Admin.v.main
{
    public partial class hbnaturearea_gvlist : System.Web.UI.Page
    {
        protected OABll bll = new OABll();
        private DBHelper dbh = new DBHelper();
        private string tm1 = "";
        private string tm2 = "";
        private string tm3 = "";
  

        protected void Page_Load(object sender, EventArgs e)
        {
            if (int.Parse(Session["level"].ToString()) == 1)
            {
                ttt.Attributes.Add("style", "display:block");

            }            
            
            if (Request.QueryString["id"] != null)
            {
                deleteItem(int.Parse(Request.QueryString["id"]));
            }
            

            
            /*if (IsPostBack)
            {
                if ((t2.Value == "") && (!eachfield.Value.Equals("ALL")))
                {
                    errtishi.Text = "输入有误!如果选择某个字段 ,必须在文本框输入查询条件";
                }
                else
                {
                    errtishi.Text = "";
                }
                bind();
            }*/
            if (!IsPostBack)
            {
                bind();
            }
            else
            {
                bind();

            }
            //showTable();
        }



        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id"></param>
        protected void deleteItem(int id)
        {
            Dnaturearea dpc = new Dnaturearea();
            dpc.delete(id);
        }

        protected void bind()
        {
            string sql;
            tm1 = city.Value;
            tm2 = eachfield.Value;
            tm3 = t2.Value;

            if (tm2 == "ALL")
            {
                if (tm1 == "ALL")
                    sql = "select * from hbnaturearea;";
                else
                    sql = "select * from hbnaturearea where city='" + tm1 + "'";
            }
            else
            {
                if (tm1 == "ALL")
                    sql = "select * from hbnaturearea  where " + tm2 + "='" + tm3 + "'";
                else
                    sql = "select * from hbnaturearea where city='" + tm1 + "' and " + tm2 + "='" + tm3 + "'";
            }

            DataTable dt = dbh.search(sql);
            //GridView1.DataSource = dt.DefaultView;
            GridView1.DataSource = dt;
            //GridView1.AllowPaging = true;
            //GridView1.PageSize = 100;
            GridView1.DataBind();
        }



        protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            GridView1.PageIndex = e.NewPageIndex;
            bind();//重新绑定
        }
    }
}

搞了半天。 晚上在书店看的。 买本书会快很多 。
自己弄了page类  之后自己写的调用 。  用点ajax (回调)
发现2010 delete就是c的指针。 这样c#开发速度完胜java.
  

使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表