ASP.NET postback with jQuery?(使用 jQuery 的 ASP.NET 回发?)
问题描述
我有一个 ASP.NET 按钮,但最近,我将其替换为标准 HTML 按钮......我需要做的是回发到 ASP.NET 页面并确保调用了一个方法.
I have a ASP.NET button but recently, I replaced it with a standard HTML button ... What I need to do is a postback to an ASP.NET page and ensure a method is called.
上一个按钮是一个 ASP.NET 按钮,所以我有这个事件:
The previous button was an ASP.NET button, so I had this event:
Protected Sub btnCancelar_Click(ByVal sender As Object, ByVal e As System.EventArgs)
UtilTMP.DisposeObjects()
Server.Transfer("~Forms est.aspx", True)
End
但是我使用的是带有 JavaScript ALERT 的按钮,并且我最近更改为 jQuery UI 模态对话框,但它没有等我回答问题..回发立即发生...所以我决定更改为一个标准的 HTML 按钮……但我需要回发到 ASP.NET 页面并调用类似的方法.
But I was using a button with a JavaScript ALERT and I recently changed to a jQuery UI Modal dialog but it doesn't wait for me to answer the question.. the postback happenes immediatly ... so I decided to change to a standard HTML button ... but I need to postback to the ASP.NET page and call a method like.
如果我只是回发它不会调用清理
If I just postback it won't call the cleanup
Protected Sub Cleanup()
UtilTMP.DisposeObjects()
Server.Transfer("~Forms est.aspx", True)
End
推荐答案
虽然您可以使用 JQuery 进行回发,但调用 Web 方法(页面中的 Web 服务)可能会更好.调用也可能更快,因为您没有发布整个页面 ViewState.
While you can do Postbacks with JQuery, it might be better to call a web method (web service that is in your page). The call could also be faster because you are not posting the entire page ViewState.
这篇关于使用 jQuery 的 ASP.NET 回发?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:使用 jQuery 的 ASP.NET 回发?


基础教程推荐
- 错误“此流不支持搜索操作"在 C# 中 2022-01-01
- 全局 ASAX - 获取服务器名称 2022-01-01
- 是否可以在 asp classic 和 asp.net 之间共享会话状态 2022-01-01
- 在 VS2010 中的 Post Build 事件中将 bin 文件复制到物 2022-01-01
- 将事件 TextChanged 分配给表单中的所有文本框 2022-01-01
- 经典 Asp 中的 ResolveUrl/Url.Content 等效项 2022-01-01
- 如何动态获取文本框中datagridview列的总和 2022-01-01
- 从 VS 2017 .NET Core 项目的发布目录中排除文件 2022-01-01
- JSON.NET 中基于属性的类型解析 2022-01-01
- 首先创建代码,多对多,关联表中的附加字段 2022-01-01