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
283 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

910 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now