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
  1. Home
  2. Web Development
  3. ASP.NET
  4. DEFINE statement?

DEFINE statement?

Scheduled Pinned Locked Moved ASP.NET
csharpc++asp-netquestion
4 Posts 2 Posters 6 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.
  • D Offline
    D Offline
    dazinith
    wrote on last edited by
    #1

    in c++ i grew accustomed to using DEFINE statements for my common text variables.. is there a way to do something like this in asp.net with c# in the global.asax? like:

    DEFINE USER_COMMON 100
    DEFINE USER_MOD 200
    DEFINE USER_ADMIN 400

    etc.. thanks! still a newb.. cut me some slack :P -dz

    I 1 Reply Last reply
    0
    • D dazinith

      in c++ i grew accustomed to using DEFINE statements for my common text variables.. is there a way to do something like this in asp.net with c# in the global.asax? like:

      DEFINE USER_COMMON 100
      DEFINE USER_MOD 200
      DEFINE USER_ADMIN 400

      etc.. thanks! still a newb.. cut me some slack :P -dz

      I Offline
      I Offline
      ian mariano
      wrote on last edited by
      #2

      You can use #define just like in C / C++ in C#. Please refer to the C# Preprocessor Directives[^]

      "The greatest danger to humanity is humanity without an open mind."
        - Ian Mariano - http://www.ian-space.com/

      D 2 Replies Last reply
      0
      • I ian mariano

        You can use #define just like in C / C++ in C#. Please refer to the C# Preprocessor Directives[^]

        "The greatest danger to humanity is humanity without an open mind."
          - Ian Mariano - http://www.ian-space.com/

        D Offline
        D Offline
        dazinith
        wrote on last edited by
        #3

        doh! my asp friend said he had never heard of such, guess he just never uses em! thanks a ton! still a newb.. cut me some slack :P -dz

        1 Reply Last reply
        0
        • I ian mariano

          You can use #define just like in C / C++ in C#. Please refer to the C# Preprocessor Directives[^]

          "The greatest danger to humanity is humanity without an open mind."
            - Ian Mariano - http://www.ian-space.com/

          D Offline
          D Offline
          dazinith
          wrote on last edited by
          #4

          guess i need a little more help.. ive added a line at the top of my aspx page which says:

          #define User_Admin "Administrator"

          then later in the html secion of the page i have

          <%= User_Admin %>

          but i get a compiler error of CS0103: The name 'User_Admin' does not exist in the class or namespace 'ASP.DailyNews_aspx' thanks for the help! still a newb.. cut me some slack :P -dz

          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