好湿?好紧?好多水好爽自慰,久久久噜久噜久久综合,成人做爰A片免费看黄冈,机机对机机30分钟无遮挡

主頁 > 知識庫 > ASP.NET中RadioButtonList綁定后臺數(shù)據(jù)后觸發(fā)點(diǎn)擊事件

ASP.NET中RadioButtonList綁定后臺數(shù)據(jù)后觸發(fā)點(diǎn)擊事件

熱門標(biāo)簽:濮陽外呼電銷系統(tǒng)怎么樣 塔城代理外呼系統(tǒng) 400電話辦理哪家性價(jià)比高 地圖標(biāo)注專業(yè)團(tuán)隊(duì) 地圖定位圖標(biāo)標(biāo)注 天心智能電銷機(jī)器人 地圖標(biāo)注的公司有哪些 遂寧市地圖標(biāo)注app 代理接電話機(jī)器人如何取消

本文實(shí)例為大家分享了RadioButtonList綁定后臺數(shù)據(jù),觸發(fā)點(diǎn)擊事件的方法

首先前臺頁面放置一個(gè)RadioButtonList 控件

asp:RadioButtonList runat="server" ID="RadioButtonList1" BorderStyle="None" RepeatColumns="3" CssClass=""
      RepeatLayout="Flow" AutoPostBack="true" OnSelectedIndexChanged="RadioButtonList1_SelectedIndexChanged">
    /asp:RadioButtonList>

.cs文件 后臺綁定數(shù)據(jù)

namespace BTApp
{
 public partial class Technology : System.Web.UI.Page
 {
  string Id;
  protected void Page_Load(object sender, EventArgs e)
  {
   if (!IsPostBack)
   {
    AspNetPager1.PageSize = 10;
    if (Request.QueryString["Id"] != null)
    {
     Id = Request.QueryString["Id"];
    }
    else
    { Id = ""; }
    GetDataBind(Id);
    DropDownListDataBind();
   }
  }
  //RadioButtonList綁定后臺數(shù)據(jù)
  private void DropDownListDataBind()
  {
   ExpertInfoBLL bll = new ExpertInfoBLL();
   DataTable dt = bll.GetDepInfo();
   foreach (DataRow dr in dt.Rows)
   {
    RadioButtonList1.Items.Add(dr["Name"].ToString());//循環(huán)讀出數(shù)據(jù)庫的數(shù)據(jù)
    
   }
   this.RadioButtonList1.DataSource = dt;
   this.RadioButtonList1.DataTextField = "Name";
   this.RadioButtonList1.DataValueField = "Id";
   this.RadioButtonList1.RepeatDirection = RepeatDirection.Horizontal;
   this.RadioButtonList1.DataBind();
  
  }
  private void GetDataBind(string Id)
  {
   //這里寫解碼和數(shù)據(jù)庫返回結(jié)果
   TechnologyBLL bll = new TechnologyBLL();
   string strWhere = " 1=1 ";
   if (Id != ""  Id != null)
   {
    strWhere += string.Format(" and a.Depinfo_Id = '{0}'", Id);
   }
   AspNetPager1.RecordCount = bll.GetCountList(strWhere);
   //綁定數(shù)據(jù) 
   DataTable dt = bll.GetList((AspNetPager1.CurrentPageIndex - 1) * AspNetPager1.PageSize, AspNetPager1.PageSize, strWhere, "CreateTime");
   this.Repeater1.DataSource = dt;
   this.Repeater1.DataBind();


  }
  protected void AspNetPager1_PageChanged(object sender, EventArgs e)
  {
   GetDataBind(Id);
  }

//根據(jù)選擇單選按鈕的不同id,觸發(fā)事件
  protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e)
  {
    string Id;
    Id = RadioButtonList1.SelectedValue;
    GetDataBind(Id);
  }
  
 }
}

TechnologyBLL 層的方法

namespace BTAppBLL
{
 public class TechnologyBLL
 {
  TechnologyDAL dal = new TechnologyDAL();
  public DataTable GetList(int startPage, int pageSize, string where, string orderby)
  {


   DataTable dTable = dal.GetList(startPage, pageSize, where, orderby);
   return dTable;
  }
  public int GetCountList(string where)
  {


   int record = dal.GetCountList(where);
   return record;
  }
  public DataTable GetListShow(string TechnologyId)
  {
   DataTable dTable = dal.GetModel(TechnologyId);
   return dTable;
  }
  public DataTable GetPicture(string TechnologyId)
  {
   DataTable dTable = dal.GetPicture(TechnologyId);
   return dTable;
  }
 }
}

TechnologyDAL層的方法

