Ext.js入门:常用组件与综合案例(七)

网友投稿 263 2022-09-05

Ext.js入门:常用组件与综合案例(七)

一:datefield简单示例

二:timefield简单示例

三:numberfield简单示例

四:FormPanel提交

datefield简单示例:

timefield简单示例 把上面的例子中datefield改为timefield,效果图:

numberfield简单示例: 把上面的datefield改为numberfield,就只能输入数字了

四:FormPanel提交

示例formpanel如何把数据传给其他页面:

后台代码:

Response.Write(Request["username"].ToString()); Response.Write("
"); Response.Write(Request["smallname"].ToString()); Response.Write("
"); Response.Write(Request["regdate"].ToString());

2.为按钮添加触发相应的提交(取消)事件(这样就不是默认的ajax提交):

buttons:[{text:"确定",handler:login,formBind:true},{text:"取消",handler:reset}] }); function login(){ form.form.submit();//提交 } function reset(){ form.form.reset();//取消 }

3.如果你想绑定验证,在form表单添加参数

monitorValid:true,然后在按钮配置参数中添加formBind:true,如 buttons:[{text:"确定",handler:login,formBind:true},{text:"取消",handler:reset}]

则只有所有的填写字段都满足条件时,"确定"方可提交!

接受页面GetForm.aspx的cs代码为:

protected void Page_Load(object sender, EventArgs e) { string UserName = Request.Form["UserName"]; string SmallName = Request.Form["SmallName"]; string RegDate = Request.Form["RegDate"]; Response.Write(UserName + "
" + SmallName + "
" + RegDate); }

四:综合案例:

后端代码:

string UserName = Request.Form["UserName"]; Response.Write("UserName:"+UserName+"
"); string Sex = Request.Form["Sex"]; Response.Write("Sex:" + Sex + "
"); string BirthDate = Request.Form["BirthDate"]; Response.Write("BirthDate:" + BirthDate + "
"); string Degree = Request.Form["Degree"]; Response.Write("Degree:" + Degree + "
"); string SpringNet = Request.Form["SpringNet"]; Response.Write("SpringNet:" + SpringNet + "
"); string NHibernate = Request.Form["NHibernate"]; Response.Write("NHibernate:" + NHibernate + "
"); string Linq = Request.Form["Linq"]; Response.Write("Linq:" + Linq + "
"); string Email = Request.Form["Email"]; Response.Write("Email:" + Email + "
"); string OneWord = Request.Form["OneWord"]; Response.Write("OneWord:" + OneWord + "
"); string WantToSay = Request.Form["WantToSay"]; Response.Write("WantToSay:" + WantToSay + "
");

附一张错误的解决方案:

配置中加上这句话:

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:失误太多末节被翻盘,中国女篮不敌塞尔维亚无缘四强!
下一篇:Ext.js入门:TabPanel组件(八)
相关文章

 发表评论

暂时没有评论,来抢沙发吧~