Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. .net Atlas project problems!!

.net Atlas project problems!!

Scheduled Pinned Locked Moved ASP.NET
csharpjavascriptsysadminhelp
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    richiemac
    wrote on last edited by
    #1

    Hi all, I've been looking through some simple Atlas samples but can't seem to get anything up and running. Heres the code (hopefully someone can help me out). I have a .aspx page which simply displays a message on a button click. The two errors are highlighted below. The first states i need a ';' and the second tells me that AtlasBook is undefined.

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="TestAtlasNamespace.aspx.cs" Inherits="TestAtlasNamespace" %>

        Untitled Page
        // <!CDATA\[
    
            function Button1\_onclick() {
                <b>var testCar = new AtlasBook.Car('Honda', 'Pilot', '2005');</b>
                alert(testCar.getMakeandModel());
                alert(testCar.getYear());
                return false;
            }
    
        // \]\]>
        
    
    
        
    
        <div>
            <atlas:ScriptManager ID="ScriptManager1" runat="server">
            </atlas:ScriptManager>
            
        </div>
    

    Here's the javascript file,

    // JScript File

    Type.registerNamespace("AtlasBook");
    AtlasBook.Car = funtion(strMake, strModel, strYear) {
    var m_Make = strMake;
    var m_Model = strModel;
    var m_Year = strYear;

    this.getMake = function() {
        return m\_Make;
    }
    
    this.getModel = function() {
        return m\_Model;
    }
    
    this.getYear = function() {
        return m\_Year;
    }
    
    this.getMakeandModel = function() {
        return m\_Make + ' ' + m\_Model;
    }
    
    this.dispose = function() {
        alert('bye ' + this.getName());
    }
    

    }
    Type.registerClass('AtlasBook.Car', null, Web.IDisposable);

    Thanks in advance for any help. I hope I made sense! :confused:

    M 1 Reply Last reply
    0
    • R richiemac

      Hi all, I've been looking through some simple Atlas samples but can't seem to get anything up and running. Heres the code (hopefully someone can help me out). I have a .aspx page which simply displays a message on a button click. The two errors are highlighted below. The first states i need a ';' and the second tells me that AtlasBook is undefined.

      <%@ Page Language="C#" AutoEventWireup="true" CodeFile="TestAtlasNamespace.aspx.cs" Inherits="TestAtlasNamespace" %>

          Untitled Page
          // <!CDATA\[
      
              function Button1\_onclick() {
                  <b>var testCar = new AtlasBook.Car('Honda', 'Pilot', '2005');</b>
                  alert(testCar.getMakeandModel());
                  alert(testCar.getYear());
                  return false;
              }
      
          // \]\]>
          
      
      
          
      
          <div>
              <atlas:ScriptManager ID="ScriptManager1" runat="server">
              </atlas:ScriptManager>
              
          </div>
      

      Here's the javascript file,

      // JScript File

      Type.registerNamespace("AtlasBook");
      AtlasBook.Car = funtion(strMake, strModel, strYear) {
      var m_Make = strMake;
      var m_Model = strModel;
      var m_Year = strYear;

      this.getMake = function() {
          return m\_Make;
      }
      
      this.getModel = function() {
          return m\_Model;
      }
      
      this.getYear = function() {
          return m\_Year;
      }
      
      this.getMakeandModel = function() {
          return m\_Make + ' ' + m\_Model;
      }
      
      this.dispose = function() {
          alert('bye ' + this.getName());
      }
      

      }
      Type.registerClass('AtlasBook.Car', null, Web.IDisposable);

      Thanks in advance for any help. I hope I made sense! :confused:

      M Offline
      M Offline
      minhpc_bk
      wrote on last edited by
      #2

      richiemac wrote:

      AtlasBook.Car = funtion(strMake, strModel, strYear)

      function

      richiemac wrote:

      Type.registerClass('AtlasBook.Car', null, Web.IDisposable);

      Depending on which version you are using, it can be Sys.IDisposable

      R 1 Reply Last reply
      0
      • M minhpc_bk

        richiemac wrote:

        AtlasBook.Car = funtion(strMake, strModel, strYear)

        function

        richiemac wrote:

        Type.registerClass('AtlasBook.Car', null, Web.IDisposable);

        Depending on which version you are using, it can be Sys.IDisposable

        R Offline
        R Offline
        richiemac
        wrote on last edited by
        #3

        What an idiot I am!! I knew it would be something trivial. :-O As for the Web vs Sys situation. How can I find out what version is being used so I know which to use. Oh and thanks for the help dude.

        M 1 Reply Last reply
        0
        • R richiemac

          What an idiot I am!! I knew it would be something trivial. :-O As for the Web vs Sys situation. How can I find out what version is being used so I know which to use. Oh and thanks for the help dude.

          M Offline
          M Offline
          minhpc_bk
          wrote on last edited by
          #4

          richiemac wrote:

          As for the Web vs Sys situation. How can I find out what version is being used so I know which to use.

          The Web.xxx has been changed to Sys.xxx since the release of the Atlas March CTP. You can see the Atlas Runtime version in the AtlasRuntime.js (or Atlas.js). Also, you can register a class in the new form classname.registerClass('classname',...):

          AtlasBook.Car.registerClass('AtlasBook.Car', null, Sys.IDisposable);

          R 1 Reply Last reply
          0
          • M minhpc_bk

            richiemac wrote:

            As for the Web vs Sys situation. How can I find out what version is being used so I know which to use.

            The Web.xxx has been changed to Sys.xxx since the release of the Atlas March CTP. You can see the Atlas Runtime version in the AtlasRuntime.js (or Atlas.js). Also, you can register a class in the new form classname.registerClass('classname',...):

            AtlasBook.Car.registerClass('AtlasBook.Car', null, Sys.IDisposable);

            R Offline
            R Offline
            richiemac
            wrote on last edited by
            #5

            Ahhh! That seems to have sorted out the problem with inheritance that I was having. You're one step ahead of me. :-) Nice one buddy!

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups