473,626 Members | 3,291 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Page not displaying when exception raised

I have a little problem.

I designed a webpage (VB.Net) with code behind "Page_Load" .

If the process works fine, the page is shown.

If the process raises an exception, I catch it and modify a label
inside the page (red color, ...)
But, the page is not displayed. I only have a blank screen.
No error page, no nothing.. just stops.

Do you know this problem ? The solution ?

Thanks

Patrick

Nov 19 '05 #1
5 1270
Try pasting some snippet and where get the error.
Patrick

<pb******@gmail .com> wrote in message
news:11******** **************@ z14g2000cwz.goo glegroups.com.. .
I have a little problem.

I designed a webpage (VB.Net) with code behind "Page_Load" .

If the process works fine, the page is shown.

If the process raises an exception, I catch it and modify a label
inside the page (red color, ...)
But, the page is not displayed. I only have a blank screen.
No error page, no nothing.. just stops.

Do you know this problem ? The solution ?

Thanks

Patrick

Nov 19 '05 #2
ypu may want to check the view source of the HTML page appearing blank..
any javascript error or any broken tags?

"pb******@gmail .com" wrote:
I have a little problem.

I designed a webpage (VB.Net) with code behind "Page_Load" .

If the process works fine, the page is shown.

If the process raises an exception, I catch it and modify a label
inside the page (red color, ...)
But, the page is not displayed. I only have a blank screen.
No error page, no nothing.. just stops.

Do you know this problem ? The solution ?

Thanks

Patrick

Nov 19 '05 #3
No, the page contains the <html><head><bo dy> ... </html>
The generated page is ok but empty.
I'm handling files (file.move, file.delete), when I was working on dos
programs (long time ago), there were specific problems when working on
files. Maybe it's a recurrent problem ?

Nov 19 '05 #4
try posting the part of the code that generate error..

possibly there is an error in the exception handler(?).. you may want to
try commenting every thing in side the catch {} and keep a simple
"Response.Write ("error")) ...

Also how is the customErrors configureed in web.config ?

<customErrors
mode="RemoteOnl y"
/>

"pb******@gmail .com" wrote:
No, the page contains the <html><head><bo dy> ... </html>
The generated page is ok but empty.
I'm handling files (file.move, file.delete), when I was working on dos
programs (long time ago), there were specific problems when working on
files. Maybe it's a recurrent problem ?

Nov 19 '05 #5
First in the web.config I have <customErrors mode="Off" />

If I comment in the catch and only leave the response.write( "ERROR"),
then it's displayed.
If I remove the Throw (the one with a comment in the code) in the
catch, it's the same thing.

It seems that if I make a fileCopy with wrong file name, the page is
not displayed. here's my web page :

Imports AFTypeFactory
Imports System.IO
Imports DistillInterfac e

Public Class RegenerationPro gressionTrt
Inherits System.Web.UI.P age

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnos tics.DebuggerSt epThrough()> Private Sub
InitializeCompo nent()

End Sub
Protected WithEvents ImgPhase1 As System.Web.UI.W ebControls.Imag e
Protected WithEvents lblPhase1 As System.Web.UI.W ebControls.Labe l
Protected WithEvents ImgPhase2 As System.Web.UI.W ebControls.Imag e
Protected WithEvents LblPhase2 As System.Web.UI.W ebControls.Labe l

'NOTE: The following placeholder declaration is required by the Web
Form Designer.
'Do not delete or move it.
Private designerPlaceho lderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeCompo nent()
End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
'Put user code to initialize the page here
If Request("PS") = 1 Then
lblPhase1.Text = "Phase 1 - PS"
If Request("PDF") = 1 Then
LblPhase2.Text = "Phase 2 - PDF"
Else
LblPhase2.Visib le = False
End If
Else
If Request("PDF") = 1 Then
lblPhase1.Text = "Phase 1 - PDF"
LblPhase2.Visib le = False
End If
End If

Try
traitements()
Catch ex As Exception

End Try
End Sub

Private Sub traitements()
Dim odsDossier As OffDocDossier = Session("Dossie r")

If Request("PS") = 1 Then
Try ' phase 1 - PS

Dim FicDOC As String() =
DBActions.GetUp loadById(odsDos sier.DocFileId)
Dim FicPS As String() =
DBActions.GetUp loadById(odsDos sier.PsFileId)

Dim newPerson As New Impersonate.Imp ersonateUser
Dim isValid As Boolean = newPerson.Start ()
If File.Exists(App lication("TempF older") & FicDOC(4))
Then ' <----- HERE if the file cannot be accessed, there's anj
exception. It's thrown as I can see in the debugger

File.Delete(App lication("TempF older") & FicDOC(4))
End If
File.Copy(FicDO C(1) & FicDOC(4),
Application("Te mpFolder") & FicDOC(4))
If isValid Then
newPerson.End()
End If

