现在的位置: 首页 > 综合 > 正文

总结

2014年07月21日 ⁄ 综合 ⁄ 共 671字 ⁄ 字号 评论关闭

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

 

抱歉!评论已关闭.