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);
if (result > 0)
{
RegisterStartupScript("提示", "<script>alert('操作成功!');location.href='WebSet.aspx'</script>");
}
else
{
RegisterStartupScript("提示", "<script>alert('操作失败!');</script>");
}
}
}这是一个栏目编辑页面,如果栏目是新增加的话就不会查询到id值,但是如果是编辑原有的栏目的话就回有id值,通过 Request.QueryString方法找到这个值,但是当我点击提交按钮的时候他这个值就没了前台是用的post 方法,然后提交按钮是
<input type="submit" value=" 编辑 " style="padding: 2px 3px" runat="server" onserverclick="addMenu"
id="tijiao" />点击提交的时候在提交事件里就查找不到id这个值了
...全文
相关推荐
html 静态 登陆 注册 页面
静态Html页面,登陆注册 页面优美
h5实现静态的登录页面
最近练习了一下h5等前端知识,写了一个登录页面,上传这里交流学习
php生成静态页面的简单示例
主要介绍了php生成静态页面的简单示例,需要的朋友可以参考下
jQuery Form 页面表单提交的小例子
主要介绍了jQuery Form 页面表单提交的小例子,有需要的朋友可以参考一下
利用ajax提交form表单到数据库详解(无刷新)
大家应该都知道,在静态页面提交表单到数据库很简单就是单纯的 <form action="test.php" method="post"> </form> 这个缺点是会刷新页面,会跳转页面的。 今天给大家带来的技术就是ajax提交表单 优点是不刷新页面,不跳转页面,静默提交的。 至于什么是ajax,自己去百度了解。 首先我们得要有一个表单提交页面: index.html 这个页面由两个部分组成 1、表单控件 2、jQuery+ajax处理脚本 jQuery脚本会获取form表单的数据,通过post的方式提交给api.php <!DOCTYPE HTML PUBLIC "-//W


