Connecting Tech Pros Worldwide Forums | Help | Site Map

web.sitemap and javascript url

Steve B.
Guest
 
Posts: n/a
#1: Nov 28 '06
Hi,

I use a web.sitemap file to create a dynamic menu in my web application.
I want to add an entry that does not navigate but add the page to the user's
favorites.

I added a node like this :

<siteMapNode title="Ajouter cette page aux favoris"
url="javascript:window.external.AddFavorite(locati on.href, document.title)"
/>


It works fine when rendering the client, however the page that hosts the
menu control generate an error at design time since the node url is not a
relative node.
If I remove the javascript: there is not error in the designer, but at run
time the url is http://myserver/myapp/window.external.AddFavorite(...) which
is not valide.

How can I correctly set the sitemap to avoid both design time and runtime
error ?
Thanks,
Steve



Eliyahu Goldin
Guest
 
Posts: n/a
#2: Nov 28 '06

re: web.sitemap and javascript url


It is very hard to maintain design-time functionality on the same level as
run-time one. At some stage you will give up and won't care of design-time
errors any more.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]


"Steve B." <steve_beauge@com.msn_swap_msn_and_comwrote in message
news:eAYp6ovEHHA.4380@TK2MSFTNGP04.phx.gbl...
Quote:
Hi,
>
I use a web.sitemap file to create a dynamic menu in my web application.
I want to add an entry that does not navigate but add the page to the
user's favorites.
>
I added a node like this :
>
<siteMapNode title="Ajouter cette page aux favoris"
url="javascript:window.external.AddFavorite(locati on.href,
document.title)" />
>
>
It works fine when rendering the client, however the page that hosts the
menu control generate an error at design time since the node url is not a
relative node.
If I remove the javascript: there is not error in the designer, but at run
time the url is http://myserver/myapp/window.external.AddFavorite(...)
which is not valide.
>
How can I correctly set the sitemap to avoid both design time and runtime
error ?
Thanks,
Steve
>

Steve B.
Guest
 
Posts: n/a
#3: Nov 28 '06

re: web.sitemap and javascript url


I do, but later when an "real" designer will take the project, I'll have to
explain him how to disable this node while designing and enable it while
testing... which can be quite a pain for a non coder...

Steve
"Eliyahu Goldin" <REMOVEALLCAPITALSeEgGoldDinN@mMvVpPsS.orga écrit dans le
message de news: Ow1aFvvEHHA.4508@TK2MSFTNGP02.phx.gbl...
Quote:
It is very hard to maintain design-time functionality on the same level as
run-time one. At some stage you will give up and won't care of design-time
errors any more.
>
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
>
>
"Steve B." <steve_beauge@com.msn_swap_msn_and_comwrote in message
news:eAYp6ovEHHA.4380@TK2MSFTNGP04.phx.gbl...
Quote:
>Hi,
>>
>I use a web.sitemap file to create a dynamic menu in my web application.
>I want to add an entry that does not navigate but add the page to the
>user's favorites.
>>
>I added a node like this :
>>
><siteMapNode title="Ajouter cette page aux favoris"
>url="javascript:window.external.AddFavorite(locat ion.href,
>document.title)" />
>>
>>
>It works fine when rendering the client, however the page that hosts the
>menu control generate an error at design time since the node url is not a
>relative node.
>If I remove the javascript: there is not error in the designer, but at
>run time the url is
>http://myserver/myapp/window.external.AddFavorite(...) which is not
>valide.
>>
>How can I correctly set the sitemap to avoid both design time and runtime
>error ?
>Thanks,
>Steve
>>
>
>

Closed Thread