问题描述
我有一个非常简单的jquery $ .get,它调用一个aspx.vb页面。
我用输入按钮调用newList javascript函数。工作正常,.aspx.vb也可以正常工作并返回到javascript函数。没有报告错误。
问题是我无法运行两次。 newList函数将被调用,但$ .get将不会被处理第二(或第三或第四......)时间。没有错误,它只是吹嘘.get。 .aspx.vb检查文件是否存在并删除它。即使我将代码删除到零,我也无法让$ .get再次运行。
嗯?
我尝试过:
function newList(){
$ .get(BufferDownLoad.aspx?type = newAddList,函数(结果){
});
}
Page_load事件中的VB.NET代码 - >
如果Request.QueryString.Item(type)=newAddList那么
如果File.Exists(C:\ inetpub \wwwroot \SummitMap1Local \Labels\AddData_+ Session.SessionID.Substring(0,5)+。txt)然后
File.Delete(C:\inetpub \ www.root \SummitMap1Local \ Labels \AddData_+ Session.SessionID.Substring(0,5)+。txt)
结束如果
响应。 ContentType =text
Response.Write(文件已删除)
结束如果
I have a very simple jquery $.get that calls an aspx.vb page.
I call the newList javascript function with an input button. Works fine, the .aspx.vb works fine too and returns to the javascript function. No errors are reported.
The problem is that I can't run it twice. The newList function will get called, but the $.get will not get processed a second (or third or fourth...) time. No errors, it just blows by the .get. The .aspx.vb checks to see if a file exists and deletes it. Even if I strip the code down to nothing I can't get the $.get to run a second time.
Huh?
What I have tried:
function newList() {
$.get("BufferDownLoad.aspx?type=newAddList", function (result) {
});
}
VB.NET code in the Page_load event ->
If Request.QueryString.Item("type") = "newAddList" Then
If File.Exists("C:\inetpub\wwwroot\SummitMap1Local\Labels\AddData_" + Session.SessionID.Substring(0, 5) + ".txt") Then
File.Delete("C:\inetpub\wwwroot\SummitMap1Local\Labels\AddData_" + Session.SessionID.Substring(0, 5) + ".txt")
End If
Response.ContentType = "text"
Response.Write("File Deleted")
End If
推荐答案
这篇关于Jquery $ .get只运行一次。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!