Solved

Where to Put External JavaScript References Within ASPX File

Posted on 2012-03-27
1
630 Views
Last Modified: 2012-09-15
I am new to web development, and I am attempting to edit a piece of code to add some additional controls and redesign a portion of the page. In order to do this, I need to add some references to *.css files. I am using Visual Studio 2005, and I am receiving errors each time that I try to bring the web page up. Looking at the *.aspx file, I do not see what the cause of the issue is. Could someone point out to me where I would place the references to external *.css files and *.js files that need to be included with this page so I can update the overall design and functionality of the file. Could you also explain why I get errors when I add a <html> tag after the Register section of the code? The source code for the *.aspx page is below. Any help would be greatly appreciated.

<%@ Page Language="C#" MasterPageFile="~/_Templates/SomeCompany.master" AutoEventWireup="true" 
   CodeFile="fooRiskTerms.aspx.cs" Inherits="secure_programs_foorisk_fooriskterms" 
   Title="foo Terms" %> 

<%@ Register TagPrefix="uc1" TagName="user" Src="~/controls/user.ascx" %> 
<%@ Register TagPrefix="uc1" TagName="memberRIGHT1" Src="~/controls/contentRight.ascx" %> 



<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server"> 



   <script language="javascript1.2" type="text/javascript"> 
function valCheckBox() 
{ var chbx=document.getElementById("<%=cbxShareInfo.ClientID%>"); 
if (chbx.checked) {return true;} else 
 alert('You Must Agree to Share Your Registration Info by Clicking the Checkbox!'); 
return false; 
} 
   </script> 
    


   <div id="globalContainer"> 
       <div id="topglue"> 
           <div id="Bs"> 
               <div id="contentCap"> 
               </div> 
               <div id="breadcrumb"> 
                   <h1 class="breadtitle"> 
                       foo </h1> 
                   <p class="crumbnav"> 
                       <a href="/secure/default.aspx">Members Main</a> > <strong>foo Assessment</strong> 
                   </p> 
               </div> 
               <div id="login"> 
                   <uc1:user ID="User1" runat="server"></uc1:user> 
               </div> 
               <div class="clr"> 
               </div> 
               <div id="breadline"> 
               </div> 
           </div> 
           <div id="Bs3"> 
               <div id="contentLeftWide"> 
                   <div style="width: 500px; margin: 0px 0px 0px 20px;"> 
                       <div style="position: relative; padding: 0px 0px 0px 0px; margin: 0px 0px 5px 0px; 
                           height: 55px;"> 
                            
                            
                            
                            
                            
                            
                            
                            
                            
                            
                            
                            
                            
                            
                           <div style="position: absolute; left: 0; bottom: 0; width: 400px;"> 
                               <h1 class="contentsub1" style="padding: 0px 0px 0px 0px; margin: 0px 0px 0px 0px;"> 
                                   foo Assessment</h1> 
                             <!--  <h3 class="subcontent" style="padding: 0px 0px 0px 20px; margin: 0px 0px 0px 0px;"> 
                                   presented by Some Company</h3>--> 
                           </div> 
                           <div style="position: absolute; right: 0; bottom: 0; width: 100px;"> 
                               <img id='imgLogo" ' alt="" src="/a/global/color.gif" style="border: none;" /> 
                           </div> 
                       </div> 
                       <div class="dotlogo" style="padding: 0; margin: 0;"> 
                       </div> 
                   </div> 
                   <p class = "content"> 
                       <i>Some Company offers the foo Assessment to help you better manage your foo.</i> 
                       <br /> 
                   </p> 
                   <p class = "content"> 
                       <b>What is it:</b><br /> 
                       The foo Assessment is a series of questions about your <b> past  information, and daily foo.</b> We recommend that you complete the foo. 
                       <br /> 
                   </p> 
                   <p class = "content"> 
                       Please note, if your employer provides you a reimbursement for completing the foo Assessment, you will be reimbursed for taking the Assessment only once.* 
                       <br /> 
                   </p> 
                   <p class = "content"> 
                       Please allow up to <b>30 minutes to complete</b> the foo Assessment. 
                   <br /> 
                   </p> 
                   <p class = "content"> 
                       <b>Why take it:</b><br /> 
                       The foo Assessment will:     
                       <ul class = "uls"> 
                           <li type="square">Provide you with a <b>personalized, overall foo picture</b> 
                           <li type="square"><b>Identify your risk</b> for certain chronic diseases</li> 
                           <li type="square">Target recommendations to make <b>fooy lifestyle changes</b> today</li> 
                       </ul> 
                       <br /> 
                   </p> 
                   <p class = "content"> 
                       <b>Your results:</b><br /> 
                       When all of the foo Assessment questions have been answered, a <b>summary score</b> is calculated. This score will determine your foo category. 
                       <br /> 
                   </p> 
                   <p class="LeftList1Top"> 
                   </p> 
                   <h1 class="F0304"> 
                       Terms</h1> 
                   <ul> 
