Click here to Skip to main content
16,004,969 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionASP.Net Role-based security Pin
abdelhameed8119-Sep-06 10:04
abdelhameed8119-Sep-06 10:04 
AnswerRe: ASP.Net Role-based security Pin
minhpc_bk19-Sep-06 15:13
minhpc_bk19-Sep-06 15:13 
QuestionAsp.net 2.0 + javascript + Master Page ...please help Pin
deepaks319-Sep-06 9:42
deepaks319-Sep-06 9:42 
AnswerRe: Asp.net 2.0 + javascript + Master Page ...please help Pin
Christian Graus19-Sep-06 15:11
protectorChristian Graus19-Sep-06 15:11 
QuestionPost Form From Code Behind Pin
MrRyansan19-Sep-06 9:21
MrRyansan19-Sep-06 9:21 
AnswerRe: Post Form From Code Behind Pin
Kschuler19-Sep-06 10:44
Kschuler19-Sep-06 10:44 
GeneralRe: Post Form From Code Behind Pin
MrRyansan19-Sep-06 16:56
MrRyansan19-Sep-06 16:56 
QuestionPrint SSRS Web Report directly to printer Pin
RickyZX19-Sep-06 7:33
RickyZX19-Sep-06 7:33 
I'm using Visual Studio 2005 and SQL Server 2005 on a Windows Server 2003 operating system. I'm trying to print Reporting Services Reports dirctly to the printer without using the Report Manager to preview. I'm using some VB.NET code that was posted here at the following location:
http://www.codeproject.com/vb/net/RSPrintLandscape.asp
I have an ASP.NET application that I'm running on a local machine to locate and print reports from a remote report server on another machine. The application downloads a report in PDF format and creates a file on my local machine successfully, but when it tries to write to the file I get the following error:

***********************************************************************
Server Error in <myappname> Application.
Access to the path 'C:\TEMP.PDF' is denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.UnauthorizedAccessException: Access to the path 'C:\TEMP.PDF' is denied.

ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true">, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.

To grant ASP.NET access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.

Source Error:

Line 256: WebFile.Credentials = CredentialCache.DefaultCredentials
Line 257: 'Create the local file
Line 258: LocalFile = New FileStream(DestFilename, FileMode.Create)
Line 259:
Line 260: 'Download the file in 16k chunks

Source File: C:\Projects\ICISMainReport2\PrintDirect.aspx.vb Line: 258

Stack Trace:

[UnauthorizedAccessException: Access to the path 'C:\PRINT_TEMP.PDF' is denied.]
System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +2013027
System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) +998
System.IO.FileStream..ctor(String path, FileMode mode) +65
PrintDirect._PrintDirect.DownloadWebFile(String URL, String DestFilename) in C:\Projects\ICISMainReport2\PrintDirect.aspx.vb:258
PrintDirect._PrintDirect.btnPrint_Click(Object sender, EventArgs e) in C:\Projects\ICISMainReport2\PrintDirect.aspx.vb:207
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
******************************************************************************

I considered the suggestion that was listed with the error message but please note that this file is created on the user's machine each time the application is run. How can I control permissions for a file on each user's machine?
Any suggestion how I might overcome this problem?

Thanks

RickyZX
QuestionPage Refresh in ASP causing problem Pin
krishna1919-Sep-06 7:06
krishna1919-Sep-06 7:06 
AnswerRe: Page Refresh in ASP causing problem Pin
Christian Graus19-Sep-06 15:19
protectorChristian Graus19-Sep-06 15:19 
QuestionConnection to Access Database Pin
mcgann19-Sep-06 6:48
mcgann19-Sep-06 6:48 
AnswerRe: Connection to Access Database Pin
minhpc_bk19-Sep-06 15:09
minhpc_bk19-Sep-06 15:09 
QuestionCan you configure Atlas and MasterPages to do an Atlas style update of only the Masterpages content? Pin
Red_Wizard_Shot_The_Food19-Sep-06 5:58
Red_Wizard_Shot_The_Food19-Sep-06 5:58 
QuestionMy master page's graphics refresh under IE7 when navigating to a content page that should share the same master, is there a fix for this ? Pin
Red_Wizard_Shot_The_Food19-Sep-06 3:50
Red_Wizard_Shot_The_Food19-Sep-06 3:50 
AnswerRe: My master page's graphics refresh under IE7 when navigating to a content page that should share the same master, is there a fix for this ? Pin
Guffa19-Sep-06 7:17
Guffa19-Sep-06 7:17 
GeneralRe: My master page's graphics refresh under IE7 when navigating to a content page that should share the same master, is there a fix for this ? Pin
Red_Wizard_Shot_The_Food19-Sep-06 7:48
Red_Wizard_Shot_The_Food19-Sep-06 7:48 
AnswerRe: My master page's graphics refresh under IE7 when navigating to a content page that should share the same master, is there a fix for this ? Pin
Guffa19-Sep-06 20:53
Guffa19-Sep-06 20:53 
GeneralRe: My master page's graphics refresh under IE7 when navigating to a content page that should share the same master, is there a fix for this ? Pin
Red_Wizard_Shot_The_Food19-Sep-06 21:45
Red_Wizard_Shot_The_Food19-Sep-06 21:45 
AnswerRe: My master page's graphics refresh under IE7 when navigating to a content page that should share the same master, is there a fix for this ? Pin
Guffa20-Sep-06 20:11
Guffa20-Sep-06 20:11 
QuestionDate in DataGrid Pin
netDeveloper19-Sep-06 3:08
netDeveloper19-Sep-06 3:08 
AnswerRe: Date in DataGrid Pin
_AK_19-Sep-06 3:09
_AK_19-Sep-06 3:09 
GeneralRe: Date in DataGrid [modified] Pin
netDeveloper19-Sep-06 3:17
netDeveloper19-Sep-06 3:17 
AnswerRe: Date in DataGrid Pin
Ramasubramaniam20-Sep-06 5:32
Ramasubramaniam20-Sep-06 5:32 
Questionexport to excel? Pin
TintinV3ck19-Sep-06 3:02
TintinV3ck19-Sep-06 3:02 
AnswerRe: export to excel? Pin
Sathesh Sakthivel19-Sep-06 3:13
Sathesh Sakthivel19-Sep-06 3:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.