Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Hyperlink control - embedded spaces converted

Reply
Thread Tools

Hyperlink control - embedded spaces converted

 
 
Leslie
Guest
Posts: n/a
 
      07-13-2006
I am using Hyperlink controls. The image URL property references images that
are stored on the local file system in the user's temp folder. The path
reference contains blanks as you would expect in C:\Documents and Settings.
The embedded blanks are being converted to %20 so the string shows up in the
HTML source as C:\Documents%20and%20Settings. As a result, the browser cannot
find the images.

The 1.1 framework did not do this conversion.

Is there a way to turn off this conversion?

Thanks,

Leslie

 
Reply With Quote
 
 
 
 
Nathan Sokalski
Guest
Posts: n/a
 
      07-14-2006
Well, I can't answer your question right now (I recently switched from 1.1
to 2.0), but I would like to ask 2 questions. First, why are you trying to
access files in the C:\Documents and Settings directory with an ASP.NET
application? Second, I think that you would need to use the file:// protocol
to do what you are doing, since you specify the drive. The reason the spaces
are converted to %20 is because spaces are not legal in URLs.
--
Nathan Sokalski
http://www.velocityreviews.com/forums/(E-Mail Removed)
http://www.nathansokalski.com/

"Leslie" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I am using Hyperlink controls. The image URL property references images
>that
> are stored on the local file system in the user's temp folder. The path
> reference contains blanks as you would expect in C:\Documents and
> Settings.
> The embedded blanks are being converted to %20 so the string shows up in
> the
> HTML source as C:\Documents%20and%20Settings. As a result, the browser
> cannot
> find the images.
>
> The 1.1 framework did not do this conversion.
>
> Is there a way to turn off this conversion?
>
> Thanks,
>
> Leslie
>



 
Reply With Quote
 
 
 
 
Leslie
Guest
Posts: n/a
 
      07-14-2006
Nathan,

The icons referenced with the img tag come from SMS and are obtained using
SMS APIs. Once obtained, they are stored in the user's temp folder. The SMS
SDK made it possibly to obtain the icons but I did not find a way to get a
path to the icon on the SMS server. I store the icons in the temp folder and
pass the reference back to IIS which uses the reference to build the page.

Regarding the protocol, the browser seems to handle the C:\... references
just fine.

About the spaces, I understand they are not used in URLs and normally the
conversion would not be a problem, but in this case it messes up something
that was working before.

I am hoping someone knows a way to turn it off.

Leslie


"Nathan Sokalski" wrote:

> Well, I can't answer your question right now (I recently switched from 1.1
> to 2.0), but I would like to ask 2 questions. First, why are you trying to
> access files in the C:\Documents and Settings directory with an ASP.NET
> application? Second, I think that you would need to use the file:// protocol
> to do what you are doing, since you specify the drive. The reason the spaces
> are converted to %20 is because spaces are not legal in URLs.
> --
> Nathan Sokalski
> (E-Mail Removed)
> http://www.nathansokalski.com/
>
> "Leslie" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> >I am using Hyperlink controls. The image URL property references images
> >that
> > are stored on the local file system in the user's temp folder. The path
> > reference contains blanks as you would expect in C:\Documents and
> > Settings.
> > The embedded blanks are being converted to %20 so the string shows up in
> > the
> > HTML source as C:\Documents%20and%20Settings. As a result, the browser
> > cannot
> > find the images.
> >
> > The 1.1 framework did not do this conversion.
> >
> > Is there a way to turn off this conversion?
> >
> > Thanks,
> >
> > Leslie
> >

>
>
>

 
Reply With Quote
 
Walter Wang [MSFT]
Guest
Posts: n/a
 
      07-16-2006
Hi Leslie,

Thank you for your post.

I think the browser cannot find the image file because the image files path
is using server-side local path reference, rather than a remote path which
can be accessed using 'http://...'.

The space gets encoded to %20 is normal behavior.

For a local existing resource that has space in its path, you can verify
that this %20 encoding works by creating a simple html page:

<html>
<body>
<img src="file://c:/program%20files/common%20files/services/bigfoot.bmp" />
</body>
</html>

