Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Feb 07, 2013 07:41 AM by LokiHexxeMesse
Jul 07, 2007 09:48 PM|LINK
What I’ve found is that for content pages using the master page within the same folder (the root in this case) no problem, but as soon as I use a the master page with a content page
How can I fix this?
Many thanks as always
Jul 08, 2007 06:20 AM|LINK
in your case, it will refer to the same folder as the content page.
Jul 08, 2007 07:05 AM|LINK
Thanks, but I tried that to no effect. I think that only works with server controls, and as this is a simple link script in the head, it won't work????
Jul 08, 2007 08:13 AM|LINK
I think it will work
Jul 08, 2007 08:28 AM|LINK
Jul 08, 2007 08:34 AM|LINK
Thanks for the help, although the changes suggested will only work for the pages related to the given path directory; as soon as the master page with the JS link is used on a page
that’s on a different level, the JS link is no longer valid.
What I think I need is a server control to like the JS file, then I’ll be able to use the ~/
Jul 08, 2007 09:11 AM|LINK
I've tried the following:
The source file reference works great, but a link to the file doesn't work - needs to be in script tags... Any thoughts???
Jul 08, 2007 09:15 AM|LINK
Jul 08, 2007 10:15 AM|LINK
i think you might be using the java script some thing like this.if you have getElementByid(''TextBox1").value, when you use this java script with the Masterpages it will not accept because when you use the Masterpages the control id ("textBox1") will be
generated automatically,. on the client side the id that was generated for the TextBox1 is some thing like this "ctl00_ContentPlaceHolder1_TextBox1. so to avoid this in your java script, use some thing as shown below using the
ClientID. when you use the ClientID it will take the autogenerated identifier for the control. For sure this will not effect the other pages that you already has which doesnt use the java script.
Let me know if you have any other question..
Feb 19, 2010 07:54 AM|LINK
document.getElementById('<%=TextBox1.ClientID%>'). This will give us access to
TextBox1. Now, this will work fine until and unless the script is inline with the ASPX page, i.e., if the script is included as part of the ASPX page.
But, the same won’t work if you have the script in a separate .js file and add it to the ASPX page by specifying its location.
var num = document.getElementById(obj).value;
call this in any event as follows:
Try this links as well :