总结

来源:互联网 发布:西安电子软件学院 编辑:程序博客网 时间:2024/05/03 12:09

动态添加控件,动态取控件的CommandName值:

System.Web.UI.WebControls.Button oButtonAdd=new Button();
oButtonAdd.ID="btnAdd" + i;
oButtonAdd.Text="确定";
oButtonAdd.CommandName=i.ToString();
oButtonAdd.Click+=new EventHandler(Button);
dtSecordHtmlTable.Rows[3].Cells[2].Controls.Add(oButtonAdd);


public void Button(object sender, System.EventArgs e)
{
  string strCommandName =((Button)sender).CommandName;
  this.Response.Write(strCommandName);
}


禁止输入非数字这符:

onKeypress="if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;"

//取整
Math.round(strYPrice*strText/10)*10; 

var strValue=document.getElementById(strDropDownListCWDM).options[document.getElementById(strDropDownListCWDM).selectedIndex].value.split("|")


 

原创粉丝点击