473,669 Members | 2,460 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Anyone has seen this error?

Hello, friends,

In our development machine, the .net web app worked fine. Then we deployed
it to our server.

However, it did not work on the server. After a user entered user name/pswd
and tried to log in, we have the error message in Exception : Thread was
being aborted in Page_Load().

Page_Load()
{
try
{
if (this.IsPostBac k)
{
if (Request.Form["txtLoginNa me"] == "admin" &&
Request.Form["txtPswd"] == "admin")
{
FormsAuthentica tion.SetAuthCoo kie(Request.For m["txtLoginNa me"],
System.Convert. ToBoolean(Reque st.Form["Persist"]));
Session["userName"] = Request.Form["txtLoginNa me"];
Response.Redire ct("General/Index.aspx");
}
}
catch (System.Excepti on se)
{
Server.Transfer ("Error/Error.aspx?msg= " + Server.UrlEncod e(se.Message));
}
}

Any ideas? (I thought Response.Redire ct("General/Index.aspx"); may be the
problem).

If I want to debug on server, how can I do it? (We are not allowed to set up
dev environment on the server.)

Help please, and thanks.
Feb 7 '06 #1
5 1217
Response.Redire ct DOES throw a ThreadAbortExce ption, that's just how it
works, it aborts the thread and starts a new one, you can use
Redirect("...", false); to avoid the error (the execution will complete and
then redirect, as opposed to redirecting immediately).

You should try avoiding swallowing exceptions...ca tch System.Exceptio n isn't
ideal.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Andrew" <An****@discuss ions.microsoft. com> wrote in message
news:3E******** *************** ***********@mic rosoft.com...
Hello, friends,

In our development machine, the .net web app worked fine. Then we deployed
it to our server.

However, it did not work on the server. After a user entered user
name/pswd
and tried to log in, we have the error message in Exception : Thread was
being aborted in Page_Load().

Page_Load()
{
try
{
if (this.IsPostBac k)
{
if (Request.Form["txtLoginNa me"] == "admin" &&
Request.Form["txtPswd"] == "admin")
{
FormsAuthentica tion.SetAuthCoo kie(Request.For m["txtLoginNa me"],
System.Convert. ToBoolean(Reque st.Form["Persist"]));
Session["userName"] = Request.Form["txtLoginNa me"];
Response.Redire ct("General/Index.aspx");
}
}
catch (System.Excepti on se)
{
Server.Transfer ("Error/Error.aspx?msg= " +
Server.UrlEncod e(se.Message));
}
}

Any ideas? (I thought Response.Redire ct("General/Index.aspx"); may be the
problem).

If I want to debug on server, how can I do it? (We are not allowed to set
up
dev environment on the server.)

Help please, and thanks.

Feb 7 '06 #2
Why it did not throw exception in dev machine?

I know to catch exception in .aspx page is expensive, but do you have a
better way to collect those errors?

Thanks.
"Karl Seguin [MVP]" wrote:
Response.Redire ct DOES throw a ThreadAbortExce ption, that's just how it
works, it aborts the thread and starts a new one, you can use
Redirect("...", false); to avoid the error (the execution will complete and
then redirect, as opposed to redirecting immediately).

You should try avoiding swallowing exceptions...ca tch System.Exceptio n isn't
ideal.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Andrew" <An****@discuss ions.microsoft. com> wrote in message
news:3E******** *************** ***********@mic rosoft.com...
Hello, friends,

In our development machine, the .net web app worked fine. Then we deployed
it to our server.

However, it did not work on the server. After a user entered user
name/pswd
and tried to log in, we have the error message in Exception : Thread was
being aborted in Page_Load().

Page_Load()
{
try
{
if (this.IsPostBac k)
{
if (Request.Form["txtLoginNa me"] == "admin" &&
Request.Form["txtPswd"] == "admin")
{
FormsAuthentica tion.SetAuthCoo kie(Request.For m["txtLoginNa me"],
System.Convert. ToBoolean(Reque st.Form["Persist"]));
Session["userName"] = Request.Form["txtLoginNa me"];
Response.Redire ct("General/Index.aspx");
}
}
catch (System.Excepti on se)
{
Server.Transfer ("Error/Error.aspx?msg= " +
Server.UrlEncod e(se.Message));
}
}

Any ideas? (I thought Response.Redire ct("General/Index.aspx"); may be the
problem).

If I want to debug on server, how can I do it? (We are not allowed to set
up
dev environment on the server.)

Help please, and thanks.


Feb 7 '06 #3
Normally leave such global exception handling to a global handler - so you
don't have to repeat the code each time (global.asax onerror).

I'm not sure why it wouldn't throw in dev..maybe there's a machine.config
setting which is different...not sure, but I'm not surprised by the
behaviour, you simply need to code around it, a simple way is:

Catch (Exception se)
{
if (!se is ThreadAbordExce ption)
{
//this is a real error
}
}

or use the false as in my example.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Andrew" <An****@discuss ions.microsoft. com> wrote in message
news:CC******** *************** ***********@mic rosoft.com...
Why it did not throw exception in dev machine?

I know to catch exception in .aspx page is expensive, but do you have a
better way to collect those errors?

Thanks.
"Karl Seguin [MVP]" wrote:
Response.Redire ct DOES throw a ThreadAbortExce ption, that's just how it
works, it aborts the thread and starts a new one, you can use
Redirect("...", false); to avoid the error (the execution will complete
and
then redirect, as opposed to redirecting immediately).

You should try avoiding swallowing exceptions...ca tch System.Exceptio n
isn't
ideal.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Andrew" <An****@discuss ions.microsoft. com> wrote in message
news:3E******** *************** ***********@mic rosoft.com...
> Hello, friends,
>
> In our development machine, the .net web app worked fine. Then we
> deployed
> it to our server.
>
> However, it did not work on the server. After a user entered user
> name/pswd
> and tried to log in, we have the error message in Exception : Thread
> was
> being aborted in Page_Load().
>
> Page_Load()
> {
> try
> {
> if (this.IsPostBac k)
> {
> if (Request.Form["txtLoginNa me"] == "admin" &&
> Request.Form["txtPswd"] == "admin")
> {
> FormsAuthentica tion.SetAuthCoo kie(Request.For m["txtLoginNa me"],
> System.Convert. ToBoolean(Reque st.Form["Persist"]));
> Session["userName"] = Request.Form["txtLoginNa me"];
> Response.Redire ct("General/Index.aspx");
> }
> }
> catch (System.Excepti on se)
> {
> Server.Transfer ("Error/Error.aspx?msg= " +
> Server.UrlEncod e(se.Message));
> }
> }
>
> Any ideas? (I thought Response.Redire ct("General/Index.aspx"); may be
> the
> problem).
>
> If I want to debug on server, how can I do it? (We are not allowed to
> set
> up
> dev environment on the server.)
>
> Help please, and thanks.


Feb 7 '06 #4
> Normally leave such global exception handling to a global handler - so you
don't have to repeat the code each time (global.asax onerror).
very good. but, just one more question:

Is that possible the error collected in global.asax onerror will only be the
last error, not the original one which actually raised a chain of exception
errors? Thus, errors may not be helpful to pin down the real problem?

Or global.asax onerror will be raised for every error in a chain, including
the original one?
Thanks.

"Karl Seguin [MVP]" wrote:
Normally leave such global exception handling to a global handler - so you
don't have to repeat the code each time (global.asax onerror).

I'm not sure why it wouldn't throw in dev..maybe there's a machine.config
setting which is different...not sure, but I'm not surprised by the
behaviour, you simply need to code around it, a simple way is:

Catch (Exception se)
{
if (!se is ThreadAbordExce ption)
{
//this is a real error
}
}

or use the false as in my example.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Andrew" <An****@discuss ions.microsoft. com> wrote in message
news:CC******** *************** ***********@mic rosoft.com...
Why it did not throw exception in dev machine?

I know to catch exception in .aspx page is expensive, but do you have a
better way to collect those errors?

Thanks.
"Karl Seguin [MVP]" wrote:
Response.Redire ct DOES throw a ThreadAbortExce ption, that's just how it
works, it aborts the thread and starts a new one, you can use
Redirect("...", false); to avoid the error (the execution will complete
and
then redirect, as opposed to redirecting immediately).

You should try avoiding swallowing exceptions...ca tch System.Exceptio n
isn't
ideal.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Andrew" <An****@discuss ions.microsoft. com> wrote in message
news:3E******** *************** ***********@mic rosoft.com...
> Hello, friends,
>
> In our development machine, the .net web app worked fine. Then we
> deployed
> it to our server.
>
> However, it did not work on the server. After a user entered user
> name/pswd
> and tried to log in, we have the error message in Exception : Thread
> was
> being aborted in Page_Load().
>
> Page_Load()
> {
> try
> {
> if (this.IsPostBac k)
> {
> if (Request.Form["txtLoginNa me"] == "admin" &&
> Request.Form["txtPswd"] == "admin")
> {
> FormsAuthentica tion.SetAuthCoo kie(Request.For m["txtLoginNa me"],
> System.Convert. ToBoolean(Reque st.Form["Persist"]));
> Session["userName"] = Request.Form["txtLoginNa me"];
> Response.Redire ct("General/Index.aspx");
> }
> }
> catch (System.Excepti on se)
> {
> Server.Transfer ("Error/Error.aspx?msg= " +
> Server.UrlEncod e(se.Message));
> }
> }
>
> Any ideas? (I thought Response.Redire ct("General/Index.aspx"); may be
> the
> problem).
>
> If I want to debug on server, how can I do it? (We are not allowed to
> set
> up
> dev environment on the server.)
>
> Help please, and thanks.


Feb 7 '06 #5
OnError will raise for any unhandled exceptions.

There's a chance this error will be of type HttpUnhandledEx ception, you can
simply get the InnerException to get the real exception.

Karl

--
http://www.openmymind.net/

"Andrew" <An****@discuss ions.microsoft. com> wrote in message
news:A1******** *************** ***********@mic rosoft.com...
Normally leave such global exception handling to a global handler - so
you
don't have to repeat the code each time (global.asax onerror).


very good. but, just one more question:

Is that possible the error collected in global.asax onerror will only be
the
last error, not the original one which actually raised a chain of
exception
errors? Thus, errors may not be helpful to pin down the real problem?

Or global.asax onerror will be raised for every error in a chain,
including
the original one?
Thanks.

"Karl Seguin [MVP]" wrote:
Normally leave such global exception handling to a global handler - so
you
don't have to repeat the code each time (global.asax onerror).

I'm not sure why it wouldn't throw in dev..maybe there's a machine.config
setting which is different...not sure, but I'm not surprised by the
behaviour, you simply need to code around it, a simple way is:

Catch (Exception se)
{
if (!se is ThreadAbordExce ption)
{
//this is a real error
}
}

or use the false as in my example.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Andrew" <An****@discuss ions.microsoft. com> wrote in message
news:CC******** *************** ***********@mic rosoft.com...
> Why it did not throw exception in dev machine?
>
> I know to catch exception in .aspx page is expensive, but do you have a
> better way to collect those errors?
>
> Thanks.
>
>
> "Karl Seguin [MVP]" wrote:
>
>> Response.Redire ct DOES throw a ThreadAbortExce ption, that's just how
>> it
>> works, it aborts the thread and starts a new one, you can use
>> Redirect("...", false); to avoid the error (the execution will
>> complete
>> and
>> then redirect, as opposed to redirecting immediately).
>>
>> You should try avoiding swallowing exceptions...ca tch System.Exceptio n
>> isn't
>> ideal.
>>
>> Karl
>>
>> --
>> MY ASP.Net tutorials
>> http://www.openmymind.net/
>>
>>
>> "Andrew" <An****@discuss ions.microsoft. com> wrote in message
>> news:3E******** *************** ***********@mic rosoft.com...
>> > Hello, friends,
>> >
>> > In our development machine, the .net web app worked fine. Then we
>> > deployed
>> > it to our server.
>> >
>> > However, it did not work on the server. After a user entered user
>> > name/pswd
>> > and tried to log in, we have the error message in Exception : Thread
>> > was
>> > being aborted in Page_Load().
>> >
>> > Page_Load()
>> > {
>> > try
>> > {
>> > if (this.IsPostBac k)
>> > {
>> > if (Request.Form["txtLoginNa me"] == "admin" &&
>> > Request.Form["txtPswd"] == "admin")
>> > {
>> > FormsAuthentica tion.SetAuthCoo kie(Request.For m["txtLoginNa me"],
>> > System.Convert. ToBoolean(Reque st.Form["Persist"]));
>> > Session["userName"] = Request.Form["txtLoginNa me"];
>> > Response.Redire ct("General/Index.aspx");
>> > }
>> > }
>> > catch (System.Excepti on se)
>> > {
>> > Server.Transfer ("Error/Error.aspx?msg= " +
>> > Server.UrlEncod e(se.Message));
>> > }
>> > }
>> >
>> > Any ideas? (I thought Response.Redire ct("General/Index.aspx"); may
>> > be
>> > the
>> > problem).
>> >
>> > If I want to debug on server, how can I do it? (We are not allowed
>> > to
>> > set
>> > up
>> > dev environment on the server.)
>> >
>> > Help please, and thanks.
>>
>>
>>


Feb 7 '06 #6

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

Similar topics

0
1205
by: Mart Rogers | last post by:
I have the following problem with an ASP.Net solution and would be grateful for any advice on solving it : I load an existing ASP.NET solution into Visual Studio (2002), then from Solution Explorer, right-click on one of the projects. In the pop-up menu, I selected Add, then Add Existing Item. After that the dialog box to select a file appeared (which is expected), followed by the error message :
0
310
by: numerous instabilities in deploying VB | last post by:
I have been working on a VB product It is working beautifuly on my XP dev box and my windows 2000 test machines in the lab. When I install at the customer site, I get all kinds of wacky problems that I CANT reproduce in the lab. 1) Some customer PC's can't use ANY functions related to Process = Process.GetProcessById(ProcessID) !!!! - I am resorting to using a 3rd party product to kill process. 2) Sometimes applications will just die...
6
3100
by: ATS | last post by:
INF: Has anyone made a CString, sprintf, and sscanf for .NET? Please help, I want to code with PURE .NET (i.e. pure CLR). No MFC, No ATL, no C-Run Time Library. But I want CString, sprintf, and sscanf. The "String" class in .NET is completely worthless to me, especially its so called "Format" method. In fact to just, harp on how "lacking" it is to me, in C++.NET, one can NOT do this:
0
1378
by: Frank | last post by:
I am attempting to convert an asp file to a asp.net file using C#. The original file has an ActiveX control which is contained in a cab file. The cab file contains the .ocx file which connects to a socket and transfers client info to a server, as well as several .dlls The cab file also references another cab file which contains files to install on the client machine in case they do not have VBRuntime6 installed on their machine.
40
2963
by: Jeff | last post by:
I have a system on a network and want to determine if anyone is currently connected to the back-end files. An interesting twist is that I have noticed that some users can be connected (have the front end open at the first form) and even though this links to the back-end files, there are no ldb files created. This is so I know when it is safe to compact the back-end files without going round to make sure everyone is logged off. User...
10
2479
by: Alan Silver | last post by:
Hello, I discovered the MSDN design templates yesterday and have been looking at them. I have a problem with the Personal template. I don't have SQL Server Express loaded, as I already have SQL Server 2000, and use that instead. All of the other samples work fine with this when you change the connection string, but the Personal sample fails to start. The error is...
8
1423
by: Wayne Gillespie | last post by:
I have an application in service (A97) which is a booking system for a modelling agency. When they add / edit a job I display a subform which lists all models, filtered according to criteria set by the user, from which they can select the model(s) they want to add to the job. The subform is bound to a temporary table (atblModelSelectTemp2 ) which contain several boolean fields which act as flags to indicate whether the model is already on...
0
1925
by: Erich93063 | last post by:
I am using Cold Fusion to access an ODBC connection for an accounting program called MYOB. They provide the ODBC driver that you can install. I have it installed and I used there utility to check the connection and its successful. I then try to run a very basic query in Cold Fusion and I get the folowing error: Error Executing Database Query. Option value changed - SQLSetStmtOption:RowSet Size 1149 requested, changed to 1
1
1275
by: MPutt | last post by:
I apologize if I am posting this to the wrong area, but I am stuck. Here is my problem. I am running a .NET 2003 Windows service against Oracle 9i. This service is attempting to run a stored proc that inserts data into the DB. When it calls the proc it gets the following error. "Unable to run stored procedure: "
0
8465
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
8809
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...
1
8588
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
8658
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
4206
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
4386
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2797
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
2032
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1788
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.