A
Armin Braunstein
Hi!
I have a curious problem in my C# ASP .Net application (Visual Studio
2002, .Net Framework 1.0 SP3 (previously SP2 with the same error -
following), Crystal Reports (shipped with Visual Studio)).
In my page there is an ASP ImageButton. If i click on that a crystal
report will be generated and written into a PDF file. After generating
this button the Button clicked will be set' to invisible.
Sometimes (every about 50 to 500 report starts) the error "Request for
principal permession failed" comes.
The detailed error message is following:
Request for principal permission
failed.[System.Security.SecurityException] (Rolle:
Administrator-KBL/01/???) mscorlib at
System.Security.Permissions.PrincipalPermission.Demand()| at
System.Security.PermissionSet.Demand()| at
AtosOrigin.BTB.Web.rpt_journalbericht_kbl.get_ibtnPDF()| at
AtosOrigin.BTB.Web.rpt_journalbericht_kbl.CreatePdf() in
c:\inetpub\wwwroot\btb_dev\Reports\rpt_journalbericht_kbl.aspx.vb:line
1161 BTB.Framework 2128 VMVID-TEST-WEB
CreatePdf() is the method where the PDF-file is generated, line 1161
is following:
ibtnPDF.Visible = false;
(ibtnPDF is NOT a user control, it's an ASP ImageButton)
How can such an exception occur in this line??
To get more information i have written a try/catch block around this
line, and in the catch block i have tried to access the button with
"ErrorLog.WriteLine(FindControl("ibtnPDF").ID)" first and then
directly with "ErrorLog.WriteLine(ibtnPDF.ID)".
"FindControl("ibtnPDF")" works in this "exception situation", but
"ibtnPDF.ID" not! It seems that the "reference" to the button has
gone!?
I have tried to avoid this error by replacing the "ibtnPDF.Visible =
false" by "FindControl("ibtnPDF").Visible = false". This works almost,
but the next line "lblFiles.Text = "PDF File öffnen:"" throws the same
exception in this "special situation" (as i said it comes very
rarely).
Can anybody give me a hint how this situation can be or how can i
avoid/solve this?
I would be glad about any comment.
Armin Braunstein
I have a curious problem in my C# ASP .Net application (Visual Studio
2002, .Net Framework 1.0 SP3 (previously SP2 with the same error -
following), Crystal Reports (shipped with Visual Studio)).
In my page there is an ASP ImageButton. If i click on that a crystal
report will be generated and written into a PDF file. After generating
this button the Button clicked will be set' to invisible.
Sometimes (every about 50 to 500 report starts) the error "Request for
principal permession failed" comes.
The detailed error message is following:
Request for principal permission
failed.[System.Security.SecurityException] (Rolle:
Administrator-KBL/01/???) mscorlib at
System.Security.Permissions.PrincipalPermission.Demand()| at
System.Security.PermissionSet.Demand()| at
AtosOrigin.BTB.Web.rpt_journalbericht_kbl.get_ibtnPDF()| at
AtosOrigin.BTB.Web.rpt_journalbericht_kbl.CreatePdf() in
c:\inetpub\wwwroot\btb_dev\Reports\rpt_journalbericht_kbl.aspx.vb:line
1161 BTB.Framework 2128 VMVID-TEST-WEB
CreatePdf() is the method where the PDF-file is generated, line 1161
is following:
ibtnPDF.Visible = false;
(ibtnPDF is NOT a user control, it's an ASP ImageButton)
How can such an exception occur in this line??
To get more information i have written a try/catch block around this
line, and in the catch block i have tried to access the button with
"ErrorLog.WriteLine(FindControl("ibtnPDF").ID)" first and then
directly with "ErrorLog.WriteLine(ibtnPDF.ID)".
"FindControl("ibtnPDF")" works in this "exception situation", but
"ibtnPDF.ID" not! It seems that the "reference" to the button has
gone!?
I have tried to avoid this error by replacing the "ibtnPDF.Visible =
false" by "FindControl("ibtnPDF").Visible = false". This works almost,
but the next line "lblFiles.Text = "PDF File öffnen:"" throws the same
exception in this "special situation" (as i said it comes very
rarely).
Can anybody give me a hint how this situation can be or how can i
avoid/solve this?
I would be glad about any comment.
Armin Braunstein