Results 1 to 4 of 4

Thread: how to seprate asp.net page?

  1. #1

    Thread Starter
    Member bamboosam's Avatar
    Join Date
    Feb 2001
    Posts
    61

    Unhappy how to seprate asp.net page?

    i made a very simple password chekcing page as follow, and it is work ,but when i seprate it to 2 page , then it not work,
    please help.

    code: (before seperate) name: test2.aspx

    test2.aspx
    --------------------------------------------------------------
    <html>
    <form method="GET" runat="server">
    <p>username: <input type="text" id="t1" size="20" runat="server"></p>
    <p>password: <input type="password" id="t2" size="20" runat = "server"></p>
    <p><input type="submit" value="Submit" name="B1" runat="server" onserverclick =

    "checkpassword"></p>
    <h2><span id ="output" runat="server"></span></h2>
    </form>
    </html>

    <script language ="vb" runat = "server">
    sub checkpassword(o as object, e as eventargs)

    if t1.value = "sam" and t2.value = "sam" then
    output.innerhtml="password right<br>"
    else
    output.innerhtml="password wrong<br>"
    end if

    end sub
    </script>
    ------------------------------------------------------------------------------

    code: (after seperate) name : index.html & test.aspx

    index.html
    ------------------------------------------------------------------------------
    <html>
    <form method="post" runat="server" action = "test.aspx">
    <p>username: <input type="text" id="t1" size="20" runat="server"></p>
    <p>password: <input type="password" id="t2" size="20" runat = "server"></p>
    <p>
    <input type="submit" name="B1" runat="server" onserverclick = "checkpassword"

    value="submit"></p>
    </form>
    </html>
    ------------------------------------------------------------------------------------

    test.aspx
    ------------------------------------------------------------------------------------
    <%@ page language = "vb" debug = "true" %>

    <script language ="vb" runat = "server">
    sub checkpassword(o as object, e as eventargs)

    if t1.value = "sam" and t2.value = "sam" then
    output.innerhtml="password right<br>"
    else
    output.innerhtml="password wrong<br>"
    end if
    end sub
    </script>

    <html>
    <h2><span id ="output" runat="server"></span></h2>
    </html>
    ------------------------------------------------------------------------------
    _______________________
    VB 6 professional
    java2 SDK 1.3

  2. #2
    Fanatic Member Patoooey's Avatar
    Join Date
    Aug 2001
    Location
    New Jersey, USA
    Posts
    774
    Article on using CodeBehind without Visual Studio.

    http://www.asp101.com/articles/john/...vs/default.asp

    John

  3. #3

    Thread Starter
    Member bamboosam's Avatar
    Join Date
    Feb 2001
    Posts
    61
    hi, i think code behide cannot solve my problem, i want to seperate the page,because i don't want input and output at the
    same page,i want the input page and output page have diffrent looking,can u help me about this,thanks
    _______________________
    VB 6 professional
    java2 SDK 1.3

  4. #4
    Member
    Join Date
    Dec 2000
    Location
    UK
    Posts
    39
    Try changing the references for the text fields to use the Request.Form collection eg 't1.value' to Request.Form.Item("t1") etc

    See if that helps

Posting Permissions

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



Click Here to Expand Forum to Full Width