Solved

I have the following asp page I wanted to add client side script but I do not know where to put it?

Posted on 2011-03-10
5
285 Views
Last Modified: 2012-06-27
my page with master looks like this,
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeBehind="deleteme.aspx.cs" Inherits="AceSA_12_12_2009.Prod.deleteme" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
</asp:Content>

I am trying to add popup calendar as in this example,

http://www.devx.com/vb2themax/Tip/18850


0
Comment
Question by:goodk
  • 2
  • 2
5 Comments
 
LVL 52

Assisted Solution

by:Carl Tawn
Carl Tawn earned 334 total points
ID: 35100994
Put it somewhere after the closing </asp:Content> tag. That way you will ensure that your HTML has finished loading before the script runs.
0
 
LVL 29

Assisted Solution

by:Paul Jackson
Paul Jackson earned 166 total points
ID: 35101155
I usually put mine between the content tags where it is being used and have never had any problem with it. Just make sure that on your master page your head tag is set to runat =server :

<head runat="server">
0
 

Author Comment

by:goodk
ID: 35113975
can you kindly, cut and paste the following code to show me how it would fit my page,  thanks a lot.

the code is,
<!DOCTYPE html>
<html>
<head>
  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
 
  <script>
  $(document).ready(function() {
    $("#datepicker").datepicker();
  });
  </script>
</head>
<body style="font-size:62.5%;">
 
<div type="text" id="datepicker"></div>

</body>



my page is,

<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeBehind="deleteme.aspx.cs" Inherits="AceSA_12_12_2009.Prod.deleteme" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
</asp:Content>



0
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 334 total points
ID: 35115680
These three lines:
  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>

Open in new window

Would go in between the <head> and </head> tags in your master page.

Then your content page would be:
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeBehind="deleteme.aspx.cs" Inherits="AceSA_12_12_2009.Prod.deleteme" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">


  <script>
  $(document).ready(function() {
    $("#datepicker").datepicker();
  });
  </script>
</asp:Content>

Open in new window

0
 

Author Closing Comment

by:goodk
ID: 35125321
thanks
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question