我有一个jQuery UI Dialog在我的ASP.NET页面上工作得很好:
jQuery(function() {
jQuery("#dialog").dialog({
draggable: true,
resizable: true,
show: 'Transfer',
hide: 'Transfer',
width: 320,
autoOpen: false,
minHeight: 10,
minwidth: 10
});
});
jQuery(document).ready(function() {
jQuery("#button_id").click(function(e) {
jQuery('#dialog').dialog('option', 'position', [e.pageX + 10, e.pageY + 10]);
jQuery('#dialog').dialog('open');
});
});
Run Code Online (Sandbox Code Playgroud)
我的div:
<div id="dialog" style="text-align: left;display: none;">
<asp:Button ID="btnButton" runat="server" Text="Button" onclick="btnButton_Click" />
</div>
Run Code Online (Sandbox Code Playgroud)
但btnButton_Click永远不会被调用......我该如何解决?
更多信息:我添加了此代码以将div移动到表单:
jQuery("#dialog").parent().appendTo(jQuery("form:first"));
Run Code Online (Sandbox Code Playgroud)
但仍然没有成功......
当我从客户端发回页面时,我收到以下错误.我有JavaScript代码修改客户端的asp:ListBox.
我们如何解决这个问题?
错误详情如下:
Server Error in '/XXX' Application.
--------------------------------------------------------------------------------
Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.
Description: An unhandled exception occurred …
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用ASP.NET创建一个异步回发__doPostBack()
,但我不知道如何做到这一点.我想使用vanilla JavaScript.
像按钮单击这样简单的东西会导致__doPostBack()
事件触发.我只是想了解这种机制是如何运作的.
我正在进入Web开发,并且看到了postback抛出的单词.来自非基于Web的背景,新的Web开发人员必须了解有关回发的内容吗?(即它们是什么以及它们何时出现?)
您希望分享的任何其他信息,以帮助网络世界的新手了解回发将是非常感谢.
我不断听到这句话" 回调 "和" 回发 "左右颠簸.
两个有什么区别?
回发是非常特定的ASP.NET页面?
我有几个小的div
s利用jQuery
draggable.这些div
被放置在一个UpdatePanel
,并在拖动器上我使用_doPostBack()
JavaScript函数.我从页面表格中提取必要的信息.
我的问题是,当我调用此函数时,整个页面被重新加载,但我只想重新加载更新面板.
如果我.
通过$ _GET PHP在其名称中传递PHP变量,则自动用_
字符替换它们.例如:
<?php
echo "url is ".$_SERVER['REQUEST_URI']."<p>";
echo "x.y is ".$_GET['x.y'].".<p>";
echo "x_y is ".$_GET['x_y'].".<p>";
Run Code Online (Sandbox Code Playgroud)
...输出以下内容:
url is /SpShipTool/php/testGetUrl.php?x.y=a.b
x.y is .
x_y is a.b.
Run Code Online (Sandbox Code Playgroud)
......我的问题是这样的:有什么方法可以阻止它吗?不能为我的生活弄清楚我做了什么值得这样做
我运行的PHP版本是5.2.4-2ubuntu5.3.
一位同事告诉我这个:
他有一个DropDownList和一个网页上的按钮.这是背后的代码:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
ListItem item = new ListItem("1");
item.Attributes.Add("title", "A");
ListItem item2 = new ListItem("2");
item2.Attributes.Add("title", "B");
DropDownList1.Items.AddRange(new[] {item, item2});
string s = DropDownList1.Items[0].Attributes["title"];
}
}
protected void Button1_Click(object sender, EventArgs e)
{
DropDownList1.Visible = !DropDownList1.Visible;
}
Run Code Online (Sandbox Code Playgroud)
在页面加载时,项目的工具提示正在显示,但在第一次回发时,属性将丢失.为什么会这样,有没有解决方法?
我有一个如下按钮,
<asp:Button ID="pagerLeftButton" runat="server" OnClientClick="disable(this)" onclick="pager_Left_Click" Text="<" />
Run Code Online (Sandbox Code Playgroud)
当我使用我的按钮时,onclick不会触发.当我删除OnClientClick时,然后触发onclick.
我需要做的是,在回发期间禁用按钮并在回发结束后启用它.
编辑:附加信息:
我添加了断点,我的触发功能是c#部分,我正在调试,他们肯定没有开火.那些功能就像
protected void pager_Left_Click(object sender, EventArgs e)
{
//Do smthing.
}
protected void pager_Right_Click(object sender, EventArgs e)
{
//Do smthing.
}
Run Code Online (Sandbox Code Playgroud)
当我点击我的按钮时,它被禁用1-2秒并自动启用,但我不确定为什么它被启用.我没有添加任何部分,以便再次启用它.
我正在使用ajax和asp.net.我有一个javascript函数,它使用setTimeout创建许多其他javascript函数.发生异步回发后,我想禁用所有这些setTimeouted事件.我怎样才能做到这一点?
postback ×10
asp.net ×7
javascript ×4
c# ×3
.net ×1
.net-2.0 ×1
asynchronous ×1
behavior ×1
callback ×1
jquery ×1
jquery-ui ×1
listitem ×1
onclick ×1
php ×1
regex ×1
settimeout ×1
updatepanel ×1
webforms ×1