PDA

Click to See Complete Forum and Search --> : how to seprate asp.net page?


bamboosam
Sep 19th, 2002, 01:18 AM
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>
------------------------------------------------------------------------------

Patoooey
Sep 19th, 2002, 05:07 AM
Article on using CodeBehind without Visual Studio.

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

John

bamboosam
Sep 19th, 2002, 09:12 AM
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

Tryster
Sep 24th, 2002, 04:47 PM
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