referencing a hidden input box

R

rosoft

Hi

Don't know how to do it in ASP but in PHP you do as follows. And please can
some one tell me how to do this in ASP.NET code
since I'm transforming my homepage from PHP to ASPX.
?

<?php
$_SESSION["passwd"]=$_POST["key"]
$_SESSION["sername"]=$_POST["name"]
// This creates a cockie
// Then login to the database or what ever.
?>

In the html code I write

<form action="login.php" method="POST">
<table align="center" width="80%">
<tr>
<td>
<p>User</p>
</td>
<td>
<input type="text" name="name">
</td>
</tr>
<tr>
<td>
<p>Password</p>
</td>
<td>
<input type="password" name="key">
</td>
</tr>
<tr>
<td>
<p>&nbsp;</p>
</td>
<td>
<input type="submit" name="login" value="Login">
</td>
</tr>
</table>
</form>


The only drawback that I know of os that you store a session cockie on the
local machine. The cockie is deleted once the browser is closed. This can
cause Anti Virus programs to report the page. But that's not a major deals
unless you are distributing spyware or adware. The same message appear when
I log into my bank so I can pay my bills.


Lars
 
R

rosoft

Could this be equal to use a IMput (Password) from the HTML toolbox in the
IDE.

As for the "myString = idpassword.Value"
Haevn't comed to that part of knowledge about C#. But since C# is a class
library that would be my "guess". It's similar i Delphi, BCBuilder, JBuilder
and probably VB as well.

Is it possible to use some <asp:XXXXXXXX> </asp> in stead of the
<input..........> tag. Or is I way out of line here?

Lars


A small check with
Eliyahu Goldin said:
Apparently you are doing something like

myString = idpassword

Instead, do

myString = idpassword.Value

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net


Paul Hansen said:
Using a hidden input box to store a password for web services

input id="idpassword" type="hidden" value=" " runat="server"

throws this error
Compiler Error Message: BC30311: Value of type
'System.Web.UI.HtmlControls.HtmlInputHidden' cannot be converted to
'String'.

I would be grateful for any ideas


From
http://www.developmentnow.com/g/8_2003_11_0_25_0/dotnet-framework-aspnet.htm

Posted via DevelopmentNow.com Groups
http://www.developmentnow.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,708
Latest member
SherleneF1

Latest Threads

Top