hopefully easy question

S

SilentCry

i'm doing an XMLHTTP request to a second aspx page from my main page in
order to execute a very simple server-side script that returns a single
value. this actually works but not the way i want it to. i get the value on
return (in request.responseText field) but it's included with the entire
body of the second pages html stream which i don't want. i tried ContentType
of "text/plain" but it didn't work and it does this regardless of whether i
do a Get or Post. how do i get just that single value back in the
responseText field?
keep in mind i'm still kind of new at this.
 
M

Martin Honnen

SilentCry said:
i'm doing an XMLHTTP request to a second aspx page from my main page in
order to execute a very simple server-side script that returns a single
value. this actually works but not the way i want it to. i get the value
on return (in request.responseText field) but it's included with the
entire body of the second pages html stream which i don't want. i tried
ContentType of "text/plain" but it didn't work and it does this
regardless of whether i do a Get or Post. how do i get just that single
value back in the responseText field?
keep in mind i'm still kind of new at this.

That sounds more like a problem on the server with your ASP.NET page.
Instead of a full blown ASP.NET page (.aspx) you probably only want to
implement an ASP.NET handler.
Or you need to make sure that your page does not have any contents
besides the one you write back so you would do so pseudo code would be e.g.
void Page_Load()
{
Response.ContentType = "text/plain";
Response.Write("foo");
Response.End();
}

Ask in an ASP.NET newsgroup or forum if the above does not help.
 
S

SilentCry

Martin Honnen said:
That sounds more like a problem on the server with your ASP.NET page.
Instead of a full blown ASP.NET page (.aspx) you probably only want to
implement an ASP.NET handler.
Or you need to make sure that your page does not have any contents besides
the one you write back so you would do so pseudo code would be e.g.
void Page_Load()
{
Response.ContentType = "text/plain";
Response.Write("foo");
Response.End();
}
didn't use Page_Load (i'm not actually loading the page) but i went in and
commented out the entire html portion of the second page and that did the
trick. thanx for the hint.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,123
Messages
2,570,740
Members
47,296
Latest member
EarnestSme

Latest Threads

Top