Of course you should have "c:\program files\common
files\services\bigfoot.bmp" file existing on client.

For your issue using SMS APIs to get the icons rendered on webpage, you
need to copy the icons to a folder which can be accessed from your website,
normally you can copy them to a subfolder "images" under your website (make
sure the ASP.NET service account have write access to this folder) and
reference them using "images/xyz.abc" format.

Hope this helps. Please feel free to post here if anything is unclear.

Regards,
Walter Wang ((E-Mail Removed), remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

 
Reply With Quote
 
Leslie
Guest
Posts: n/a
 
      07-16-2006
Hi Walter,

I was unable to get the answer you sent to work. I built a page with the
following html.

<html>
<body>
<img src="C:\Program Files\Common Files\Services\bigfoot.bmp"/>
<img src="file://c:/program%20files/common%20files/services/bigfoot.bmp" />
</body>
</html>

The first img displays correctly, the second does not.

Did the html you sent work on your machine?

Thanks,

Leslie

"Walter Wang [MSFT]" wrote:

> Hi Leslie,
>
> Thank you for your post.
>
> I think the browser cannot find the image file because the image files path
> is using server-side local path reference, rather than a remote path which
> can be accessed using 'http://...'.
>
> The space gets encoded to %20 is normal behavior.
>
> For a local existing resource that has space in its path, you can verify
> that this %20 encoding works by creating a simple html page:
>
> <html>
> <body>
> <img src="file://c:/program%20files/common%20files/services/bigfoot.bmp" />
> </body>
> </html>
>
> Of course you should have "c:\program files\common
> files\services\bigfoot.bmp" file existing on client.
>
> For your issue using SMS APIs to get the icons rendered on webpage, you
> need to copy the icons to a folder which can be accessed from your website,
> normally you can copy them to a subfolder "images" under your website (make
> sure the ASP.NET service account have write access to this folder) and
> reference them using "images/xyz.abc" format.
>
> Hope this helps. Please feel free to post here if anything is unclear.
>
> Regards,
> Walter Wang ((E-Mail Removed), remove 'online.')
> Microsoft Online Community Support
>
> ==================================================
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ==================================================
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>

 
Reply With Quote
 
Walter Wang [MSFT]
Guest
Posts: n/a
 
      07-17-2006
Hi Leslie,

I'm sorry for my typo in the code, should be:

<img src="file:///c:/program%20files/common%20files/services/bigfoot.bmp" />

There're three slash after "file:".




Regards,
Walter Wang ((E-Mail Removed), remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

 
Reply With Quote
 
Leslie
Guest
Posts: n/a
 
      07-17-2006
Walter,

That fixed it.

Thanks,
Leslie

"Walter Wang [MSFT]" wrote:

> Hi Leslie,
>
> I'm sorry for my typo in the code, should be:
>
> <img src="file:///c:/program%20files/common%20files/services/bigfoot.bmp" />
>
> There're three slash after "file:".
>
>
>
>
> Regards,
> Walter Wang ((E-Mail Removed), remove 'online.')
> Microsoft Online Community Support
>
> ==================================================
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ==================================================
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>

 
Reply With Quote
 
Walter Wang [MSFT]
Guest
Posts: n/a
 
      07-18-2006
Hi Leslie,

Appreciate your update and response. I am glad to hear that the problem has
been fixed. If you have any other questions or concerns, please do not
hesitate to contact us. It is always our pleasure to be of assistance.

Have a nice day!

Regards,
Walter Wang ((E-Mail Removed), remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
XSD to allow A-Z 0-9 and spaces, but not leading/trailing spaces johkar XML 2 12-10-2009 09:24 AM
[CSS] how can I show spaces as spaces? Tomasz Chmielewski HTML 21 09-10-2009 06:43 PM
how can I show spaces as spaces, part 2 Tomasz Chmielewski HTML 14 09-10-2009 03:54 PM
Re: How to trim a String trailing spaces, but not leading spaces? Roedy Green Java 3 09-14-2008 02:10 AM
Re: How to trim a String trailing spaces, but not leading spaces? John B. Matthews Java 4 09-12-2008 05:28 AM



Advertisments