I'm having a problem implementing ajax with jquery right now So I want to load text from a file using ajax in conjunction with asp.net, however, if I load a file, write text into that files contents, save the new text into the file, but attempt to load the file again, it loads an older version of the file without the updated text. Debugging the code, it doesn't even seem to send the http request to the server page the second time. Do any of you know what's going on? Thanks in advance.
Code for the load file ajax call:
function loadFile()
{
$.ajax({ url: "LoadFile.aspx", data: {fileName: $("#slctFiles").val()}, success: loadCallBack})
}
and code for LoadFile.aspx:
protected void Page_Load(object sender, EventArgs e)
{
string text = "";
string path;
path = Server.MapPath(@"\MyFiles");
path += "\\"+Request.QueryString["fileName"];
text = File.ReadAllText(path);
string response = "{\"text\":\"" + text + "\"}";
Response.Clear();
Response.Write(response);
Response.End();
}