Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / February 2006

Tip: Looking for answers? Try searching our database.

RegisterClientScriptInclude

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tom - 17 Feb 2006 19:39 GMT
I am new to ASP.NET.  I am converting a fairly good sized app from classic
to .net.  Some of my pages have a lot of controls and javascript functions.  
I would like to keep these intact as much as possible.  I have put my
javascript
in a seperate file and I am trying to include it using
RegisterClientScriptInclude.
Note, so far I have only been adding files to my web site,  I have not
created a 'Project' or web resources or assemblies.

Actually, none of the three methods of inserting code below are working.
What am I missing?

<%@ Page Language="VB" MasterPageFile="Main.master"
 AutoEventWireup="false"
 title="Login" %>
<script runat="server">
   Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs)
       Dim scriptText As String
       scriptText = "return confirm('Do you want to submit the page?')"
       ClientScript.RegisterOnSubmitStatement(Me.GetType(), _
           "ConfirmSubmit", scriptText)

       Dim myScript As String = "alert(document.forms[0]['usercode'].value);"
       Page.ClientScript.RegisterStartupScript(Me.GetType(), "myKey",
myScript, True)

       Page.ClientScript.RegisterClientScriptInclude(Me.GetType(),
"LoginJS", "Login.js")
   End Sub
</script>

TIA

Signature

Tom

Tom - 17 Feb 2006 22:15 GMT
Well, I tried all the variations on a page which is not
using a master page, and everything works fine.
So, how do I get this to work with a master page?

Signature

Tom


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.