|
-
Sep 19th, 2002, 01:18 AM
#1
Thread Starter
Member
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
-
Sep 19th, 2002, 05:07 AM
#2
Fanatic Member
Article on using CodeBehind without Visual Studio.
http://www.asp101.com/articles/john/...vs/default.asp
John
-
Sep 19th, 2002, 09:12 AM
#3
Thread Starter
Member
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
-
Sep 24th, 2002, 04:47 PM
#4
Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|