问题标签 [autopostback]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
asp.net - 必须在 asp.net 中单击两次按钮(在自动回发文本框之后)
在我的页面上:
在 EmailTextBox_Changed 中,它会在运行搜索之前计算可以找到的电子邮件数量。
问题是,当您在 EmailTextBox 中键入内容并单击按钮时,您必须单击两次才能获得实际结果。这是因为第一次单击是从文本框中执行“AutoPostBack”部分,然后您必须再次单击才能使实际的单击回发发生。
在不删除“AutoPostBack=true”的情况下,如何在这些情况下停止它需要两次点击?
asp.net - ASP.NET MVC 自动回发下拉不工作
使用以下代码:
...
我究竟做错了什么?
c# - DropDownList switches from Spanish into English?
Why would a DropDownList switch from Spanish into English when one selects a new item in it? And how does one prevent that from happening?
Then in Page_Load()
, this always runs (i.e., both as IsPostBack
and !IsPostBack
):
When you first come to this page after having chosen Spanish as your language, the dropdown is populated with the ListItems texts displaying -- as expected -- in Spanish. But when you go to select another item from the dropdown, all the items come back in English!
When you examine the dropdown before the AutoPostBack (both server-side and in FireBug), each ListItem is properly set, as in
whereas after the PostBack, it looks like
Why is this happening, and what can I do to get it to keep the Spanish one sees before any PostBacks?
Notes:
- The routine pointed to in
OnSelectedIndexChanged
is currently commented out, so the problem is not there. - I added
EnableViewState="true"
to the DropDownList, but that didn't make any difference, so I removed it. - As suggested below by Ichiban, I moved setting the
Thread.CurrentThread.CurrentUICulture
fromPage_Load
toPage_Init()
, but that too didn't make any difference.
asp.net - ASP.NET No postback on asp:ImageButton
I have an ASP page with an asp:DropDownList (with AutoPostBack="true") so that when the user changes it, it reload the appropriate data.
Under that control i have a list of UserControls, that includes a tinymce editor (tied to an asp:TextBox) and an asp:ImageButton to save the data.
When clicking on the ImageButton, the applications send the postback data via ajax to the same page (__EVENTARGUMENT, __EVENTTARGET, etc...). Why does it load that ajax page, and how do i prevent it? I'm updating the value in the DB in the OnClick event handler on the ImageButton, so all I need to do, is get ride of that ajax call.
Any ideas?
.net - 将 AutoPostback 添加到 DropdownList 时出现 System.ArgumentNullException
当我将 AutoPostback = True 添加到我的 DropDownList (使用 OnSelectedIndexChanged)时,我得到一个 System.ArgumentNullException: Value cannot be null。
我的控件如下所示:
以及填充控件的代码:
更新
在使用以下代码添加空页面时,我也收到错误消息:
c# - C#:根据确认对话框防止 AutoPostBack
当在 asp:DropDownList 中选择特定值时,我想显示一个确认对话框。如果确认对话框返回 false(取消),那么我想阻止 AutoPostBack。
但是,它忽略了 foo() 的返回值并实际上进行了回发。
onchange 事件的生成代码为:
富();setTimeout("__doPostBack('theDropDownID','')", 0);
所以基本上控制 .net 添加的 setTimeout 就可以完成这项工作。
知道怎么做吗?
谢谢!
jquery - 第二次单击 updatePanel 中的按钮,事件不会在 jQuery 中触发
在我的 aspx 文件中,我有:
在我的 JavaScript 文件中,我有:
但只有第一次点击按钮,我得到了alert('hello')
,之后没有更多的警报消息。
c# - 处理以编程方式添加到页面的控件触发的事件?
我以编程方式将控件添加到 aspx 页面并将服务器端事件绑定到控件内的索引更改事件。(它是 Telerik 的 ASP.NET 控件中的 RadListBox) 问题是在控件触发的回发时,该事件不会触发其事件处理程序,因为在回发时未定义控件。
有没有办法处理这个问题,而不必追溯之前采用的逻辑并重建控件以便处理源自它的事件?
什么是正确的方法?
c# - Autopostback 和 doPostBack 冲突
我已经启用了AutoPostBack
我的表单文本框之一的属性,根据w3 学校的说法,它应该只在我按 enter 或 tab 时触发回发。
__doPostBack()
鉴于用户对 javascript 提示的回答,我还调用了on pageLoad。当我这样做时,这Request.Form['__EventTarget']
不是我在调用中设置的__doPostBack
。
对我来说真正的问题是,如果我将 TextBox 的 AutoPostBack 属性设置为 false,页面加载 __doPostBack 调用的问题就会消失。这不是我预期的行为。关于导致问题的任何想法?为什么启用 AutoPostBack 会有任何影响?
这是一些代码:
然后在代码隐藏页面中:
但是,我不断得到它Request.Form["__EventTarget"]
,","
并且我已经在调试器中逐步完成了 javascript。就在之前form.submit()
,争论不是","
javascript - 使用“AutoPostBack=false”,如何触发在运行一些 JavaScript 后执行的回发?
使用AutoPostBack=false
,如何触发在运行一些 JavaScript 后执行的回发?