question

GaniTPT avatar image
0 Votes"
GaniTPT asked GaniTPT answered

Getting error to open the file through service account in ASP.NET


i am using Treeview controls and mentioning direct file server path inside the NavigateURL.

we have new service account and has mapped with the file server folder and it's ready for accessible. (It's working fine).

when accessing through application, getting below error -->
cannot find "\\USA\NYK\EMPDB\EMPDETAILS\EMP00101.drng" Make sure the path or Internet address is correct

The same folder will work when accessing through physical login of service account.

We did all the settings and configuration followed by many research. but, not able to get the solution..?

pls. advice.

<asp:TreeView ID="TreeView1" runat="server" ExpandDepth="1" Font-Names="Trebuchet MS" Font-Size="15px" ForeColor="#E98300" Font-Bold="true">
<Nodes>
<asp:TreeNode Text="EmpStatus" Value="EmpStatus">
<asp:TreeNode Text="USEMP" Value="USEMP">
<asp:TreeNode Text="EMPUS" Value="EMPUS" NavigateUrl="\\USA\NYK\EMPDB\EMPDETAILS\EMP00101.drng" Target="_blank"></asp:TreeNode>
</asp:TreeNode>
</asp:TreeNode>
-----
-----
-----
</asp:TreeNode>
</Nodes>
</asp:TreeView>


Web.config


<identity impersonate="true" userName="DUENET\DATAPM1010" password ="**"></identity>


dotnet-aspnet-webforms
· 13
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

The NavigationUrl must be a relative reference to a file within the hosted application. Either move the file to your web application or write an http file handler (which runs in the hosted application) to download the file from the file share and return it to the user's browser. Http file handlers are very common in web forms so a Google search show many code examples.

Also, you might consider running the application pool identity as the service account rather than impersonation.


0 Votes 0 ·

can you pls. provide some sample code using tree view controls...

we trying many options to get the solution. but, nothing will work.. we spent more times on this..but, no solution...

0 Votes 0 ·

can pls. anyone update regarding this.

since this is long pending and this is requirement want to complete as urgent.

This will be maintaining in ASPX page iitself. It means directly hard coded the file server path in NavigateUrl.

0 Votes 0 ·
Show more comments

1 Answer

GaniTPT avatar image
0 Votes"
GaniTPT answered

Thanks for your great help.

I mapped service account with file server in my local system..

and i logged again using service account with file server path.

It's working now..

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.