This is a migrated thread and some comments may be shown as answers.

Problem with white space in url path

4 Answers 72 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Vlastimil
Top achievements
Rank 1
Vlastimil asked on 12 Jan 2011, 07:56 AM
Hallo,
I have problem with spaces in url path.
I have Rad Grid with columns like this:
<telerik:GridHyperLinkColumn DataTextFormatString="Adres" ItemStyle-ForeColor="Orange"
 DataNavigateUrlFields="s_adresar" UniqueName="s_adresar" DataNavigateUrlFormatString="file://///SomeServer/Some Directory With Spaces/{0}" Target="_blank" HeaderText="Adres" DataTextField="s_adresar">
 </telerik:GridHyperLinkColumn>

I would like to open directory from shared file system in Windows Explorer after click on link in RadGrid, but it doesn't work.
Right path to directory is file://SomeServer/Some Directory With Spaces/
but rendered path is  file://SomeServer/Some%20Directory%20With%20Spaces/
and  this path is for Windows Explorer unknown. I tried to replace spaces in path ( in DataNavigateUrlFormatString property) with some mark entity but without success.
Can anyone help me  please?
Thanks

4 Answers, 1 is accepted

Sort by
0
Thomas Salt
Top achievements
Rank 1
answered on 12 Jan 2011, 03:13 PM
Pretty sure for a shared file system you'll need to use \\SharedfileSystemName

So your path should be something like file://\\SharedFileName\Some File Path\
0
Vlastimil
Top achievements
Rank 1
answered on 12 Jan 2011, 04:05 PM
Thanks for replay Thomas,
problem in url path is with space in name of directory, not with  file:// or  file:\\
If I try to open (click on link in rad grid) for example directory file://SomeServer/SomeDirectoryWithoutSpaces/
it works good - the directory is opened in windows explorer
If I try to open directory file://SomeServer/Some Directory With Spaces/ 
windows explorer can't find this url path, because it is rendered in browser like file://SomeServer/Some%20Directory%20With%20Spaces/ and for windows explorer this path is unknown ( he knows only file://SomeServer/Some Directory With Spaces/ 
 ) I think problem is in url encoding of url path from web page to Windows.
 






0
Thomas Salt
Top achievements
Rank 1
answered on 12 Jan 2011, 04:45 PM
Try changing your GridHyperLinkColumn to a GridTemplateColumn and creating an html anchor in the item template.  It still adds the %20 in, but I was able to navigate to my file.

<a href=file:////SomeServer/Some File With Spaces....

that worked for me..let me know if you have any questions.
0
Rama
Top achievements
Rank 1
answered on 10 Mar 2015, 06:57 PM
                        <telerik:GridTemplateColumn DataField="FileLocation" HeaderText="Folder" UniqueName="gtcExistingDirectory" HeaderStyle-Width="3%"
                            HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="3%" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <asp:HyperLink Target="_new" runat="server" href='<%# "F:\SomeFolder\" + Eval("FileLocation").ToString() %>' >
                                    <asp:Image runat="server" ImageUrl="~/Images/Folder.png" />
                                </asp:HyperLink>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
Tags
General Discussions
Asked by
Vlastimil
Top achievements
Rank 1
Answers by
Thomas Salt
Top achievements
Rank 1
Vlastimil
Top achievements
Rank 1
Rama
Top achievements
Rank 1
Share this question
or