动态添加控件,动态取控件的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("|")