CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

ASP.NET Web Hosting – 3 Months Free!



Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 8/18/2006 7:34:43 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 3 Views: 19 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
4 Items, 1 Pages 1 |< << Go >> >|
DigitalBits
Asp.Net User
Can a JavaScript source file be imported into a ContentPage?8/18/2006 7:34:43 PM

0/0

Can a JavaScript source file be imported into a ContentPage and sent to the MasterPage thru the ContentPlaceHolder?  When I try this with the typical <script type="text/javascript" src="absolute path" /> the MasterPage displays but none of the content within that ContentPlaceHolder displays.  It appears the entire contents of the ContentPlaceHolder get truncated.  Looking at the page source in IE I can see all the content in the placeholder with the <script> tag.  I also get a JavaScript error "Object expected". 

Now if I place the contents of the JavaScript file into a <script> tag in the ContentPlaceHolder the JavaScript executes successfully. 

I don't want to have to place the contents of all my .js file into the ASP.Net code.  What is the correct way to import the .js code in both the MasterPage and ContentPages?

Thanks in advance...
Connect
Asp.Net User
Re: Can a JavaScript source file be imported into a ContentPage?8/18/2006 8:51:44 PM

0/0

Have you look at the ClientScriptManager class? You can use the RegisterClientScriptInclude method to add javascript to the page eg.

if(!Page.ClientScript.IsClientScriptIncludeRegistered("MyJavaScript"))
{
Page.ClientScript.RegisterClientScriptInclude("MyJavaScript", ResolveClientUrl("~/myscript.js"));
}
DigitalBits
Asp.Net User
Re: Can a JavaScript source file be imported into a ContentPage?8/18/2006 9:33:34 PM

0/0

Thanks, I'll give it a try. 

But, again, when using Master and Content Pages does this preclude the ability to import the JavaScript thru a <script> tag?
bitmask
Asp.Net User
Re: Can a JavaScript source file be imported into a ContentPage?8/21/2006 3:20:54 AM

0/0

I've used ContentPlaceHolders inside the master page's <head> tag to do this. See: http://odetocode.com/Blogs/scott/archive/2006/04/10/3258.aspx
4 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
JavaScript & DHTML Cookbook Authors: Danny Goodman, Pages: 582, Published: 2007

Web:
Can a JavaScript source file be imported into a ContentPage? - ASP ... Can a JavaScript source file be imported into a ContentPage and sent to the MasterPage thru the ContentPlaceHolder? When I try this with the typical




Search This Site:










dynamic themes

masterpages & treeview navigation

sitemap custom attribute use

tree view node colors

dynamically adding html to navigation code

sitemap provider for menu control

menus in asp.net(vb)

app themes request

css not applied in any pages with a theme

loading a master page and a user control

treeview only showing startingnode with custom sitemapprovider, but menu works correctly!

css master page/content

sitemap: find currentnode's parentnode - which is just under rootnode

masterpage problem.image in masterpage not shows in childpages

theme gallery

sharing themes across multiple sites/web projects

horizontal tabbed menu?

themes aint workin' here ..!

cannot add border to menu items using cssclass

menucontrol selected property

preserving form control selections when navigating from and back to page

background image on the master page

treeview & sitemapdatasource

problems with aspxlab menu builder

creating infinite level hierarchical sitemap

changing appearance of sitemap powered menu control

find value of root node when child node is selected

can a masterpage and a content page have different css's

skinid not working on my custom web controls

weird error--code 0, expected ')'

  Privacy | Contact Us
All Times Are GMT