|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Hyperlink control - embedded spaces convertedI 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 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. Show quoteHide quote "Leslie" <mason@newsgroup.nospam> wrote in message news:1F3E8C47-2EFC-45F0-8578-01BCFA5756AA@microsoft.com... >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 > 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 Show quoteHide quote "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 > njsokal***@hotmail.com > http://www.nathansokalski.com/ > > "Leslie" <mason@newsgroup.nospam> wrote in message > news:1F3E8C47-2EFC-45F0-8578-01BCFA5756AA@microsoft.com... > >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 > > > > > 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 (waw***@online.microsoft.com, 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. 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 Show quoteHide quote "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 (waw***@online.microsoft.com, 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. > > 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 (waw***@online.microsoft.com, 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. Walter,
That fixed it. Thanks, Leslie Show quoteHide quote "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 (waw***@online.microsoft.com, 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. > > 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 (waw***@online.microsoft.com, 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.
Auto Postback Handling in controls
Setting Properties in a Composite Control... Repeater and text boxes inside how to change labelvalue when deleting row in gridview? Programmatically listening for an event? WebPartManager1.CloseWebPart Error Can't install iewebcontrols.msi - error "webctrl_client is unavailable" Multi-line textbox scrolled to bottom? Problem handling event in a button inside a Datalist passing variable to sql statement in asp.net 2.0? |
|||||||||||||||||||||||