ASPNET服务端控件练习(一个机试题)
2020-11-15 08:23
标签:des com http class blog style div img code java javascript 简单记录: 模糊查询的select语句的拼写 reader拿取 ROW_NUMBER() over(order by studentName)产生的值 对于动态的对ObjectDataSource控件添加参数之前先清空参数:不然参数数据源的SelectParameters会叠加递增的 Repeater应用实例:里面的table tr项模版不能是服务端的 js界面删除表格行 ListView下拿后台拿服务端控件值 服务端控件DropDownList绑定数据 后台获取服务端控件CheckBox的选择值 项目文件:http://pan.baidu.com/s/1gdJxjvt ASPNET服务端控件练习(一个机试题),搜素材,soscw.com ASPNET服务端控件练习(一个机试题) 标签:des com http class blog style div img code java javascript 原文地址:http://www.cnblogs.com/wjshan0808/p/3698169.html public List
public List
protected void Page_Load(object sender, EventArgs e)
{
this.ObjectDataSource1.SelectParameters.Clear();
this.ObjectDataSource1.SelectParameters.Add("name", "");
this.ObjectDataSource1.SelectParameters.Add("sco", "0");
this.ObjectDataSource1.DataBind();
}
protected void Button1_Click(object sender, EventArgs e)
{
this.ObjectDataSource1.SelectParameters.Clear();
string name = this.txtName.Text;
string sco = this.txtSco.Text;
this.ObjectDataSource1.SelectParameters.Add("name", name);
this.ObjectDataSource1.SelectParameters.Add("sco", sco);
//Web.BLL.Tran tran = new Web.BLL.Tran();
//List
protected void Unnamed_Click(object sender, EventArgs e)
{
//还原 参数
this.ObjectDataSource1.SelectParameters.Clear();
LinkButton lb = ((LinkButton)sender);
if (lb.CommandArgument != "")
{
if (true)//YEs No 对话框
{
string id = lb.CommandArgument;
Web.BLL.Tran tran = new Web.BLL.Tran();
if (tran.SetGood(int.Parse(id)) == 1)
{
this.Repeater1.DataBind();
}
}
}
}
protected void Button1_Click(object sender, EventArgs e)
{
this.ObjectDataSource1.SelectParameters.Clear();
this.ObjectDataSource1.SelectParameters.Add("name", this.txtSName.Text);
this.ObjectDataSource1.SelectParameters.Add("sub", this.DropDownList1.SelectedIndex + 1.ToString());
this.ObjectDataSource1.SelectParameters.Add("isG", this.CheckBox1.Checked == true ? "1" : "0");
this.ObjectDataSource1.SelectMethod = "GetWhereStudent";
this.ObjectDataSource1.DataBind();
//this.Page.DataBind();
//this.ObjectDataSource1.SelectMethod = "GetWhereStudent";
}
function DelRow() {
var ta = document.getElementById("lst");
var len=ta.rows.length;
for (var i = 1; i ) {
var ro = ta.rows.item(i);
if (ro.childNodes[0].innerHTML = arguments[0]) {
ta.deleteRow(i);
return;
}
}
};
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
string id = Request.QueryString["id"];
if (id != null)
{
//this.ObjectDataSource1.SelectParameters.Add("id", id);
this.ObjectDataSource1.SelectParameters[0].DefaultValue = id;
this.ObjectDataSource1.DataBind();
}
}
}
protected void Button1_Click(object sender, EventArgs e)
{
Web.BLL.Tran tran = new Web.BLL.Tran();
string id = ((TextBox)this.ListView1.Items[0].Controls[1]).Text;
string name = ((TextBox)this.ListView1.Items[0].Controls[3]).Text;
string sub = ((TextBox)this.ListView1.Items[0].Controls[5]).Attributes["MySubID"];
string sco = ((TextBox)this.ListView1.Items[0].Controls[7]).Text;
bool isG = ((CheckBox)this.ListView1.Items[0].Controls[9]).Checked;
if (1 == tran.EditStudent(id, name, sub, sco, isG))
{
this.ObjectDataSource1.DataBind();
Response.Redirect("Manage_Student.aspx");
}
}
"text" name="txtName" />
"text" name="txtSco" />
bool isGS = this.IsGoodStudent.Checked;