[转]Dropdownlist doesn't postback after Page_ClientValidate()
本文转自:http://stackoverflow.com/questions/2083929/dropdownlist-doesnt-postback-after-page-clientvalidate
Update: I have just found the solution. The following function works (remove the else part):
But I am wondering why it doesn't work when I add the else part. Question: I want to have a confirm dialog after user fills in all the data in the form. I set onclientclick="return confirmSubmit()" in the submit button.
If Page_ClientValidate("Group1") returns false, the dropdownlist doesn't cause postback after I first select the item, and the postback only occurs when I select the dropdownlist second time. What's the problem? |
|||||||||
|
After Page_ClientValidate is called, the variable Page_BlockSubmit gets set to true, which blocks the autopost back. Page_BlockSubmit was getting reset to false on the second click, for what reasons I still don't fully understand. I'm looking more into this, but I have a solution and I'm under the gun so I'm rolling with it.... Just add below code in the code block which executes if Page is not valid.
e.g.
|
[转]Dropdownlist doesn't postback after Page_ClientValidate()的更多相关文章
- 解决dropdownlist postback 在 iphone UIwebview 失效的问题
原因: IPhone UIWebView 的 用户代理 User Agent 在ASP.NET 4.0环境下是不识别的:所以ASP.NET提供了一个默认的,低级的不包括javascript的页面版本 ...
- "不能在 DropDownList 中选择多个项。"其解决办法及补充
探讨C#.NET下DropDownList的一个有趣的bug及其解决办法 摘要: 本文就C#.Net 环境下Web开发中经常使用的DropDownList控件的SelectedIndex属性进行了详细 ...
- IsPostBack and DropdownList.
Encounted the issue accident when helping my classmate dealing with his homework assignment,it turns ...
- Asp.net中Postback及Callback
我们知道,在默认的情况下,当我们点击Asp.net Page中的一个服务器Button时(默认其实是Submit Form),会导致Page被Recreated,这个过程我们称之为Postback,它 ...
- jQuery UI Autocomplete Combobox 配 ASP.NET DropDownList
0.引言 1.起因 一开始使用Autocomplete做了一个自动补全的文本框,如上图.后来因业务需要希望能在这个文本框的边上做个下拉列表按钮,一按就展开所有支持 ...
- Understanding The Complete Story of Postback in ASP.NET
https://docs.microsoft.com/zh-cn/dotnet/api/system.web.ui.page.ispostback?view=netframework-4.7 http ...
- Asp.Net 将枚举类型(enum)绑定到ListControl(DropDownList)控件
在开发过程中一些状态的表示使用到枚举类型,那么如何将枚举类型直接绑定到ListControl(DropDownList)是本次的主题,废话不多说了,直接代码: 首先看工具类代码: /// <su ...
- DropDownList 下拉框选择改变,促发事件和防全局刷新(记录)
代码: <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:Script ...
- DropDownList实现可输入可选择
1.js版本 <div style="z-index: 0; visibility: visible; clip: rect(0px 105px 80px 85px); positio ...
随机推荐
- AWS CloudFront CDN直接全站加速折腾记The request could not be satisfied. Bad request
ERROR The request could not be satisfied. Bad request. Generated by cloudfront (CloudFront) Request ...
- Hybrid框架UI重构之路:二、事出有因
上文回顾:Hybird框架UI重构之路:一.师其长技以自强 一切的重构都是有原因的,或许为了更快速度.更好体验.更快捷开发等,于是就有了自己的开发目标,简单看看未重构前UI("中国移动式&q ...
- css命名书写规范小结。
单行形式书写风格的排版约束 1. 每一条规则的大括号 { 前后加空格 2. 多个selector共用一个样式集,则多个selector必须写成多行形式 3. 每一条规则结束的大括号 } 前 ...
- ORACLE -- ArcSDE Lock request conflicts with an established lock【转】
具体的解决办法有如下三种 1.多半情况下关闭数据库连接可以解决这个问题,但有时候问题依然存在. 2. >1.关闭所有的ArcMap和ArcCatalog session. >2.开始——运 ...
- cocoapods安装完第三方类库后不生成workspace
cocoapods的版本太低,更新cocoapod版本:sudo gem install cocoa pods
- 改变Android ProgressBar样式颜色
地址: http://blog.csdn.net/lvxiangan/article/details/9110121
- Android 判断SIM卡属于哪个移动运营商
第一种方法:获取手机的IMSI码,并判断是中国移动\中国联通\中国电信 TelephonyManager telManager = (TelephonyManager) getSystemServic ...
- Android 在不同Actitity之间数据传递
本文实现一个简易的人品计算器来实践在不同Actitity之间数据传递 intent的数据传递 从A界面打开B界面 把A界面的数据传递给B界面 1. intent.setData(uri) -- int ...
- 【iOS】WebView加载HTML图片大小自适应与文章自动换行
在很多App中都会使用到webview,尤其是在加载新闻内容等文章形式的数据时.因为图文混编以及不同字体格式的显示,在iOS进行编辑 和显示都是一大问题(当然,iOS中也可以用CoreText进行绘制 ...
- 【代码笔记】iOS-提醒时间的选择
一,效果图. 二,工程图. 三,代码. RootViewController.h #import <UIKit/UIKit.h> @interface RootViewController ...