Panda 5888
asked on
Failed to open network folder from ASP.NET application
I used the following code to open network folder:
<asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl = "\\fileshare" Text="View related documents" Target="_blank"> </asp:HyperLink>
It runs well in server 'A' but not server 'B',
Both server running in win2008 IIS7. Kindly advise how to fix it
<asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl = "\\fileshare" Text="View related documents" Target="_blank"> </asp:HyperLink>
It runs well in server 'A' but not server 'B',
Both server running in win2008 IIS7. Kindly advise how to fix it
ASKER
There is no error shown. When click on the link, fileshare folder is not open. Applying same code to another server and it did open up the folder.
Right click on the hyper link and copy the link using "copy link address" in chrome or "copy shortcut" in IE.
For both the servers and check the difference you are getting in the hyper link target.
For both the servers and check the difference you are getting in the hyper link target.
Use UNC path for network sharing file\folder path like below
"file://///<ServerName>/<ShareFolder> /<FileName >"
"file://///<ServerName>/<ShareFolder>
<asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl = "file://///fileshare" Text="View related documents" Target="_blank"> </asp:HyperLink>
ASKER
I've requested that this question be deleted for the following reason:
Need to repost question
Need to repost question
You could give a correction comment if the issue is with the clarification of error. If the content of the question is wrong then it will be a new question.
I think it's not fair to delete question after solutions are suggested.
I think it's not fair to delete question after solutions are suggested.
ASKER
Further checking showed that same issue happen in both server.
It works fine if click from http://server01/application/Default.aspx instead of http://server01.domainserver.com/application/Default.aspx
By removing the '.domainserver.com' the folder can be open without issue.
It works fine if click from http://server01/application/Default.aspx instead of http://server01.domainserver.com/application/Default.aspx
By removing the '.domainserver.com' the folder can be open without issue.
ASKER
Both are showing same result
file://fileshare/
file://fileshare/
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Use This
<asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl = "file://fileshare" Text="View related documents" Target="_new" />
and try
<asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl = "file://fileshare" Text="View related documents" Target="_new" />
and try
What is the error are you getting ? Server error or client error ?
Post the error details or screen shots.