S
SedativeChunk
Guest
This should be a simple thing to fix for anyone good with AJAX/Javascript and ASP.net. I'm trying to send a variable to an ASP.net page named variable and return the value to the current page. Here's the Javascript code to look at:
var blog_id = 1;
var url = "comments.aspx?blog_id=" + escape(blog_id);
xmlHttp.open("GET", url, true);
xmlHttp.send(null);
On the ASP.net page, I have the following:
Dim blog_id As String = Request.QueryString(blog_id)
Response.Write("The blog ID is " & blog_id)
The ASP.net page properly communicates with the main page but does not print the blog_id. All I see is this:
The Blog ID is
The ASP.net page is not properly collecting the blog_id variable. Note, I've also tried without the escape function:
var url = "comments.aspx?blog_id=" + blog_id;
How can I pass this variable to the other page? What am I doing wrong? I've tested the blog_id variable with the alert function to check it's value and it's declaring right (it's actually be passed through a function) and it works right up until I try to pass it to that page!
Sorry for long description, I will pick best answer if it works!
Someone just answered about the quotes in the query string. I actually have the Request.QueryString("blog_id") in my original code, I forgot to put them on here. This is not the problem.
var blog_id = 1;
var url = "comments.aspx?blog_id=" + escape(blog_id);
xmlHttp.open("GET", url, true);
xmlHttp.send(null);
On the ASP.net page, I have the following:
Dim blog_id As String = Request.QueryString(blog_id)
Response.Write("The blog ID is " & blog_id)
The ASP.net page properly communicates with the main page but does not print the blog_id. All I see is this:
The Blog ID is
The ASP.net page is not properly collecting the blog_id variable. Note, I've also tried without the escape function:
var url = "comments.aspx?blog_id=" + blog_id;
How can I pass this variable to the other page? What am I doing wrong? I've tested the blog_id variable with the alert function to check it's value and it's declaring right (it's actually be passed through a function) and it works right up until I try to pass it to that page!
Sorry for long description, I will pick best answer if it works!
Someone just answered about the quotes in the query string. I actually have the Request.QueryString("blog_id") in my original code, I forgot to put them on here. This is not the problem.