in

ASP.NET Weblogs

Sashidhar Kokku

  • Including JS file references in masterpages

     

    One of the issues I have faced with including site-wide JS files while developing web-applications is the simple fact that I was developing in Windows XP and IIS 5. And IIS puts in each of my websites as virtual-directories. So , I always have trouble including references to js files from the master-pages.

    One alternative was to have a virtual directory outside the project structure and point it to the js folder, and my references would work properly. But there are other nicer ways to do the same.

    1. Include the script tag as a server side tag, and give the reference to the file with a "~"

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Master page</title>    
        <script language="javascript" src="~/App_Common/Scripts/tablecloth.js" runat="server"></script>
    </head>
    <body>

    2. Add some code to your masterpage's load event that would register the file after resolving the client url.

    protected void Page_Load(object sender, EventArgs e)
     {
         this.Page.ClientScript.RegisterClientScriptInclude(this.GetType(), "tableCloth", this.ResolveClientUrl("~/App_Common/Scripts/tablecloth.js"));         
     }

     

    The above two approaches completely avoid having to create a virtual directory of any kind, and work all the time ... so long as the path is correct.

     

    References : http://forums.asp.net/t/908248.aspx

  • Codeplex project from 1906

    All I wanted to see was if there were any projects on Codeplex for SQL intellisense. What do I do....open up Firefox, type in "Sql Intellisense" in the search for codepex, and wola.....

    codeplex_thumb[1]

    Either the internet was that old....or maybe Codeplex stores just the last 2 digits of the year (HELLO ... Y2K !), or heck...Codeplex does not validate release dates.

    Posted Apr 08 2008, 10:13 PM by sashidhar with no comments
    Filed under:
  • Customary introduction.

     Sashidhar Kokku (aka me) is a dude who gets paid for punching the keyboard on a daily basis for the past almost 4 years (as of March 2008). His continuous punching results is web-portals for healthcare insurance companies.

    Regarding my education, I hold a Masters from Syracuse University in Computer Science. 

    Well....that sums up about me.

    What am I doing here? I hope to cover some topics in ASP.NET 2.0 and above, my pet projects, my daily discoveries, my "oh-shits", and yeah...and my eureka's (No..i don't code in my bath-tub). Sparing the regular topics that I cover, I will put link to some of the nifty stuff that I bump across during my daily information-intake sessions.

    Looking forward to doing a good job and keep myself occupied as well.

    And yeah...I also maintain my own blog at www.dynacx.com and a personal website at www.dynacx.net.
     

More Posts