Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Dec 2004
    Location
    Jamaica
    Posts
    592
    Thanks
    2
    Thanked 0 Times in 0 Posts

    What is runat really for?

    What can i do with script runat="server", really......

  • #2
    Regular Coder
    Join Date
    Jul 2004
    Location
    France
    Posts
    141
    Thanks
    0
    Thanked 0 Times in 0 Posts
    you can use a normal
    <div>hello</div>

    or
    <div id="div1" runat="server" />


    and on codebehind

    div1.text = "hello"

    you cannot do that with the first one

  • #3
    Regular Coder
    Join Date
    Dec 2004
    Location
    Jamaica
    Posts
    592
    Thanks
    2
    Thanked 0 Times in 0 Posts
    How about <script runat="server">?

  • #4
    Regular Coder
    Join Date
    Jul 2004
    Location
    France
    Posts
    141
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <%@ Page Language="VBScript" %>

    <script runat="server">
    Sub Page_load (Obj As Object, E As EventArgs)
    your code here
    End Sub
    </script>

    <html>
    <body><form id="frm" runat="server">
    ........ your page content here
    </form></body>
    <html>


    u use it when you write the code imto the aspx page directly

    I myself never use it

    in sted you have better to do >>>

    <%@ Page Language="VBScript" Codebehind="default.aspx.vb" Inherits="yourNameSpaceRoot.webSite.defaultPage"%>

    and write your server code into the default.aspx.vb page

    Codebehind="default.aspx.vb" is only using Visual Studio

    otherwise you must write >>> Src="default.aspx.vb"


    but <%@ Page Inherits="yourNameSpaceRoot.webSite.defaultPage"%>
    works too if you don't work with design

  • #5
    Regular Coder
    Join Date
    Dec 2004
    Location
    Jamaica
    Posts
    592
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Okay..... can you now answer the question in the rookie version?

    I'm new to ASP and thats just classic ASP mind you, and i wanna know what this can do before I soak my hands into ASP.Net


  •  

    Posting Permissions

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