protected System.Web.UI.WebControls.PlaceHolder Placeholder1;
//定义TextBox
TextBox txtIndex = new TextBox();
txtIndex.Text =MenuReader["mn_index"].ToString();
txtIndex.Width=20;this.txtSetMenu.Controls.Add(txtIndex);
private void Submit_Click(object sender, System.EventArgs e)
{
//保存时怎么样取TextBox的值!!
}
请问我怎么样取txtIndex里面填写的值?
//定义TextBox
TextBox txtIndex = new TextBox();
txtIndex.Text =MenuReader["mn_index"].ToString();
txtIndex.Width=20;this.txtSetMenu.Controls.Add(txtIndex);
private void Submit_Click(object sender, System.EventArgs e)
{
//保存时怎么样取TextBox的值!!
}
请问我怎么样取txtIndex里面填写的值?
上面写错了。
大哥大姐帮帮忙!strIndex=txtIndex.Text.Trim();可以得到值了。我又定义了:
CheckBox chkMenu = new CheckBox();
chkMenu.Checked =true;这个的值怎么获取啊???
string s=((TextBox)this.txtSetMenu.Controls[0]).Text;
Response.Write(s);string sa=((CheckBox)this.PlaceHolder1.Controls[1]).Checked.ToString();
Response.Write(sa);谢谢大哥!!!