namespace BTAppDAL
{
 public class TechnologyDAL
 {
  public DataTable GetList(int startPage, int pageSize, string where, string orderby)
  {
   string strSql = string.Format("SELECT a.TechnologyId,a.TechnologyName,a.Summarize,a.Effect,a.MainPoint,a.AppropriateArea,a.Attention,a.CreateTime,a.CreatUser,a.UpdateTime,b.Name FROM Technology AS a \n" +
    "left join Sys_DepInfo AS b ON a.Depinfo_Id=b.Id \n" +
    "where a.IsActive='1' and {0} ", where);


   string proc = "proc_CommonPagerWithStatement";
   SqlConnection con = SqlDbHelper.Connection;
   SqlParameter[] sp = { new SqlParameter("@intStartIndex", startPage), 
         new SqlParameter("@intPageSize", pageSize),
         new SqlParameter("@varStatement", strSql), 
         new SqlParameter("@varSortExpression", orderby+" DESC") };
   DataTable dt = SqlDbHelper.GetDataSet(proc, sp, con);
   return dt;


  }
  public int GetCountList(string where)
  {
   int countRecord = 0;
   string strSql = string.Format("select COUNT(TechnologyId) as countRecord from(SELECT a.TechnologyId,a.TechnologyName,a.Summarize,a.Effect,a.MainPoint,a.AppropriateArea,a.Attention,a.CreateTime,a.CreatUser,a.UpdateTime,b.Name FROM Technology AS a \n" +
    "left join Sys_DepInfo AS b ON a.Depinfo_Id=b.Id \n" +
    "where a.IsActive='1' and {0} ) as c", where);
   SqlConnection con = SqlDbHelper.Connection;
   try
   {
    if (con.State == System.Data.ConnectionState.Closed)
     con.Open();
    DataTable dt = SqlDbHelper.GetDataTable(strSql);
    if (dt.Rows.Count > 0)
     countRecord = int.Parse(dt.Rows[0]["countRecord"].ToString());
   }
   catch (Exception)
   {
    throw;
   }
   finally
   {
    if (con.State == ConnectionState.Open)
    {
     con.Close();
    }
   }


   return countRecord;
  }
  public DataTable GetModel(string TechnologyId)
  {
   string strSql = string.Format("SELECT a.TechnologyId,a.TechnologyName,a.Summarize,a.Effect,a.MainPoint,a.AppropriateArea,a.Attention,a.CreateTime,a.CreatUser,a.UpdateTime,b.Name FROM Technology AS a \n" +
    "left join Sys_DepInfo AS b ON a.Depinfo_Id=b.Id \n" +
    "where a.IsActive='1' and a.TechnologyId = '{0}' ", TechnologyId);


   DataTable dataTable = SqlDbHelper.GetDataTable(strSql);
   return dataTable;
  }
  public DataTable GetPicture(string TechnologyId)
  {
   string strSql = string.Format("SELECT TOP 5 a.Files_Id,a.Files_Name,a.Files_Path FROM dbo.Com_Files AS a \n" +
    "LEFT JOIN dbo.Technology AS b ON a.ForeignKey_Id=b.TechnologyId \n" +
    "WHERE b.IsActive=1 and a.ForeignKey_Id = '{0}' ", TechnologyId);


   DataTable dataTable = SqlDbHelper.GetDataTable(strSql);
   return dataTable;
  }
 }
}

ExpertInfoBLL 層的方法

 public DataTable GetDepInfo()
  {
   DataTable dTable = dal.GetDepInfo();
   return dTable;
  }

ExpertInfoDAL層的方法

 public DataTable GetDepInfo()
  {
   try
   {
    StringBuilder str = new StringBuilder(@"SELECT Id,Name FROM dbo.Sys_DepInfo WHERE Is_Active='1' AND DepinfoType='1'");
    DataTable data = SqlDbHelper.GetDataTable(str.ToString());
    if (data.Rows.Count > 0)
    {
     return data;
    }
    else
    {
     return null;
    }
   }
   catch (Exception)
   {
    return null;
   }
  }

在頁面加載的時(shí)候調(diào)用DropDownListDataBind()方法
觸發(fā)RadioButtonList的點(diǎn)擊事件

 protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e)
  {
    string Id;
    Id = RadioButtonList1.SelectedValue;
    GetDataBind(Id);
  }

既可以實(shí)現(xiàn)點(diǎn)擊某個(gè)單選按鈕,并觸發(fā)事件。

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助。

您可能感興趣的文章:
  • JavaScript給每一個(gè)li節(jié)點(diǎn)綁定點(diǎn)擊事件的實(shí)現(xiàn)方法
  • 元素綁定click點(diǎn)擊事件方法
  • JavaScript給按鈕綁定點(diǎn)擊事件(onclick)的方法
  • js 索引下標(biāo)之li集合綁定點(diǎn)擊事件

標(biāo)簽:河南 宜春 婁底 本溪 麗江 汕頭 重慶 吉林

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《ASP.NET中RadioButtonList綁定后臺數(shù)據(jù)后觸發(fā)點(diǎn)擊事件》,本文關(guān)鍵詞  ASP.NET,中,RadioButtonList,綁定,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《ASP.NET中RadioButtonList綁定后臺數(shù)據(jù)后觸發(fā)點(diǎn)擊事件》相關(guān)的同類信息!
  • 本頁收集關(guān)于ASP.NET中RadioButtonList綁定后臺數(shù)據(jù)后觸發(fā)點(diǎn)擊事件的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    主站蜘蛛池模板: 一级日本婬片A片高潮中| 一个人看的在线视频| susu成人影院| 长篇合集乱肉合集500TxT| 欧美性黑人极品hd| 我和黑帮大佬的365日| 日本免费大片免费视频| 亚洲人成影视在线观看| 爱福利视频导航| 一本色道久久综合无码的注意事项 | 乱交| 男人懂得成a人v网站| 性感黄色片| 69xxx国产| 被男人吃奶摸下面啥感| 迅雷电影院三级| 亂伦WWWHD一区二区三区| 久久九九爽日日区区区| 18hdxxxx动漫3d| 日产国产欧美视频一区精品| 极度放荡的娇妻h| 狠狠干狠狠插| 你就仗着我宠你| 色秘?乱码一区二区三区色欲| ty66最新2018入口| 亚洲欧美日韩中文高清ww| 森ほたる森萤黑人上司| 欧美在线高清| 舔舔舔舔舔舔| 丰满大胸年轻的继坶5中字| z0osi00k重口另类| 《波多野衣结》高清完整版在线| 挺进她的花苞?啊太深了APp | 农村黄色片| 丰满无码少妇毛片免费看| 麻豆精品秘?国产传媒视频| 台湾佬综合娱乐22ⅩXOO| 日本漫画yy漫画在线观看| 农村老肥熟口味重| 国产成人9.1免费AV视频网站| 亚洲精品一区二区|