ASP.NET: User Control, Add JavaScript & CSS in UserControl

You can still add them as you normally would. Here’s a very simple example.
<%@ ControlLanguage=”C#”AutoEventWireup=”true”CodeFile=”HomePastAttendance.ascx.cs”Inherits=”UserControl_Print”%>
<script src=”../Scripts/jquery-1.4.1.js” type=”text/javascript”></script>
<script src=”; type=”text/javascript”></script>
<script src=”Scripts/JScript-local-file.js” type=”text/javascript”></script>
<script src=”//”type=”text/javascript”></script>
<script src=”Scripts/JScript-local-file.js” type=”text/javascript”></script>
    $(document).ready(function () {
<%@ Registersrc=”PagerControl.ascx”tagname=”PagerControl”tagprefix=”uc1″%>
<style type=”text/css”>
        width: 100%;
<h1>Print past attendance:</h1>
<p>Start Date: <input type=”text” id=”datepicker” /></p>
<br />

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s