I am trying to open the directories which I have paths in the links. When I click on the link I can see the path at the current page's bottom left corner, but nothing happens. When I typr or copy paste same path in the browser address field I can open
the directory. Do you have any idea what I can do to open the directory by clicking the link. Here are the codes for it.
I am adding file:// to the query. So I create a field with the neccessary path.
string
sql = string.Format("SELECT
*, 'file://'+ path AS filePath FROM SLM_Directory WHERE visible = '{0}' ORDER BY path;",
true);
This is not a subfolder of my site. That's why I have to open it with full path. This may be a folder on the network drive or a folder on my local drive. In this example in C: drive.
New Career
Member
2 Points
5 Posts
Opening a folder with the link in gridview
Apr 29, 2012 06:23 AM|LINK
I am trying to open the directories which I have paths in the links. When I click on the link I can see the path at the current page's bottom left corner, but nothing happens. When I typr or copy paste same path in the browser address field I can open the directory. Do you have any idea what I can do to open the directory by clicking the link. Here are the codes for it.
I am adding file:// to the query. So I create a field with the neccessary path.
string sql = string.Format("SELECT *, 'file://'+ path AS filePath FROM SLM_Directory WHERE visible = '{0}' ORDER BY path;", true);
Then in the aspx file:
<asp:TemplateField HeaderText="View">
<ItemTemplate>
<a runat="server" href='<%# DataBinder.Eval(Container, "DataItem.filePath")%>'>view</a>
</ItemTemplate>
When I click, what I see is file:///C:/MKS but it is not opening.
basheerkal
Star
10672 Points
2426 Posts
Re: Opening a folder with the link in gridview
Apr 29, 2012 07:24 AM|LINK
To Open a sub folder 'Yourfolder' in your site
Use a hyper link as follows
(Talk less..Work more)
New Career
Member
2 Points
5 Posts
Re: Opening a folder with the link in gridview
Apr 29, 2012 04:23 PM|LINK
This is not a subfolder of my site. That's why I have to open it with full path. This may be a folder on the network drive or a folder on my local drive. In this example in C: drive.
Dino He - MS...
Star
8068 Points
1023 Posts
Microsoft
Re: Opening a folder with the link in gridview
May 02, 2012 03:26 AM|LINK
Hi
Do you want the user in client side open your folder in server side?
I don't recommand you do that, because when you publish your project, it will hosting by IIS, and all your source folder will change the path.
So your programe will fail that time.
If you now develop the programe in local you can convert the path to C:/MKS it will work(Make sure you have the admin permission).
Thanks.
If you have any feedback about my replies, please contact msdnmg@microsoft.com
Microsoft One Code Framework
basheerkal
Star
10672 Points
2426 Posts
Re: Opening a folder with the link in gridview
May 02, 2012 04:32 AM|LINK
If I am not wrong, I dont think it is possible to open a folder in client machine from server.
(Talk less..Work more)