I am trying to use the the response and request objects in my custom
control, but I keep getting an error that the objects have not been
referenced. I have put in a using statement for System.Web to gain access to
HttpRequest and HttpResponse, but that is really not helping. Can someone
please give me some insight here? 6 2082
Jeremy,
The Request and the Response are not exposed by the Control class.
Rather, you can get them through the Page property, or you can get them
through the HttpContext instance returned by the static Current property on
the HttpContext class.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Jeremy Ames" <yo******@here.com> wrote in message
news:O8**************@TK2MSFTNGP10.phx.gbl... I am trying to use the the response and request objects in my custom control, but I keep getting an error that the objects have not been referenced. I have put in a using statement for System.Web to gain access
to HttpRequest and HttpResponse, but that is really not helping. Can someone please give me some insight here?
Can you give an example? I have tried using Page.Response and Page.Request
but I get another error.
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:eV**************@TK2MSFTNGP11.phx.gbl...
Jeremy,
The Request and the Response are not exposed by the Control class.
Rather, you can get them through the Page property, or you can get them
through the HttpContext instance returned by the static Current property on
the HttpContext class.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Jeremy Ames" <yo******@here.com> wrote in message
news:O8**************@TK2MSFTNGP10.phx.gbl... I am trying to use the the response and request objects in my custom control, but I keep getting an error that the objects have not been referenced. I have put in a using statement for System.Web to gain access
to HttpRequest and HttpResponse, but that is really not helping. Can someone please give me some insight here?
Jeremy,
Can you be more specific about the error you are getting?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Jeremy Ames" <yo******@here.com> wrote in message
news:Oc**************@TK2MSFTNGP10.phx.gbl... Can you give an example? I have tried using Page.Response and Page.Request but I get another error.
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote
in message news:eV**************@TK2MSFTNGP11.phx.gbl... Jeremy,
The Request and the Response are not exposed by the Control class. Rather, you can get them through the Page property, or you can get them through the HttpContext instance returned by the static Current property
on the HttpContext class.
Hope this helps.
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse.com
"Jeremy Ames" <yo******@here.com> wrote in message news:O8**************@TK2MSFTNGP10.phx.gbl... I am trying to use the the response and request objects in my custom control, but I keep getting an error that the objects have not been referenced. I have put in a using statement for System.Web to gain
access to HttpRequest and HttpResponse, but that is really not helping. Can
someone please give me some insight here?
The error message I am getting when using
Page.Request.ServerVariables["Script_Name"] is "Object reference not set to
an instance of an object."
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:ul**************@TK2MSFTNGP12.phx.gbl...
Jeremy,
Can you be more specific about the error you are getting?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Jeremy Ames" <yo******@here.com> wrote in message
news:Oc**************@TK2MSFTNGP10.phx.gbl... Can you give an example? I have tried using Page.Response and Page.Request but I get another error.
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote
in message news:eV**************@TK2MSFTNGP11.phx.gbl... Jeremy,
The Request and the Response are not exposed by the Control class. Rather, you can get them through the Page property, or you can get them through the HttpContext instance returned by the static Current property
on the HttpContext class.
Hope this helps.
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse.com
"Jeremy Ames" <yo******@here.com> wrote in message news:O8**************@TK2MSFTNGP10.phx.gbl... I am trying to use the the response and request objects in my custom control, but I keep getting an error that the objects have not been referenced. I have put in a using statement for System.Web to gain
access to HttpRequest and HttpResponse, but that is really not helping. Can
someone please give me some insight here?
Jeremy,
This means that "Script_Name" doesn't return a key. This is different
from the property not existing. Are you sure that the key points to a valid
value?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Jeremy Ames" <yo******@here.com> wrote in message
news:uy**************@tk2msftngp13.phx.gbl... The error message I am getting when using Page.Request.ServerVariables["Script_Name"] is "Object reference not set
to an instance of an object."
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote
in message news:ul**************@TK2MSFTNGP12.phx.gbl... Jeremy,
Can you be more specific about the error you are getting?
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse.com
"Jeremy Ames" <yo******@here.com> wrote in message news:Oc**************@TK2MSFTNGP10.phx.gbl... Can you give an example? I have tried using Page.Response and
Page.Request but I get another error.
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in message news:eV**************@TK2MSFTNGP11.phx.gbl... Jeremy,
The Request and the Response are not exposed by the Control class. Rather, you can get them through the Page property, or you can get them through the HttpContext instance returned by the static Current property on the HttpContext class.
Hope this helps.
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse.com
"Jeremy Ames" <yo******@here.com> wrote in message news:O8**************@TK2MSFTNGP10.phx.gbl... I am trying to use the the response and request objects in my custom control, but I keep getting an error that the objects have not been referenced. I have put in a using statement for System.Web to gain access to HttpRequest and HttpResponse, but that is really not helping. Can someone please give me some insight here?
Actually, that was supposed to say "Server_Name"
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:ed**************@tk2msftngp13.phx.gbl...
Jeremy,
This means that "Script_Name" doesn't return a key. This is different
from the property not existing. Are you sure that the key points to a valid
value?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Jeremy Ames" <yo******@here.com> wrote in message
news:uy**************@tk2msftngp13.phx.gbl... The error message I am getting when using Page.Request.ServerVariables["Script_Name"] is "Object reference not set
to an instance of an object."
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote
in message news:ul**************@TK2MSFTNGP12.phx.gbl... Jeremy,
Can you be more specific about the error you are getting?
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse.com
"Jeremy Ames" <yo******@here.com> wrote in message news:Oc**************@TK2MSFTNGP10.phx.gbl... Can you give an example? I have tried using Page.Response and
Page.Request but I get another error.
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in message news:eV**************@TK2MSFTNGP11.phx.gbl... Jeremy,
The Request and the Response are not exposed by the Control class. Rather, you can get them through the Page property, or you can get them through the HttpContext instance returned by the static Current property on the HttpContext class.
Hope this helps.
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse.com
"Jeremy Ames" <yo******@here.com> wrote in message news:O8**************@TK2MSFTNGP10.phx.gbl... I am trying to use the the response and request objects in my custom control, but I keep getting an error that the objects have not been referenced. I have put in a using statement for System.Web to gain access to HttpRequest and HttpResponse, but that is really not helping. Can someone please give me some insight here?
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Anthony Williams |
last post by:
Hi gang,
This one looks like a bug :o(
As you may or may not know, setting session management in web.config to use
cookieless sessions causes the ASP.NET runtime to munge a session ID into...
|
by: George G. |
last post by:
Hi there,
I am busy writing a new asp.net application and I am reusing some of my
existing asp functions and methods in a user control. I need access to
session, request and response in some of...
|
by: Hitesh |
last post by:
Hi,
I am getting the response from another Website by using the HttpHandler in
my current site. I am getting the page but all the images on that page are
not appearing only placeholder are...
|
by: Nathan |
last post by:
I have an aspx page with a data grid, some textboxes, and an update button.
This page also has one html input element with type=file (not inside the data
grid and runat=server).
The update...
|
by: rushikesh.joshi |
last post by:
Hi All,
I want some charting functionality in my ASP.NET application.
I want to show a multiple bar on my web page. It's based on down time
of different servers.
like
server1: down betn 4 AM...
|
by: s.bussing |
last post by:
Hi All,
I'm new to Atlas and I did some programming using AJAX, but I'm
wondering if it is possible to hava a javascript which can call a
server-site function, in my case to write data to the...
|
by: BobLaughland |
last post by:
Hi There,
I need a control on my site that is a hyperlink style control, but it
must,
1) Have a property that can hold where the hyperlink is pointing to.
(e.g. like the NavigateUrl property...
|
by: inpuarg |
last post by:
I 'm developing a c# (.net 2.0) windows forms application and in this
application i want to connect to a java servlet page (HTTPS) (which is
servlet 2.4 and which may be using Web Based SSO Sun...
|
by: jb489 |
last post by:
Hi all,
Hope I am posting this in the right forum.
I seem to be having a problem when using serialization and web services.
<b>Scenario:</b>
I have built a web service which includes a...
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
| |