473,396 Members | 1,894 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Request Object

I am trying to access in Javascript within an ASP.NET web page the Request
Object. I am specifically trying to access the values in the
Request.QueryString. When I try to access the values I get an error
specifying that the Request object is undefined... The Jscript code is as
follows:

alert(Request.QueryString("CASE")[1]);

In any thoughts or am Is my syntax incorrect. I need to be able to access
the QueryString from within jscript...

Thanks in advance

Nov 19 '05 #1
8 2074
"=?Utf-8?B?QW5nZWw=?=" <An***@discussions.microsoft.com> wrote in
news:7A**********************************@microsof t.com:
alert(Request.QueryString("CASE")[1]);

In any thoughts or am Is my syntax incorrect. I need to be able to
access the QueryString from within jscript...


In basic javascript ... there is no request object. You need to parse the
query string yourself.

But maybe Microsoft's Jscript has an extension?

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.

Newmarket Volvo Sucks! http://newmarketvolvo.tripod.com
Nov 19 '05 #2
How do you get that information otherwise then using the Request Object? So
there is another way besides using the Request Object? If there is does
anyone know how? I would greatly appreciate it.

thanks

"Lucas Tam" wrote:
"=?Utf-8?B?QW5nZWw=?=" <An***@discussions.microsoft.com> wrote in
news:7A**********************************@microsof t.com:
alert(Request.QueryString("CASE")[1]);

In any thoughts or am Is my syntax incorrect. I need to be able to
access the QueryString from within jscript...


In basic javascript ... there is no request object. You need to parse the
query string yourself.

But maybe Microsoft's Jscript has an extension?

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.

Newmarket Volvo Sucks! http://newmarketvolvo.tripod.com

Nov 19 '05 #3
JavaScript is on the client side. The client sends an HTTP Request to the
server. The server side classes can see the Request. They send a Response to
the client as a Web Page. So, JavaScript is client-side, and ASP.Net is
server-side, and never the twain shall meet. All they can do is send
messages back and forth, via Request and Response.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"Angel" <An***@discussions.microsoft.com> wrote in message
news:FA**********************************@microsof t.com...
How do you get that information otherwise then using the Request Object?
So
there is another way besides using the Request Object? If there is does
anyone know how? I would greatly appreciate it.

thanks

"Lucas Tam" wrote:
"=?Utf-8?B?QW5nZWw=?=" <An***@discussions.microsoft.com> wrote in
news:7A**********************************@microsof t.com:
> alert(Request.QueryString("CASE")[1]);
>
> In any thoughts or am Is my syntax incorrect. I need to be able to
> access the QueryString from within jscript...


In basic javascript ... there is no request object. You need to parse the
query string yourself.

But maybe Microsoft's Jscript has an extension?

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.

Newmarket Volvo Sucks! http://newmarketvolvo.tripod.com

Nov 19 '05 #4
Kevin Spencer wrote:
JavaScript is on the client side. The client sends an HTTP Request to
the server. The server side classes can see the Request. They send a
Response to the client as a Web Page. So, JavaScript is client-side,
and ASP.Net is server-side, and never the twain shall meet. All they
can do is send messages back and forth, via Request and Response.


Although you could look into AJAX or XMLHttp to get the data.

--
Jim Cheshire
JIMCO Software
http://www.jimcosoftware.com

FrontPage add-ins for FrontPage 2000 - 2003


Nov 19 '05 #5
We can populate JavaScript variables using QueryString values on the server.
One example of how is shown by this VB example [1] at the very bottom of the
page.

<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/

[1] http://aspnet.4guysfromrolla.com/art...30202-1.2.aspx


"Angel" <An***@discussions.microsoft.com> wrote in message
news:FA**********************************@microsof t.com...
How do you get that information otherwise then using the Request Object?
So
there is another way besides using the Request Object? If there is does
anyone know how? I would greatly appreciate it.

thanks

"Lucas Tam" wrote:
"=?Utf-8?B?QW5nZWw=?=" <An***@discussions.microsoft.com> wrote in
news:7A**********************************@microsof t.com:
> alert(Request.QueryString("CASE")[1]);
>
> In any thoughts or am Is my syntax incorrect. I need to be able to
> access the QueryString from within jscript...


In basic javascript ... there is no request object. You need to parse the
query string yourself.

But maybe Microsoft's Jscript has an extension?

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.

Newmarket Volvo Sucks! http://newmarketvolvo.tripod.com

Nov 19 '05 #6
clintonG wrote:
We can populate JavaScript variables using QueryString values on the
server. One example of how is shown by this VB example [1] at the
very bottom of the page.

<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/

