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 回发?
基础教程推荐
- 如何激活MC67中的红灯 2022-01-01
- rabbitmq 的 REST API 2022-01-01
- 有没有办法忽略 2GB 文件上传的 maxRequestLength 限制? 2022-01-01
- 将 Office 安装到 Windows 容器 (servercore:ltsc2019) 失败,错误代码为 17002 2022-01-01
- c# Math.Sqrt 实现 2022-01-01
- SSE 浮点算术是否可重现? 2022-01-01
- 为什么Flurl.Http DownloadFileAsync/Http客户端GetAsync需要 2022-09-30
- 如何在 IDE 中获取 Xamarin Studio C# 输出? 2022-01-01
- 将 XML 转换为通用列表 2022-01-01
- MS Visual Studio .NET 的替代品 2022-01-01