473,811 Members | 2,586 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HTTPRequest Querystring Exception

1 New Member
I am attempting to use a simple querystring passed from a VB application into my aspx page, ASP .NET 2.0. The following error appears no matter how it is arranged as suggested in the forum search results for similar problems:
---------------------------------------------------------
Exception Details: System.Web.Http Exception: Request is not available in this context

Source Error:
Line 48: Public Sub Run()
Line 49:
Line 50: param = Request.QuerySt ring("name") <-------------
Line 51: If (param Is Nothing) Then
Line 52: Console.Write(" Query string is null")

Here is the code I'm using:
(code behind page)

Imports System
Imports System.Data
Imports System.Data.Ole Db
Imports System.XML
Imports System.Web
Imports Microsoft.Visua lBasic
Imports System.IO

Namespace Security.Landin g
Class _Default
Inherits System.Web.UI.P age
Public param As String
Public Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArg s) Handles MyBase.Load
Dim writer As StringWriter
writer = New StringWriter
Console.SetOut( writer)
Dim myemployees As _Default
myemployees = New _Default
myemployees.Run ()
output.InnerHtm l = writer.ToString ()
End Sub

Public Shared Sub Main()
Dim myemployees As _Default
myemployees = New _Default
myemployees.Run ()
End Sub

Public Sub Run()
param = Request.QuerySt ring("name") <-------------------------
If (param Is Nothing) Then
Console.Write(" Query string is null")
Else
Console.Write(" Name: " + param.ToString)
End If
End Sub
End Class
End Namespace
--------------------------------
Does anyone see the error of my ways?

Many Thanks
Apr 12 '07 #1
1 2207
padmakar
14 New Member
i think request or response doesnt work on a seperate vb application.how ever you can use it in aspx.vb page
Apr 14 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
4641
by: HikksNotAtHome | last post by:
In Mozilla 1.4b, when the URL is set to a local URL, it works as expected. function showIt(){ var xmlhttp = new XMLHttpRequest(); xmlhttp.open("GET", "blank.html" ,true); xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4) { document.myForm.outputSource.value = xmlhttp.responseText; } }
1
4890
by: Mark Miller | last post by:
I just recently started getting the above error on a page I am posting MULTIPART/FORM-DATA. We have SoftArtisans FileUp component and Filter installed on the server in question and up until a day or so ago everything was working fine. I honestly can't remember changing anything since it was last working. But I tried reinstalling the .Net Framework along w/ the service pack, which didn't work. I also had v1.1 already installed but I hadn't...
2
18104
by: Kevin | last post by:
I am attempting to fetch the value of a paramter passed in on the http request url. Example: http://localhost.mypage.aspx?ID=12345 In the URL above I am wanting to retrieve the value of the key ID. When I execute the code below I am getting the entire URL and not just the value of the key ID. Any suggestions? string idValue = Request.Params.Get("ID");
3
3513
by: Mark | last post by:
Hello Can anyone tell me how to check if a a querystring is present or not I.E. If request.querystring("key") is in the url or not because when i try to reference it in anyway and its not there I get an error there has to be an easier way then having to put all the checks in a try catch statement
1
1577
by: Mark | last post by:
Hello Can anyone tell me how to check if a a querystring is present or not I.E. If request.querystring("key") is in the url or not because when i try to reference it in anyway and its not there I get an error there has to be an easier way then having to put all the checks in a try catch statement
11
15898
by: Keith Patrick | last post by:
Could someone explain to me the relationship between these two classes? I am ripping my hair out trying to divert an HttpRequest to a new location via an HttpWebRequest, but I cannot get my session xfer to work, possibly due to the cookies not being compatible. I've spent over a week trying to get the HWR to integrate nicely with my app, but I cannot get the session to transfer, and it'd probably take me even longer if I tried to digest...
6
1708
by: duncan.welch | last post by:
Hi, I've got a website that uses links for page positioning which works great about 99% of the time. For some reason, 1% of the time I'll get an error when parsing the querystring, as it's reading the anchor name as part of the number. e.g. http://www.fluidstyle.co.uk/venuedetails.aspx?venueID=1964#review
1
2851
by: Jeff | last post by:
ASP.NET 2.0 I'm about to program a HttpRequest from my asp.net 2.0 website. I'll request another server using HttpRequest and ask if password etc are okay.... So I've looked into the HttpRequest constructors and cannot see how to use it. public HttpRequest ( string filename, string url,
2
3181
by: zman77 | last post by:
I have a problem with HttpRequest.QueryString. There is an XML string that contains something like the following: <age>8+</age> As you probably guessed, the "+" is the problem :) I want to get that XML string from QueryString, however, the "+" appears as a " " (space), not a "+". I have tried the following: NameValueCollection coll = Request.QueryString; XMLstring = coll.Get("XMLstr"); // result: XMLstring = "<age>8 </age>"
0
9605
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10648
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10135
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...
0
9205
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7670
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
5692
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4339
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3867
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3018
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.