a                        <li type="square">Information provided will remain confidential, in accordance with the foo  Act (<a href="/privacy.htm" target="_blank">a</a>).</li> 
                       <li class="content" type = "square">This Assessment serves two purposes:</li> 
                   </ul> 
                   <ol> 
                       <li>To provide you with information to manage and improve your foo.</li> 
                       <li>To provide Some Company with information to help structure foo programs to benefit members.</li> 
                   </ol> 
                   <ul> 
                       <li type="square">Individual results are not shared with employers or plan sponsors.</li> 
                       <li type="square">Note: Your Member ID number, Group number and date of birth will be shared with the University of State.</li> 
                       <li type="square">The foo Assessment is on The University of State foo Management Research Center site.</li> 
                       <li type="square">Results may be used to identify foo programs that may benefit you.</li> 
                   </ul> 
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                        
                        
                        

                   <p class="content"> 
                       You will be leaving the Some Company site to access the HRA. Some Company will 
                       securely pass over your registration information to access this site. You can return 
                       to the Some Company site at any time by clicking the "Return To My foo Plan" 
                       link.</p> 
                   <h2 class="content"> 
                       Access your foo Assessment</h2> 
                   <p class="LeftList1Top"> 
                       <!--<img src="/a/global/shim.gif" width="1" height="5" alt="" border="0" />--> 
                   </p> 
                   <h1 class="F0304"> 
                       Terms</h1> 
                   <p class="content"> 
                       I understand the information I provide will remain confidential, in accordance with 
                       the foo . I understand that 
                       this assessment serves two purposes:</p> 
                   <ul id="ul20-10"> 
                       <li class="square">To provide me with information to manage my foo and what I can 
                           do to improve it.</li> 
                       <li class="square">To provide Some Company with information to help structure foo 
                           progamas to benefit the member group.</li> 
                   </ul> 
                   <p class="LeftList1Top"> 
                   </p> 
                   <h1 class="F0304"> 
                       Verification: *Required</h1> 
                   <ul id="ul20-10-0"> 
                       <li class="F0304"> 
                           <asp:PlaceHolder ID="plcDependentLevelAccess" runat="server"> 
                               <div class="F0304Left"> 
                                   Name:</div> 
                               <div class="F0304Right"> 
                                   <asp:Image runat="server" ImageUrl="~/aa/global/shim.gif" Width="1" Height="1" AlternateText="" 
                                       BorderWidth="0" /><asp:Label ID="lblName" runat="server"></asp:Label></div> 
                               <div class="clr"> 
                               </div> 
                           </asp:PlaceHolder> 
                       </li> 
                       <!--<li class="F0304"> 
                           <div class="F0304RightA"> 
                               <asp:Image runat="server" ImageUrl="~/aa/global/shim.gif" Width="1" Height="1" AlternateText="" 
                                   BorderWidth="0" /><asp:CheckBox ID="cbxShareInfo" runat="server" Text=""></asp:CheckBox></div> 
                           <div class="F0304RightB"> 
                               * I verify my name is <b><%=lblName.Text %></b><a href="javascript:showpopup();">Not You?</a></div> 
                           <div class="clr"> 
                           </div>  -->                               
                        <!--   <div class="F0304RightB"> 
                               Yes, I agree to share my registration information with The University of Michigan 
                               foo Management Research Center</div> 
                           <div class="clr"> 
                           </div> 
                       </li>--> 
                       <li class="F0304"> 
                           <div class="F0304LeftVerifyHRA"> 
                               <img height="1" alt="" src="/aa/global/shim.gif" width="1" style="border: none;" /> 
                               <asp:CheckBox ID="CheckBox1" runat="server" Text=""></asp:CheckBox></div> 
                           <div class="F0304RightVerifyHRA"> 
                           * I consent to share my registration and foo Assessment information with Some Company and The University of Michigan foo Management Research Center for use as stated in the Terms.</div> 
                           <div class="clr"> 
                           </div> 
                       </li> 
                        
                        
                        
                        
                        
                        
                   </ul> 
                    
                    
                    
                    
                    
                    
                    
                    
                    
                   <p class="LeftList1Top"> 
                   </p> 
                   <div class="content"> 
                       <span style="padding-left: 20px;"> 
                           <asp:ImageButton ID="imbSubmit" runat="server" OnClick="imbSubmit_Click" ImageUrl="/aa/btnHA_English.gif"></asp:ImageButton></span> 
                       <span style="padding-left: 20px;"> 
                           <asp:ImageButton ID="lnkSpanish" runat="server" OnClick="lnkSpanish_Click" ImageUrl="/aa/btnHA_Spanish.gif" /></span> 
                   </div> 
                   <p class="LeftList1Line"> 
                   </p> 
                   <p class="content"> 
                       <span class="small"><span class="alert">Disclaimer</span>: omitted</span> 
                   </p> 
               </div> 
               <div id="contentRightSmall"> 
                   <uc1:memberRIGHT1 ID="MemberRIGHT11" runat="server"></uc1:memberRIGHT1> 
               </div> 
               <div class="clr"> 
               </div> 
           </div> 
           <div class="clr"> 
           </div> 
           <div class="clr"> 
           </div> 
       </div> 
   </div> 
</asp:Content>

Open in new window

0
Comment
Question by:thenthorn1010
1 Comment
 
LVL 5

Accepted Solution

by:
Rainverse earned 500 total points
Comment Utility
This is a Content page for a Master-Content architecture. You would put the js and css references in the Masterpage.  You're getting errors when you add the html below the register tags because HTML needs to be placed inside the asp:content tag.

Take a look at this:
http://www.w3schools.com/aspnet/aspnet_masterpages.asp

-MJC
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

763 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

13 Experts available now in Live!

Get 1:1 Help Now