[1] http://aspnet.4guysfromrolla.com/art...30202-1.2.aspx


That code obviously requires a postback. I think the original poster was
asking about how to avoid the postback.

--
Jim Cheshire
JIMCO Software
http://www.jimcosoftware.com

FrontPage add-ins for FrontPage 2000 - 2003


Nov 19 '05 #7
"JIMCO Software" <co*******@jimcosoftware.com> wrote in
news:OW**************@TK2MSFTNGP10.phx.gbl:
Kevin Spencer wrote:
JavaScript is on the client side. The client sends an HTTP Request to
the server. The server side classes can see the Request. They send a
Response to the client as a Web Page. So, JavaScript is client-side,
and ASP.Net is server-side, and never the twain shall meet. All they
can do is send messages back and forth, via Request and Response.


Although you could look into AJAX or XMLHttp to get the data.


You can use this javascript function to parse the query string:

function getParameter(queryString, parameterName)
{
// Add "=" to the parameter name (i.e. parameterName=value)
var parameterName = parameterName + "=";
if ( queryString.length > 0 )
{
// Find the beginning of the string
begin = queryString.indexOf ( parameterName );
// If the parameter name is not found, skip it, otherwise
return the value
if ( begin != -1 )
{
// Add the length (integer) to the beginning
begin += parameterName.length;
// Multiple parameters are separated by the "&" sign
end = queryString.indexOf ( "&" , begin );
if ( end == -1 )
{
end = queryString.length
}
// Return the string
return unescape ( queryString.substring ( begin, end ) );
}
// Return "null" if no parameter has been found
return "null";
}
}

ScriptID = getParameter(window.top.location.search, "ScriptID");
--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.

Newmarket Volvo Sucks! http://newmarketvolvo.tripod.com
Nov 19 '05 #8
Why don't you look at the topic "2.0 beta 2: Disappearing Controls" to
determine if you can help me debug the problem I've described?

<%= Clinton Gallagher

"JIMCO Software" <co*******@jimcosoftware.com> wrote in message
news:uS****************@TK2MSFTNGP15.phx.gbl...
clintonG wrote:
We can populate JavaScript variables using QueryString values on the
server. One example of how is shown by this VB example [1] at the
very bottom of the page.

<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/

[1] http://aspnet.4guysfromrolla.com/art...30202-1.2.aspx


That code obviously requires a postback. I think the original poster was
asking about how to avoid the postback.

--
Jim Cheshire
JIMCO Software
http://www.jimcosoftware.com

FrontPage add-ins for FrontPage 2000 - 2003

Nov 19 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Christopher Brandsdal | last post by:
Hi! I get an error when I run my code Is there any other way to get te information from my form? Heres the error I get and the code beneath. Line 120 is market with ''''''''''''Line...
4
by: Gerhard Pretorius | last post by:
ON Win 2003 IIS6, Since yesterday, (12 Aug 2003) for some strange reason, (after installing WindowsServer2003-KB823980-x86-ENU.exe) I cannot pass the Request object to to VB COM DLL. I have...
2
by: RobertHillEDS | last post by:
While using the Soap generated ASP code, I would like to dump the raw contents of the request and response objects using Response.AppendToLog. I have tried using variations of the following code,...
0
by: Frank 'Olorin' Rizzi | last post by:
Hello everyone. This is quite convoluted, but I'll try to make it simple. I have a couple of bottom-line questions (I guess): 1~ what happens between the Page_Load routine in the code behind...
8
by: CDARS | last post by:
Hi all, I have a confusing question on ASP.NET cookies usage: 1> Response.Cookies("test").value = Now 2> Response.Write(Request.Cookies("test").value) 3> 4> Response.write("<hr>") 5>...
7
by: =?Utf-8?B?QVRT?= | last post by:
HOWTO Make CStr for JavaScript on ASP w/ Request.Form and QueryString In ASP, Request.Form and Request.QueryString return objects that do not support "toString", or any JavaScript string...
6
by: santhoskumara | last post by:
How to request to servlet from Ajax and also I got the DOM object in the servlet through Business Logic. Now how will i pass the DOM object from serlvet to Clientside. Where in the client Side i am...
4
by: Olivier Matrot | last post by:
Hello, I have a problem with an ASP.NET 2.0 Application. A client request is processed in parrallel by two threads. This ends with the following exception : <Source>System</Source> <StackTrace...
5
by: chromis | last post by:
Hi there, I've recently been updating a site to use locking on application level variables, and I am trying to use a commonly used method which copies the application struct into the request...
5
by: Rory Becker | last post by:
I have had code in my Application_Start which is intended to run once at the start of my application's life. It loads connection information and similar from a known location. However I...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.