473,385 Members | 1,588 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Request for principal permission failed

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.De mand()| at
System.Security.PermissionSet.Demand()| at
AtosOrigin.BTB.Web.rpt_journalbericht_kbl.get_ibtn PDF()| at
AtosOrigin.BTB.Web.rpt_journalbericht_kbl.CreatePd f() in
c:\inetpub\wwwroot\btb_dev\Reports\rpt_journalberi cht_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
Jul 21 '05 #1
0 4508

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

Similar topics

0
by: Marius Horak | last post by:
I have a window (not webservice) service written in c#. It's running under MyDomain/Administrator account. It fails to execute any store procedure. The error is: "Request for the permission of...
1
by: Marius Horak | last post by:
I have a window application written in c#. It connects to a remote SQL Server but it fails to execute any store procedure. The error is: "Request for the permission of type...
1
by: Chris | last post by:
I have seen the posts on various places on the internet about .NET framework mismatch issues and I don't think that is my problem. ; ) When I execute the following C++.NET code: String...
0
by: Armin Braunstein | last post by:
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...
1
by: Rachel | last post by:
I have created a simple web service in VC# that adds two numbers. It returns an integer value to the client once invoked. I used Visual Studio .NET 2003, Windows XP Pro and .NET 1.1. I created a...
8
by: Bryan Dickerson | last post by:
The full message is: Request for permission of the type 'System.Security.Permissions.RegistryPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. ...
2
by: AnalogKid17 | last post by:
Keywords: ASP.NET app with VS2005 running on Win2003 with IIS6, and SQL2000 on a WinXP Box I've betting the following for days... it's driving me insane: Server Error in '/' Application. ...
3
by: Mike | last post by:
Hi I have problem as folow: Caught Exception: System.Configuration.ConfigurationErrorsException: An error occurred loading a configuration file: Request for the permission of type...
5
by: Henry Stock | last post by:
I am trying to understand the following error: Any thing you can tell me about this is appreciated. Security Exception Description: The application attempted to perform an operation not allowed...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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
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...

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.