469,319 Members | 2,440 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,319 developers. It's quick & easy.

What's wrong with this simple script ? I've been really fighting this one !

I have a combo named cboType. Depending on its index, I need to build
a string to assign to the NavigateUrl of a hyperlink (the path to a
doc in the 'previews' subfolder).

I get a "The server tag is not well formed' error.....

NavigateUrl=
'<%#"javascript:
var index =
document.getElementById('cboType.ClientID').select edIndex;
return '~/Previews/' + cboType.options[index].text + '.doc';
"%>'

I have tried this in many ways..... the same problem.... :-(((((

Thanks a lot !
Alex

Feb 8 '07 #1
2 1042
"Alex" <cu*************@yahoo.comwrote in news:1170971021.589193.213000
@a75g2000cwd.googlegroups.com:
I have a combo named cboType. Depending on its index, I need to build
a string to assign to the NavigateUrl of a hyperlink (the path to a
doc in the 'previews' subfolder).

I get a "The server tag is not well formed' error.....

NavigateUrl=
'<%#"javascript:
var index =
document.getElementById('cboType.ClientID').select edIndex;
return '~/Previews/' + cboType.options[index].text + '.doc';
"%>'
The error message indicates that the server is trying to evaluate the JS
inside the <%#...%>, but that isn't what you want. You want the JS to
show up on the client's computer in the web page, to evaluate after the
user has selected one of cboType's options.
Feb 9 '07 #2
On Feb 8, 10:12 pm, Jim Land <RrrrFfffTttt(NO)@(SPAM)hotmail.com>
wrote:
"Alex" <cuca_macaii2...@yahoo.comwrote in news:1170971021.589193.213000
@a75g2000cwd.googlegroups.com:
I have a combo named cboType. Depending on its index, I need to build
a string to assign to the NavigateUrl of a hyperlink (the path to a
doc in the 'previews' subfolder).
I get a "The server tag is not well formed' error.....
NavigateUrl=
'<%#"javascript:
var index =
document.getElementById('cboType.ClientID').select edIndex;
return '~/Previews/' + cboType.options[index].text + '.doc';
"%>'

The error message indicates that the server is trying to evaluate the JS
inside the <%#...%>, but that isn't what you want. You want the JS to
show up on the client's computer in the web page, to evaluate after the
user has selected one of cboType's options.
Thanks for answering, Jim. I understand your point.... but how do I go
about doing that ? I'm looking at this code, and to me(because of my
very limited knowledge) it looks alright....

Alex.

Feb 9 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Martin Maney | last post: by
137 posts views Thread by Philippe C. Martin | last post: by
121 posts views Thread by typingcat | last post: by
8 posts views Thread by Midnight Java Junkie | last post: by
2 posts views Thread by Craig | last post: by
16 posts views Thread by SirG | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by Gurmeet2796 | last post: by
reply views Thread by mdpf | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.