WordPilot.Print WordDoc(Applica tion("TempFolde r") &
FicDOC(4), Application("Te mpFolder") & FicPS(4))

isValid = newPerson.Start ()
If File.Exists(Fic PS(1) & FicPS(4)) Then
File.Delete(Fic PS(1) & FicPS(4))
End If
File.Copy(Appli cation("TempFol der") & FicPS(4),
FicPS(1) & FicPS(4))
If isValid Then
newPerson.End()
End If

ImgPhase1.Visib le = True
Catch ex As Exception
lblPhase1.Font. Bold = True
lblPhase1.ForeC olor = Color.Red
Throw ' If I remove this line, there's the same
blank screen...
End Try

If Request("PDF") = 1 Then
Try ' phase 2 - PDF
GenererPdf(odsD ossier)

ImgPhase2.Visib le = True
Catch ex As Exception
LblPhase2.Font. Bold = True
LblPhase2.ForeC olor = Color.Red
Throw
End Try
End If
Else
If Request("PDF") = 1 Then
Try ' phase 1 - Génération du .PDF
GenererPdf(odsD ossier)

ImgPhase1.Visib le = True
Catch ex As Exception
lblPhase1.Font. Bold = True
lblPhase1.ForeC olor = Color.Red
Throw
End Try
End If
End If
End Sub

Private Sub GenererPdf(ByVa l CurrDossier As OffDocDossier)
If CurrDossier.Wor dPageCount <
Application("Nb PagesMaxShortDi stiller") Then
DBActions.Inser tTask(CurrDossi er.Id,
AFTypeFactory.e nService.ShortD istiller)
Dim distiller As IDistillFactory =
CType(Activator .GetObject(GetT ype(IDistillFac tory),
Application("AF DistillServiceU rl")), IDistillFactory )
distiller.Wakeu p()
Else
DBActions.Inser tTask(CurrDossi er.Id,
AFTypeFactory.e nService.LongDi stiller)
Dim distiller As IDistillFactory =
CType(Activator .GetObject(GetT ype(IDistillFac tory),
Application("AF LongDistillServ iceUrl")), IDistillFactory )
distiller.Wakeu p()
End If
End Sub

End Class

Nov 19 '05 #6

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

Similar topics

2
3617
by: John Lau | last post by:
Hi, Is there documentation that talks about the page lifecycle, the lifecycle of controls on the page, and the rendering of inline code, in a single document? Thanks, John
4
1420
by: Tony | last post by:
I am in the process of setting up a base page model for multiple reasons. One of the reasons is so that I can catch all exceptions when derived pages throw/raise them. I don't want to use the standard OnError virtual method to handle this requirement because the form does not complete its rendering process when this occurs. I really need the form to display properly on the screen. I have managed to catch nearly all exceptions by...
15
4744
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 button will verify the information that has been entered and updates the data base if the data is correct. Update will throw an exception if the data is not validate based on some given rules. I also have a custom error handling page to show the...
2
1949
by: wawork | last post by:
Fairly new to python. In a try except how do you display the true (raw) error message so it can be displayed back to the user?
6
4864
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of the html page controls the form fields that are required. It doesn't function like it's supposed to and I can leave all the fields blank and it still submits the form. Also I can't get it to transfer the file in the upload section. The file name...
4
4189
by: Kuldeep | last post by:
Hi All, I am trying to read the contents of a page through its URL. My code snippet is as follows: public void mtdGetPageDataHWR() { HttpWebRequest objRequ = (HttpWebRequest)WebRequest.Create("http://www.microsoft.com"); HttpWebResponse objResp = (HttpWebResponse)objRequ.GetResponse();
11
3247
by: MikeT | last post by:
This may sound very elementary, but can you trap when your object is set to null within the object? I have created a class that registers an event from an object passed in the constructor. When my object is destroyed, I want my object to un-register this event. If I don't then the object would never be destroyed until the object I passed in the constructor is destroyed. I have implemented a Dispose(), Dispose(bool), and ~Finalize...
5
5148
by: =?Utf-8?B?c3VydHVyeg==?= | last post by:
Hi, I feel like a noob for asking this. When I publish a VB windows application, I want to disable the ability of the the user to continue when there is an unhandled exception. For example, if there is a bug in the program that causes an exception, I want the program to crash. If there is an unhandled exception the program is in an undefined state, and continuing could be dangerous. I'm surprised the
2
1560
by: dm3281 | last post by:
Hi all -- I have a strange issue. I have obtained a scripted database and compiled ASP.NET 2.0 application from a sister site that I'm trying to implement locally. I have successfully created the database and accessed various ASP.NET 2.0 admin web pages for populating some of the fields. The issue is, on one particular page that has two dropdown listboxes, where second was is populated with a list of customer numbers after the...
0
8262
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
8637
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
8364
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
8502
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
7192
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
6122
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
4196
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2623
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
1
1807
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.