For Programmers: Free Programming Magazines  


Home > Archive > ASP .NET > January 2008 > referencing a hidden input box









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author referencing a hidden input box
Paul Hansen

2008-01-20, 7:20 pm

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_2...work-aspnet.htm

Posted via DevelopmentNow.com Groups
http://www.developmentnow.com
Mark Rae [MVP]

2008-01-20, 7:20 pm

"Paul Hansen" <paul-hansen@ntlworld.com> wrote in message
news:412f1477-850b-4599-80db-54ae7a09138e@developmentnow.com...

> Using a hidden input box to store a password for web services


UNDER NO CIRCUMSTANCES DO THIS!!!!!

Do a View Source and you'll see why...


--
Mark Rae
ASP.NET MVP
http://www.markrae.net

rosoft

2008-01-20, 7:20 pm

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> </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

"Mark Rae [MVP]" <mark@markNOSPAMrae.net> skrev i meddelandet
news:eJvOFP4WIHA.3940@TK2MSFTNGP05.phx.gbl...
> "Paul Hansen" <paul-hansen@ntlworld.com> wrote in message
> news:412f1477-850b-4599-80db-54ae7a09138e@developmentnow.com...
>
>
> UNDER NO CIRCUMSTANCES DO THIS!!!!!
>
> Do a View Source and you'll see why...
>
>
> --
> Mark Rae
> ASP.NET MVP
> http://www.markrae.net



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com