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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

757 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

25 Experts available now in Live!

Get 1:1 Help Now