Ejemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     LanMenu.getLan(ref Id, ref Name, ref lanid, ref lanname);
     GridView2.ShowHeaderWhenEmpty = true;
     TextBox1.Attributes.Add("Value", "请输入关键字");
     TextBox1.Attributes.Add("OnFocus", "if(this.value=='请输入关键字') {this.value=''}");
     TextBox1.Attributes.Add("OnBlur", "if(this.value==''){this.value='请输入关键字'}");
     if (Request.QueryString["id"] != null)
     {
         string id = Request.QueryString["id"].ToString();
         GridView1.DataSource = Class1.excuDatSet("select top 10 * from [news] order by hitCount desc");
         GridView1.DataBind();
         GridView2.DataSource = Class1.excuDatSet("select * from View_News where lanId=" + id);
         GridView2.DataBind();
     }
 }
Ejemplo n.º 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     GridView1.EmptyDataText = "无结果";
     GridView2.EmptyDataText = "无结果";
     LanMenu.getLan(ref Id, ref Name, ref lanid, ref lanname);
     TextBox1.Attributes.Add("Value", "请输入关键字");
     TextBox1.Attributes.Add("OnFocus", "if(this.value=='请输入关键字') {this.value=''}");
     TextBox1.Attributes.Add("OnBlur", "if(this.value==''){this.value='请输入关键字'}");
     if (Request.QueryString["newsName"] != null)
     {
         string newsname = Request.QueryString["newsName"].ToString();
         GridView1.DataSource = Class1.excuDatSet("select top 10 * from [news] order by hitCount desc");
         GridView1.DataBind();
         GridView2.DataSource = Class1.excuDatSet("select * from View_News where newsName like '%" + newsname + "%'");
         GridView2.DataBind();
     }
 }
Ejemplo n.º 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     LanMenu.getLan(ref Id, ref Name, ref lanid, ref lanname);
     TextBox1.Attributes.Add("Value", "请输入关键字");
     TextBox1.Attributes.Add("OnFocus", "if(this.value=='请输入关键字') {this.value=''}");
     TextBox1.Attributes.Add("OnBlur", "if(this.value==''){this.value='请输入关键字'}");
     if (Request.QueryString["id"] != null)
     {
         string id = Request.QueryString["id"].ToString();
         news   n  = news.getNewsId(id);
         news.addClick(id);
         Label1.Text = n.newsName;
         Label2.Text = "发布时间:" + n.time.ToString();
         Label3.Text = "点击量:" + n.hitCount.ToString();
         Label4.Text = n.contents;
     }
 }
Ejemplo n.º 4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     TextBox1.Attributes.Add("Value", "请输入关键字");
     TextBox1.Attributes.Add("OnFocus", "if(this.value=='请输入关键字') {this.value=''}");
     TextBox1.Attributes.Add("OnBlur", "if(this.value==''){this.value='请输入关键字'}");
     GridView1.DataSource = Class1.excuDatSet("select * from View_News order by time");
     GridView1.DataBind();
     news.getImgs(ref pics, ref texts, ref links);
     LanMenu.getLan(ref Id, ref Name, ref lanid, ref lanname);
     string[] arry  = lanname.Split(',');
     string[] sarry = lanid.Split(',');
     Label1.Text          = arry[0];
     Label2.Text          = arry[1];
     Label3.Text          = arry[2];
     GridView2.DataSource = Class1.excuDatSet("select * from [news] where lanId=" + sarry[0]);
     GridView2.DataBind();
     GridView3.DataSource = Class1.excuDatSet("select * from [news] where lanId=" + sarry[1]);
     GridView3.DataBind();
     GridView4.DataSource = Class1.excuDatSet("select * from [news] where lanId=" + sarry[2]);
     GridView4.DataBind();
 }