<%@ Page Language... question

Ask a Question related to ASP.NET Web Services, Design and Development.

  1. #1

    Default <%@ Page Language... question

    Hi I'm a new .NET developer and I was wondering if someone could
    explain to me what exactly does each of these things do.

    the "<%@ %>" -- does this define a namespace?

    Codebehind="WebForm1.aspx.cs"
    AutoEventWireup="false"
    Inherits="HelloWorld.WebForm1"

    and if i take those out and define the Page_Load function in the .aspx
    file what the differences, if any, would be if i left the above listed
    attributes in and defined the Page_Load function in the .aspx.cs file.
    Thanks,

    Ben

    coding in C#;

    Ben Ong Guest

  2. Similar Questions and Discussions

    1. Page Visibility and Language Translator
      Could anyone advise me, I have built an educational website? All finished, is it to late to add a feature, to help Viewers with visibility issues...
    2. CS2 Korean language/font question
      HELP! I'm designing a mailing that includes Korean. Since I don't speak the language, I had a client email her text in a Word document. I was...
    3. #25051 [Opn->WFx]: translating between gettext language identifiers and 'Accept-Language' ones
      ID: 25051 Updated by: sniper@php.net Reported By: wouter at grep dot be -Status: Open +Status: Wont...
    4. #25051 [NEW]: translating between gettext language identifiers and 'Accept-Language' ones
      From: wouter at grep dot be Operating system: irrelevant PHP version: Irrelevant PHP Bug Type: Feature/Change Request Bug...
    5. How to prevent the language icon from disappearing and a language switching delay?
      What is wrong with my question since nobody answers it? How to improve the question? "Dmitriy Kopnichev" <kopn@hotbox.ru> wrote in message...
  3. #2

    Default Re: <%@ Page Language... question

    If you put your code in the .ASPX file and not in code-behind, your site
    will be compiled at runtime.
    If you put your code in the code-behind file, then the site must be compiled
    before it will work.

    The attributes indicate the code behind file. In your case, you created a
    class "Hello.World.WebForm1" in the code behind file. If you notice, your
    ASPX page inherits from that. The page's class is something like
    "Hello.World.WebForm1_ASPX" and this is the class the gets executed on the
    server when the page is hit.

    If you do not have a codebehind file, and leave the directives on the ASPX
    page, when you load the page, it won't be able to find the code-behind file.
    (Parser error I believe)

    I also suggest using code-behind, because you catch the common errors that
    way: syntax errors, type mismatches, etc. If you don't compile your code,
    you are left with the front end compiling the code when the page is
    requested as well, which could slow down performance. Also, using code
    behind makes it easier to seperate the code from the display of the page.

    Steve






    "Ben Ong" <ben.ong@natoil.com> wrote in message
    news:1106754645.416996.101910@z14g2000cwz.googlegr oups.com...
    > Hi I'm a new .NET developer and I was wondering if someone could
    > explain to me what exactly does each of these things do.
    >
    > the "<%@ %>" -- does this define a namespace?
    >
    > Codebehind="WebForm1.aspx.cs"
    > AutoEventWireup="false"
    > Inherits="HelloWorld.WebForm1"
    >
    > and if i take those out and define the Page_Load function in the .aspx
    > file what the differences, if any, would be if i left the above listed
    > attributes in and defined the Page_Load function in the .aspx.cs file.
    > Thanks,
    >
    > Ben
    >
    > coding in C#;
    >

    Steve Lutz Guest

  4. #3

    Default Re: <%@ Page Language... question

    Thank you sir. I appreciate your help. That just made understanding
    how to code in visual studio and .net a little bit easier.

    -ben

    Ben Ong Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139