473,749 Members | 2,384 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.QuerySt ring. 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.Q ueryString("CAS E")[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 2102
"=?Utf-8?B?QW5nZWw=?=" <An***@discussi ons.microsoft.c om> wrote in
news:7A******** *************** ***********@mic rosoft.com:
alert(Request.Q ueryString("CAS E")[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********@rog ers.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***@discussi ons.microsoft.c om> wrote in
news:7A******** *************** ***********@mic rosoft.com:
alert(Request.Q ueryString("CAS E")[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********@rog ers.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***@discussi ons.microsoft.c om> wrote in message
news:FA******** *************** ***********@mic rosoft.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***@discussi ons.microsoft.c om> wrote in
news:7A******** *************** ***********@mic rosoft.com:
> alert(Request.Q ueryString("CAS E")[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********@rog ers.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***@discussi ons.microsoft.c om> wrote in message
news:FA******** *************** ***********@mic rosoft.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***@discussi ons.microsoft.c om> wrote in
news:7A******** *************** ***********@mic rosoft.com:
> alert(Request.Q ueryString("CAS E")[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********@rog ers.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*******@jimc osoftware.com> wrote in
news:OW******** ******@TK2MSFTN GP10.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(qu eryString, parameterName)
{
// Add "=" to the parameter name (i.e. parameterName=v alue)
var parameterName = parameterName + "=";
if ( queryString.len gth > 0 )
{
// Find the beginning of the string
begin = queryString.ind exOf ( 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.l ength;
// Multiple parameters are separated by the "&" sign
end = queryString.ind exOf ( "&" , begin );
if ( end == -1 )
{
end = queryString.len gth
}
// Return the string
return unescape ( queryString.sub string ( begin, end ) );
}
// Return "null" if no parameter has been found
return "null";
}
}

ScriptID = getParameter(wi ndow.top.locati on.search, "ScriptID") ;
--
Lucas Tam (RE********@rog ers.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*******@jimc osoftware.com> wrote in message
news:uS******** ********@TK2MSF TNGP15.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
10335
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 120''''''''''''''''''''' ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
4
11588
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 a funciton inVB DLL Function BuildSqlWhereFromHTML(ByRef AspReq As ASPTypeLibrary.Request, _ ByRef AspSes As ASPTypeLibrary.Session) As String
2
4100
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, but I may be barking up the wrong tree with this approach. Any expert help would greatly be appreciated. Dim objReader Set objReader = CreateObject("MSSOAP.SoapReader") objReader.Load Request
0
2524
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 of an aspx page and the presentation of the page to the user? 2~ is it true that the engine takes data from the Request.Form and puts them
8
2342
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> 6> Response.Cookies("test").value = Now.AddDays(10)
7
9661
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 operation on parameters not passed. Example: Make a TST.asp and post to it as TST.asp?STATE=TEST <%@ Language=JavaScript %> <%
6
4978
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 using Ajax. kindly advice me.
4
2708
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 at System.Collections.Specialized.ListDictionary.Add(Object key, Object value) at System.Web.UI.ClientScriptManager.RegisterScriptBlock(ScriptKey key, String script, ListDictionary&amp; scriptBlocks, ArrayList&amp; scriptList,
5
6135
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 scope. Application variables are then accessed in this manner Request.App.<Var>. To begin with I had a simple functioning login system inside a subdirectory named admin, this subdirectory had it's own application.cfm, I wasn't sure whether to duplicate...
5
1832
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 recently migrated my app using ------------------------------------------------------------- %systemroot%\system32\inetsrv\APPCMD.EXE migrate config "Default Web Site/YourApp" -------------------------------------------------------------
0
8996
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
9333
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9254
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6800
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6078
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4608
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2217
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.