日期:2014-05-17  浏览次数:20401 次

post表单时原来页面上的静态字段会清空么?
public partial class Admin_addMenu : System.Web.UI.Page
{
    protected string id;
    protected void Page_Load(object sender, EventArgs e)
    {

        if (!IsPostBack)
        {
            id = Request.QueryString["id"];
            if (id != "" && id != null)
            {
                getList();
                this.tijiao.Value = "编辑";
                DataSet ds = MenuDAL.returnGlobal(id);
                ds = MenuDAL.returnGlobal(id);
                this.title.Value = ds.Tables[0].Rows[0]["Title"].ToString();
                this.link.Value = ds.Tables[0].Rows[0]["pageLink"].ToString();
                this.menuid.Value = ds.Tables[0].Rows[0]["ID"].ToString();
                this.isuse.SelectedIndex = ((ds.Tables[0].Rows[0]["isUse"].ToString().ToLower()) == "true") ? 1 : 0;
                this.myDropdownlist.SelectedValue = ds.Tables[0].Rows[0]["parentID"].ToString();
            }
            else
            {
                this.tijiao.Value = "提交";
                getList();
            }
        }


    }
 protected void addMenu(object sender, EventArgs e)
    {
        string _title = this.title.Value;
        string _link = this.link.Value;
        string _id = this.menuid.Value;
        string _parentid = myDropdownlist.SelectedValue;
        string _isUse = this.isuse.Value;
        int result = (id != null && id != "") ? 1 : -1;
        result = MenuDAL.isSuccess(result, _title, _link, _id, _parentid, _isUse);