DotNet Academy of Rajesh Rolen

Solutions by Rajesh Rolen

Set Script src from root folder (dynamic)

if u are working with master pages and u are using javascript menus on master to navigate child pages in content place holder.
for that u need to save java script code in a particular folder and give path of that file in master page but as we know that path gets change when ever we go up and down in hierarchical of pages then that menu got disappear because of static path of .js file so we need to give dynamic path for java script file..and to do so we need to write following code to get dynamic path which can work in hierarchical up and down.

below code in design view of master page
< script type="text/javascript" src=" < %# Page.ResolveClientUrl("~/images/right_menu/data.files/rolen.js")% > " > < /script >

and following code in page load of master page
Page.Header.DataBind();

0 comments:

Post a Comment

About this blog

My Blog List

Advertise On This Site

Site Info

Advertise on this Site

To advertise on this site please mail on RajeshRolen@gmail.com

Information Source

About

Pages

Dot Net Academy

Advertis in This Area of Site

Powered by Blogger.

Followers

Search This Blog