473,657 Members | 2,627 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to pass additional parameter to error page

Hajo,

I use <customeError s> 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?aspx errorpath=/OnlineForms/Sandbox/Pawel/RaiseException. aspx

In short, how to change it into this:

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

thanks in advance for any info

Pawel Pabich

Nov 19 '05 #1
4 2588
hi Pawel,
i don't think you can fiddle with the defaultRedirect querystring. however,
if you intercept the Application_Err or 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?blah blah&NewParam=b lah, 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**********@g mail.com> wrote in message
news:11******** **************@ o13g2000cwo.goo glegroups.com.. .
Hajo,

I use <customeError s> 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?aspx errorpath=/OnlineForms/Sandbox/Pawel/RaiseException. aspx

In short, how to change it into this:

error.aspx?aspx errorpath=/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_Err or. For
now I use cookie and it works.

Pawel Pabich

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

Exception ex = Server.GetLastE rror();
if(ex != null)
{
if(ex.GetBaseEx ception() != null)
ex = ex.GetBaseExcep tion();
// ... 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**********@g mail.com> wrote in message
news:11******** *************@g 14g2000cwa.goog legroups.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_Err or. 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
18397
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 sub_2.noway # prints 'no extern' :-( # EOF
6
1797
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 can keep everything neat and tidy, And to call the array whenever I want thanks kenny
110
9899
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 must be an object instead of
7
21612
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 server ? Is it possible to use parameters in pass-through queries ? An additional question: Is it possible to connect to a database on MySQL or PostgreSQL using ADO ? Is it possible to execute pass-through queries with parameters, using ADO...
0
3316
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 appear when someone is trying to use it as front-end for real server database systems such as PostgreSQL or MySQL. One of these problems is regarding pass-through queries and parameters. I wanted to have all the code on client, while executing it on...
3
6718
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
2826
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", but I don't know how to pass more than one command using a string (separated by semicolon). Any ideas?
12
4625
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) my problem is: i have to access a temporary table created in an SP in a function
6
2068
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 o('on'+evt,fn); };
0
8392
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...
0
8305
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
8825
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
8732
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7324
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
6163
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
4151
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...
2
1953
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1611
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.