473,503 Members | 1,831 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to pass additional parameter to error page

Hajo,

I use <customeErrors> and I set the defaultRedirect attribute to my
error page.
Now I want to pass to this page additional number and I want to do this
using query string but I do not know how to add additional paramter to
automatically generated by asp.net url.

error.aspx?aspxerrorpath=/OnlineForms/Sandbox/Pawel/RaiseException.aspx

In short, how to change it into this:

error.aspx?aspxerrorpath=/OnlineForms/Sandbox/Pawel/RaiseException.aspx&parm1=as

thanks in advance for any info

Pawel Pabich

Nov 19 '05 #1
4 2578
hi Pawel,
i don't think you can fiddle with the defaultRedirect querystring. however,
if you intercept the Application_Error event in global.asax (which happens
regardless of custom errors setting), this allows you to act before the user
gets redirected to the error page. you could put code in this event to
Redirect the user to /error.aspx?blahblah&NewParam=blah, and end the
response there. this is basically not using customErrors, so you might as
well turn it off. but since you want to override the default behaviour, it
is probably the best thing to do in your situation.

where does the extra parameter value come from? what is it used for?

hth
tim

--------------------------
blog: http://tim.mackey.ie
<pa**********@gmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
Hajo,

I use <customeErrors> and I set the defaultRedirect attribute to my
error page.
Now I want to pass to this page additional number and I want to do this
using query string but I do not know how to add additional paramter to
automatically generated by asp.net url.

error.aspx?aspxerrorpath=/OnlineForms/Sandbox/Pawel/RaiseException.aspx

In short, how to change it into this:

error.aspx?aspxerrorpath=/OnlineForms/Sandbox/Pawel/RaiseException.aspx&parm1=as

thanks in advance for any info

Pawel Pabich

Nov 19 '05 #2
Thanks for answer. Yes I can completly fresign from customerrors but I
thought that
I can use it and customise. The extra parameter is code of error. I can
not use session because I clear everything in Application_Error. For
now I use cookie and it works.

Pawel Pabich

Nov 19 '05 #3
hi pawel,
you can use Server.GetLastError() to get the last exception in your
application.
this is the code i use in my Application_Error event in global.asax:

Exception ex = Server.GetLastError();
if(ex != null)
{
if(ex.GetBaseException() != null)
ex = ex.GetBaseException();
// ... log it

hopefully with this you won't have to pass the error around, and you can go
back to using custom errors :)
tim

--------------------------
blog: http://tim.mackey.ie
<pa**********@gmail.com> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
Thanks for answer. Yes I can completly fresign from customerrors but I
thought that
I can use it and customise. The extra parameter is code of error. I can
not use session because I clear everything in Application_Error. For
now I use cookie and it works.

Pawel Pabich

Nov 19 '05 #4
Hi Tim,

the problem is that HttpApplication objects are pooled and two
subsequent request can be handled by different objects.

Pawel

Nov 19 '05 #5

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

Similar topics

7
18387
by: M-a-S | last post by:
I'd like to parametrize a module. That is, to set and pass some values into the module, while it is being imported. I tried this: # sub_1.py -- main program extern = "OK" import sub_2 print...
6
1790
by: Kenny | last post by:
Hello, can anyone tell me how to pass an array to a function ? I have this function , part of my class. It works if I do not put in int a everywhere , but obviously , I need to add an array so I...
110
9812
by: Mr A | last post by:
Hi! I've been thinking about passing parameteras using references instead of pointers in order to emphasize that the parameter must be an object. Exemple: void func(Objec& object); //object...
7
21580
by: Zlatko Matić | last post by:
Let's assume that we have a database on some SQL server (let it be MS SQL Server) and that we want to execute some parameterized query as a pass.through query. How can we pass parameters to the...
0
3304
by: Zlatko Matić | last post by:
Hi everybody! Recently I was struggling with client/server issues in MS Access/PostgreSQL combination. Although Access is intuitive and easy to use desktop database solution, many problems...
3
6709
by: Gelios | last post by:
Hi All! Probably my question is newbie but anycase. Should I do object that I want to pass as parameter to remoting object serializable? For Example: //server public class MyServerObject {
5
2819
by: SaschaMoe | last post by:
Hi, I want to pass the content of a clp-file as a parameter for db2clpex? E.g.: db2clpex db2 -z log.txt -tvf "connect to mydb user myuser using mypassword;select * from table;connect reset",...
12
4594
by: ArunDhaJ | last post by:
Hi Friends, Is it possible to pass a table as a parameter to a funtion. whos function declaration would look some thing like this.... ALTER FUNCTION TempFunction (@TempTable TABLE, @nPId INT) ...
6
2058
by: Max | last post by:
i have a event bind function like this(though it is not so robust): bind$=function(o,evt,fn,cb){ var aE='attachEvent'; var aEL='addEventListener'; if(!o&&o){ return o(evt,fn,!!cb); } return...
0
7199
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,...
0
7076
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
7274
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
7323
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...
1
6984
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
4670
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...
0
3162
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...
0
3151
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
732
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.