Showing posts with label textbox. Show all posts
Showing posts with label textbox. Show all posts

Thursday, March 29, 2012

Passing values from a child window

hi all,
I have a parent window default.aspx which has a textbox(txtBox1) with
multiline property and a button.when the button is clicked a child
window pops up child.aspx.
I have four textboxes in child.aspx and a submit button.What I want to
happen is when I click the submit button all the values must be
displayed in the multiline textbox in a table format with header and
the values below or any formatted display with headers.
I am using,
window.opener.documents.forms[0].txtBox1.value method to pass the
values.
can anybody help me to fix the values from the child window to the
parent window in a formatted display.I have been trying this for a day.
thanksHello ssrivani@.gmail.com,
From what I understood, after opening the child window and filling in the ch
ild form, you want to be able to:
1- Format the form field values in an html table.
2- copy the resulting html to the opening window and have it inserted into t
he multi line text field.
Try the attached files and see if it works for you.

> hi all,
>
> I have a parent window default.aspx which has a textbox(txtBox1) with
> multiline property and a button.when the button is clicked a child
> window pops up child.aspx.
> I have four textboxes in child.aspx and a submit button.What I want to
> happen is when I click the submit button all the values must be
> displayed in the multiline textbox in a table format with header and
> the values below or any formatted display with headers.
> I am using,
> window.opener.documents.forms[0].txtBox1.value method to pass the
> values.
> can anybody help me to fix the values from the child window to the
> parent window in a formatted display.I have been trying this for a
> day.
>
> thanks
>

Saturday, March 24, 2012

Passing Variables

Hi. I need to be able to pass a few variables on a button click to refill a
form on a new page. I am using a few textbox's but when the button is
clicked the values are lost - I am convinced that these variables are being
disposed - but why? - and how can I fix it.

thanks
JamesAnd make sure you're not resetting the values in your Page_Load by testing
for !IsPostBack before initializing any values. Keep in mind that Page_Load
runs before your button event.

Dale

"James" <James@.REMOVEMEtamarsolutions.co.uk> wrote in message
news:cahrpo$4lt$1@.newsg1.svr.pol.co.uk...
> Hi. I need to be able to pass a few variables on a button click to refill
a
> form on a new page. I am using a few textbox's but when the button is
> clicked the values are lost - I am convinced that these variables are
being
> disposed - but why? - and how can I fix it.
> thanks
> James

Passing Variables

Hi. I need to be able to pass a few variables on a button click to refill a
form on a new page. I am using a few textbox's but when the button is
clicked the values are lost - I am convinced that these variables are being
disposed - but why? - and how can I fix it.
thanks
JamesJames,
Check that EnableViewState is set to True in the page directive.
Hth,
Phil Winstanley
Microsoft ASP.NET MVP
http://www.myservicescentral.com
And make sure you're not resetting the values in your Page_Load by testing
for !IsPostBack before initializing any values. Keep in mind that Page_Load
runs before your button event.
Dale
"James" <James@.REMOVEMEtamarsolutions.co.uk> wrote in message
news:cahrpo$4lt$1@.newsg1.svr.pol.co.uk...
> Hi. I need to be able to pass a few variables on a button click to refill
a
> form on a new page. I am using a few textbox's but when the button is
> clicked the values are lost - I am convinced that these variables are
being
> disposed - but why? - and how can I fix it.
> thanks
> James
>
James,
Yes as Dale states, it's important to check you're not wiping out your
hard work in the Page_Load event! But make sure the order of your
events is right too, use the Trace to check, but as a rule of thumb,
try and do all page specific stuff in the PreRender event.
Hth,
Phil Winstanley
Microsoft ASP.NET MVP
http://www.myservicescentral.com

passing variables between pages

I have a web app that searches a database and returns a datagrid table.
the user inputs the search terms into a textbox. The user selects the
info he wants and it sends him to a 2nd page, after another selection
it goes to a 3rd page. I have been able to pass the search term in my
textbox back and forth to all the pages using Context.items. Now the
user may click a button that is supposed to take him back to the first
page and reload the original datagrid. How do I get the variable
containing the search terms from the 3rd page back to the 1st page and
automatically perform the search or is there another way to recall the
datagrid? thanks.Why won't you put it in a session variable?

Eliyahu

<lacombpcs@.juno.com> wrote in message
news:1117539066.532083.18140@.g49g2000cwa.googlegro ups.com...
> I have a web app that searches a database and returns a datagrid table.
> the user inputs the search terms into a textbox. The user selects the
> info he wants and it sends him to a 2nd page, after another selection
> it goes to a 3rd page. I have been able to pass the search term in my
> textbox back and forth to all the pages using Context.items. Now the
> user may click a button that is supposed to take him back to the first
> page and reload the original datagrid. How do I get the variable
> containing the search terms from the 3rd page back to the 1st page and
> automatically perform the search or is there another way to recall the
> datagrid? thanks.
You could session variables (as already mentioned), you could still use
context items provided you know what the originating page was (ie. the fact
it came from the 3rd page). You could use an argument in the URL/query
string to set this. You could also save his info to a database, and use the
query string info to flag a reload of that info from the database.

There are many options.

--

- Paul Glavich
ASP.NET MVP
ASPInsider (www.aspinsiders.com)

<lacombpcs@.juno.com> wrote in message
news:1117539066.532083.18140@.g49g2000cwa.googlegro ups.com...
> I have a web app that searches a database and returns a datagrid table.
> the user inputs the search terms into a textbox. The user selects the
> info he wants and it sends him to a 2nd page, after another selection
> it goes to a 3rd page. I have been able to pass the search term in my
> textbox back and forth to all the pages using Context.items. Now the
> user may click a button that is supposed to take him back to the first
> page and reload the original datagrid. How do I get the variable
> containing the search terms from the 3rd page back to the 1st page and
> automatically perform the search or is there another way to recall the
> datagrid? thanks.

passing variables between pages

I have a web app that searches a database and returns a datagrid table.
the user inputs the search terms into a textbox. The user selects the
info he wants and it sends him to a 2nd page, after another selection
it goes to a 3rd page. I have been able to pass the search term in my
textbox back and forth to all the pages using Context.items. Now the
user may click a button that is supposed to take him back to the first
page and reload the original datagrid. How do I get the variable
containing the search terms from the 3rd page back to the 1st page and
automatically perform the search or is there another way to recall the
datagrid? thanks.can u keep the search variables in session?
bineesh
<lacombpcs@.juno.com> wrote in message
news:1117539066.532083.18140@.g49g2000cwa.googlegroups.com...
> I have a web app that searches a database and returns a datagrid table.
> the user inputs the search terms into a textbox. The user selects the
> info he wants and it sends him to a 2nd page, after another selection
> it goes to a 3rd page. I have been able to pass the search term in my
> textbox back and forth to all the pages using Context.items. Now the
> user may click a button that is supposed to take him back to the first
> page and reload the original datagrid. How do I get the variable
> containing the search terms from the 3rd page back to the 1st page and
> automatically perform the search or is there another way to recall the
> datagrid? thanks.
>
Why won't you put it in a session variable?
Eliyahu
<lacombpcs@.juno.com> wrote in message
news:1117539066.532083.18140@.g49g2000cwa.googlegroups.com...
> I have a web app that searches a database and returns a datagrid table.
> the user inputs the search terms into a textbox. The user selects the
> info he wants and it sends him to a 2nd page, after another selection
> it goes to a 3rd page. I have been able to pass the search term in my
> textbox back and forth to all the pages using Context.items. Now the
> user may click a button that is supposed to take him back to the first
> page and reload the original datagrid. How do I get the variable
> containing the search terms from the 3rd page back to the 1st page and
> automatically perform the search or is there another way to recall the
> datagrid? thanks.
>
You could session variables (as already mentioned), you could still use
context items provided you know what the originating page was (ie. the fact
it came from the 3rd page). You could use an argument in the URL/query
string to set this. You could also save his info to a database, and use the
query string info to flag a reload of that info from the database.
There are many options.
- Paul Glavich
ASP.NET MVP
ASPInsider (www.aspinsiders.com)
<lacombpcs@.juno.com> wrote in message
news:1117539066.532083.18140@.g49g2000cwa.googlegroups.com...
> I have a web app that searches a database and returns a datagrid table.
> the user inputs the search terms into a textbox. The user selects the
> info he wants and it sends him to a 2nd page, after another selection
> it goes to a 3rd page. I have been able to pass the search term in my
> textbox back and forth to all the pages using Context.items. Now the
> user may click a button that is supposed to take him back to the first
> page and reload the original datagrid. How do I get the variable
> containing the search terms from the 3rd page back to the 1st page and
> automatically perform the search or is there another way to recall the
> datagrid? thanks.
>

Wednesday, March 21, 2012

Passing variables problem

Hi i have a folowing problem
I have a textbox and a link.
When i click a link i would like to pass and value of the txtDeadLine,
but i do not know sintax.
Here is what i have:

<asp:TextBox id="txtDeadLine" runat="server" Width="100px"
CssClass="DDiText"></asp:TextBox
<A
onclick="window.open('Kalendar.aspx?textbox=txtDeadLine','c al','width=25
0,height=300,left=270,top=180')"
href="javascript:;"><IMG src="http://pics.10026.com/?src=Slike\cal.gif" border="0"></A
I know that what i need is something like this.

<A onclick="window.open('Kalendar.aspx?textbox=txtDeadLine&Value='Here i
do not know, ...

Thanks
Alexandar

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!You could a client side javacript function such as :

function MyAction()
{
window.open('url.asp?prm='+MyForm.elements["txtDeadLine"].value);
}

--

"acko bogicevic" <aconi2002@.yahoo.com> a crit dans le message de
news:%23qKpHmUyDHA.1524@.TK2MSFTNGP10.phx.gbl...
> Hi i have a folowing problem
> I have a textbox and a link.
> When i click a link i would like to pass and value of the txtDeadLine,
> but i do not know sintax.
> Here is what i have:
> <asp:TextBox id="txtDeadLine" runat="server" Width="100px"
> CssClass="DDiText"></asp:TextBox>
> <A
> onclick="window.open('Kalendar.aspx?textbox=txtDeadLine','c al','width=25
> 0,height=300,left=270,top=180')"
> href="http://links.10026.com/?link=javascript:;"><IMG src="http://pics.10026.com/?src=Slike\cal.gif" border="0"></A>
> I know that what i need is something like this.
> <A onclick="window.open('Kalendar.aspx?textbox=txtDeadLine&Value='Here i
> do not know, ...
> Thanks
> Alexandar
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!

Passing Variables to another webpage

Pls. help!!!!!!! jas started in ASP.NET.

How Can I Pass the text in a textbox to another webpage?
Thanks in advance . . .You have a number of ways in .NET to pass information but the whole point of .NET is that controls (textboxes) are programmatically accessible so in your postback you basically just say
sString = textbox1.text

However, if you're wanting to pass it to a completely different page, then you'd need to redirect and use either querystring, session or global module (type properties0 to hold the data.

eg

Sub onButtonClick (...)
sString = textbox1.text
response.redirect("myNewPage.aspx?ss=" & sString & "")

End sub
Take a look at the Global.asax File.

//-- define the vaiable

public class Global : System.Web.HttpApplication
{

//...

public static int anwStatus;

//...

}

//-- use the variable, e.g.
Global.anwStatus = 1;

by
Andreas

passing variables....

i am trying to pass a variable called EventID (which is read from my SQLDataBase) from my aspx page box to a textbox in the showmodaldialog.

I have a main aspx page called Main_calendar, where when you click a hyperlink a showmodaldialog box appears giving you two options: edit or delete. on the showmodaldialog box there is also a textbox (not visible at runtime) where i would like the EventID to be written to. when you click either of the two link buttons, a new aspx page is opened, which will take the eventID written in that textbox and perform a query based on it in the new edit/delete page.

im extremely stuck as to how i can retrieve this value and input it into the texbox first and then take the value of the textbox and write it to another webform. my programming isnt so great so please bear with me!

i can see how to to do the edit/delete query if i can just get the value written in the textbox into the webform - then the rest should just be easy (touch wood). but i just dont know where to start on the first bit! ive been stuck on this for days,

id greatly appreciate anyones help on this, thanks!

code attached as below:

Main_calendar code page:

int

evID = (int)dr["EventID"];

HyperLink link =new HyperLink();
link.ForeColor = Color.FromName(evColor);
link.ID = " + evID + ";
link.NavigateUrl = "#";
link.Attributes.Add("onClick", "window.showModalDialog('UpdateDeleteDialog.aspx', null, 'dialogHeight: 130px; dialogWidth: 235px; edge: Raised; center: Yes; help: No; resizable: No; status: No; ')");

evID is the Id of the event that i wish to write to a textbox on the UpdateDeleteDialog page

updatedeletedailog page

using

System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace CalendarBCP
{
///<summary>
/// Summary description for UpdateDeleteDialog.
///</summary>publicclass UpdateDeleteDialog : System.Web.UI.Page
{
protected System.Web.UI.WebControls.LinkButton LnkBtn_EditEvent;
protected System.Web.UI.WebControls.LinkButton LnkBtn_DeleteEvent;
protected System.Web.UI.WebControls.Label Label1;
protected System.Web.UI.WebControls.LinkButton Btn_Cancel;
protected System.Web.UI.WebControls.TextBoxTxt_EventID;
protected System.Web.UI.WebControls.Panel Panel1;

privatevoid Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
}

private

void Btn_Cancel_Click(object sender, System.EventArgs e)
{
Btn_Cancel.Attributes.Add("onclick", "window.close(); return:false;");
}privatevoid LnkBtn_EditEvent_Click(object sender, System.EventArgs e)
{
LnkBtn_EditEvent.Attributes.Add("onclick", "window.open(UpdateEvent.aspx);");
}privatevoid LnkBtn_DeleteEvent_Click(object sender, System.EventArgs e)
{
Response.Redirect("DeleteEvent.aspx");
}

Txt_EventID id the textbox in the UpdateDeleteDialog page where the eventId should be written

updatedeletdialog html:

<%@dotnet.itags.org. Page language="c#" Codebehind="UpdateDeleteDialog.aspx.cs" AutoEventWireup="false" Inherits="CalendarBCP.UpdateDeleteDialog" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >

<HTML>

<HEAD>

<title>UpdateDeleteDialog</title>

<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">

<meta content="C#" name="CODE_LANGUAGE">

<meta content="JavaScript" name="vs_defaultClientScript">

<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">

</HEAD>

<body ms_positioning="GridLayout">

<form id="Form1" method="post" runat="server">

<asp:Panel id="Panel1" style="Z-INDEX: 105; LEFT: 8px; POSITION: absolute; TOP: 8px" runat="server"

Width="216px" Height="64px" BackColor="Gainsboro">

<P>

<asp:Label id="Label1" runat="server" BackColor="DarkGreen" Height="24px" Width="200px" ForeColor="White"

Font-Size="10pt" Font-Names="Tahoma">Please Select one of the following:</asp:Label>

<asp:TextBox id="Txt_EventID" runat="server" Width="72px" Visible="False"></asp:TextBox><BR>

<asp:LinkButton id="LnkBtn_EditEvent" runat="server" BackColor="Transparent" ForeColor="DarkGreen"

Font-Size="10pt" Font-Names="Tahoma">Edit Event</asp:LinkButton>

<asp:LinkButton id="LnkBtn_DeleteEvent" runat="server" ForeColor="DarkGreen" Font-Size="10pt" Font-Names="Tahoma">Delete Event</asp:LinkButton>

<asp:LinkButton id="Btn_Cancel" runat="server" ForeColor="DarkGreen" Font-Size="10pt" Font-Names="Tahoma">Cancel</asp:LinkButton></P>

</asp:Panel></form>

</body>

</HTML>

Thanks in advance!

1. Not related to your question, but move ALL of your Attributes.Add statements into the Page_Load event handler.
2. Check here for the ways to pass varibles using showModalDialog:
http://forums.asp.net/thread/1240957.aspx

NC...


Thanks! just what i need!Big Smile [:D]

Friday, March 16, 2012

password

how i create a textbox for password using web controls

Paramita-

Are you asking how you can adding a TextBox to your page that hides the text input (a.k.a. password mode)?

If so, the solution is very easy. Simply add an ASP.NET Textbox to your page and set its TextMode property to Password, like this:

<asp:textbox runat="server" id="myTxtBox" TextMode="Password" />

Thanks~

Password appearing as blank

All

When I retieve the users password into a textbox
(password textmode) from the database nothing appears, am
I doing something mad?

ThanksThis is done for security reasons. If you set the value of a textbox in
password mode, it will not show anything.

The reason is, it would have to appear in the plain text in the HTML - and
this would be a security risk, as anyone could just look at it, or intercept
it.

"yop" <yop@.oceanfree.net> wrote in message
news:0bed01c36bc8$b34439d0$a401280a@.phx.gbl...
> All
> When I retieve the users password into a textbox
> (password textmode) from the database nothing appears, am
> I doing something mad?
> Thanks
This is done for security reasons. If you set the value of a textbox in
password mode, it will not show anything.

The reason is, it would have to appear in the plain text in the HTML - and
this would be a security risk, as anyone could just look at it, or intercept
it.

"yop" <yop@.oceanfree.net> wrote in message
news:0bed01c36bc8$b34439d0$a401280a@.phx.gbl...
> All
> When I retieve the users password into a textbox
> (password textmode) from the database nothing appears, am
> I doing something mad?
> Thanks
How important that the actual password be in there? You could emit client
side script to set the value there - except set it to a * for every actual
letter. That will basically show the length. If the user tries to edit it -
then blank the whole thing out.

"Yop" <yop@.oceanfree.net> wrote in message
news:056c01c36bd5$708a1710$a001280a@.phx.gbl...
> Marina
> Never thought of that, what work around would people
> suggest or do?
>
> >--Original Message--
> >This is done for security reasons. If you set the value
> of a textbox in
> >password mode, it will not show anything.
> >The reason is, it would have to appear in the plain text
> in the HTML - and
> >this would be a security risk, as anyone could just look
> at it, or intercept
> >it.
> >"yop" <yop@.oceanfree.net> wrote in message
> >news:0bed01c36bc8$b34439d0$a401280a@.phx.gbl...
> >> All
> >>
> >> When I retieve the users password into a textbox
> >> (password textmode) from the database nothing appears,
> am
> >> I doing something mad?
> >>
> >> Thanks
> >.
That is true, nah not overly important, just for a user
admin screen for the administrator only

>--Original Message--
>How important that the actual password be in there? You
could emit client
>side script to set the value there - except set it to a
* for every actual
>letter. That will basically show the length. If the user
tries to edit it -
>then blank the whole thing out.
>"Yop" <yop@.oceanfree.net> wrote in message
>news:056c01c36bd5$708a1710$a001280a@.phx.gbl...
>> Marina
>>
>> Never thought of that, what work around would people
>> suggest or do?
>>
>>
>> >--Original Message--
>> >This is done for security reasons. If you set the
value
>> of a textbox in
>> >password mode, it will not show anything.
>>> >The reason is, it would have to appear in the plain
text
>> in the HTML - and
>> >this would be a security risk, as anyone could just
look
>> at it, or intercept
>> >it.
>>> >"yop" <yop@.oceanfree.net> wrote in message
>> >news:0bed01c36bc8$b34439d0$a401280a@.phx.gbl...
>> >> All
>> >>
>> >> When I retieve the users password into a textbox
>> >> (password textmode) from the database nothing
appears,
>> am
>> >> I doing something mad?
>> >>
>> >> Thanks
>>>> >.
>>
>.
You really shouldn't be storing clear text passwords anyway.. you should
create a message digest based on what they typed in and save that..

Another plus, your admins would not be able to see a user password, only
reset it to something else (which is ideal)..

"yop" <yop@.oceanfree.net> wrote in message
news:010101c36be3$daab6640$a101280a@.phx.gbl...
> That is true, nah not overly important, just for a user
> admin screen for the administrator only
>
> >--Original Message--
> >How important that the actual password be in there? You
> could emit client
> >side script to set the value there - except set it to a
> * for every actual
> >letter. That will basically show the length. If the user
> tries to edit it -
> >then blank the whole thing out.
> >"Yop" <yop@.oceanfree.net> wrote in message
> >news:056c01c36bd5$708a1710$a001280a@.phx.gbl...
> >> Marina
> >>
> >> Never thought of that, what work around would people
> >> suggest or do?
> >>
> >>
> >> >--Original Message--
> >> >This is done for security reasons. If you set the
> value
> >> of a textbox in
> >> >password mode, it will not show anything.
> >> >> >The reason is, it would have to appear in the plain
> text
> >> in the HTML - and
> >> >this would be a security risk, as anyone could just
> look
> >> at it, or intercept
> >> >it.
> >> >> >"yop" <yop@.oceanfree.net> wrote in message
> >> >news:0bed01c36bc8$b34439d0$a401280a@.phx.gbl...
> >> >> All
> >> >>
> >> >> When I retieve the users password into a textbox
> >> >> (password textmode) from the database nothing
> appears,
> >> am
> >> >> I doing something mad?
> >> >>
> >> >> Thanks
> >> >> >> >.
> >> >.
That is what I will do, should have coped that is what
they are doing in Windows!

Thanks all

>--Original Message--
>You really shouldn't be storing clear text passwords
anyway.. you should
>create a message digest based on what they typed in and
save that..
>Another plus, your admins would not be able to see a
user password, only
>reset it to something else (which is ideal)..
>"yop" <yop@.oceanfree.net> wrote in message
>news:010101c36be3$daab6640$a101280a@.phx.gbl...
>> That is true, nah not overly important, just for a user
>> admin screen for the administrator only
>>
>>
>> >--Original Message--
>> >How important that the actual password be in there?
You
>> could emit client
>> >side script to set the value there - except set it to
a
>> * for every actual
>> >letter. That will basically show the length. If the
user
>> tries to edit it -
>> >then blank the whole thing out.
>>> >"Yop" <yop@.oceanfree.net> wrote in message
>> >news:056c01c36bd5$708a1710$a001280a@.phx.gbl...
>> >> Marina
>> >>
>> >> Never thought of that, what work around would people
>> >> suggest or do?
>> >>
>> >>
>> >> >--Original Message--
>> >> >This is done for security reasons. If you set the
>> value
>> >> of a textbox in
>> >> >password mode, it will not show anything.
>> >>> >> >The reason is, it would have to appear in the plain
>> text
>> >> in the HTML - and
>> >> >this would be a security risk, as anyone could just
>> look
>> >> at it, or intercept
>> >> >it.
>> >>> >> >"yop" <yop@.oceanfree.net> wrote in message
>> >> >news:0bed01c36bc8$b34439d0$a401280a@.phx.gbl...
>> >> >> All
>> >> >>
>> >> >> When I retieve the users password into a textbox
>> >> >> (password textmode) from the database nothing
>> appears,
>> >> am
>> >> >> I doing something mad?
>> >> >>
>> >> >> Thanks
>> >>> >>> >> >.
>> >>>>> >.
>>
>.

Password Field

Have a textbox that's in Password mode on a user creation page. Have
several dropdowns that cause a PostBack out of necessity on this page. I
cannot separate them. When one of these dropdowns changes, the textbox's
value is lost. How do I prevent this?

Thanksthe best way would be to remember it from the original postback, so it only
passes over the network once. otherwise you can use a hack, and set the
control's "value" attribute.

-- bruce (sqlwork.com)

"James" <minorkeys@.gmail.com> wrote in message
news:ODtJUcjEGHA.516@.TK2MSFTNGP15.phx.gbl...
> Have a textbox that's in Password mode on a user creation page. Have
> several dropdowns that cause a PostBack out of necessity on this page. I
> cannot separate them. When one of these dropdowns changes, the textbox's
> value is lost. How do I prevent this?
> Thanks
Can I? I've tried setting it in my Page Load event and it doesn't seem to
persist. I've also tried using a client side control with runat=server.
None of the above seem to want to let me set the value.

"Bruce Barker" <brubar_nospamplease_@.safeco.com> wrote in message
news:umI$3ijEGHA.2012@.TK2MSFTNGP14.phx.gbl...
> the best way would be to remember it from the original postback, so it
> only passes over the network once. otherwise you can use a hack, and set
> the control's "value" attribute.
> -- bruce (sqlwork.com)
>
> "James" <minorkeys@.gmail.com> wrote in message
> news:ODtJUcjEGHA.516@.TK2MSFTNGP15.phx.gbl...
>> Have a textbox that's in Password mode on a user creation page. Have
>> several dropdowns that cause a PostBack out of necessity on this page. I
>> cannot separate them. When one of these dropdowns changes, the textbox's
>> value is lost. How do I prevent this?
>>
>> Thanks
>>
You have to do it on the client side using javascript.

Losing the value of a password field is pretty standard. If the password
field is the last one on your page, it should in theory be the last field a
user fills in, so it geting emptied shouldn't really happen.

"James" <minorkeys@.gmail.com> wrote in message
news:%235n36mjEGHA.3200@.tk2msftngp13.phx.gbl...
> Can I? I've tried setting it in my Page Load event and it doesn't seem to
> persist. I've also tried using a client side control with runat=server.
> None of the above seem to want to let me set the value.
> "Bruce Barker" <brubar_nospamplease_@.safeco.com> wrote in message
> news:umI$3ijEGHA.2012@.TK2MSFTNGP14.phx.gbl...
>> the best way would be to remember it from the original postback, so it
>> only passes over the network once. otherwise you can use a hack, and set
>> the control's "value" attribute.
>>
>> -- bruce (sqlwork.com)
>>
>>
>>
>> "James" <minorkeys@.gmail.com> wrote in message
>> news:ODtJUcjEGHA.516@.TK2MSFTNGP15.phx.gbl...
>>> Have a textbox that's in Password mode on a user creation page. Have
>>> several dropdowns that cause a PostBack out of necessity on this page.
>>> I cannot separate them. When one of these dropdowns changes, the
>>> textbox's value is lost. How do I prevent this?
>>>
>>> Thanks
>>>
>>
>>
JavaScript doesn't seem to work either. It isn't the last field they will
enter, and even if it were, there's no way they'd go for that =/.

"Marina" <someone@.nospam.com> wrote in message
news:OTk4sojEGHA.524@.TK2MSFTNGP09.phx.gbl...
> You have to do it on the client side using javascript.
> Losing the value of a password field is pretty standard. If the password
> field is the last one on your page, it should in theory be the last field
> a user fills in, so it geting emptied shouldn't really happen.
> "James" <minorkeys@.gmail.com> wrote in message
> news:%235n36mjEGHA.3200@.tk2msftngp13.phx.gbl...
>> Can I? I've tried setting it in my Page Load event and it doesn't seem
>> to persist. I've also tried using a client side control with
>> runat=server. None of the above seem to want to let me set the value.
>>
>> "Bruce Barker" <brubar_nospamplease_@.safeco.com> wrote in message
>> news:umI$3ijEGHA.2012@.TK2MSFTNGP14.phx.gbl...
>>> the best way would be to remember it from the original postback, so it
>>> only passes over the network once. otherwise you can use a hack, and set
>>> the control's "value" attribute.
>>>
>>> -- bruce (sqlwork.com)
>>>
>>>
>>>
>>> "James" <minorkeys@.gmail.com> wrote in message
>>> news:ODtJUcjEGHA.516@.TK2MSFTNGP15.phx.gbl...
>>>> Have a textbox that's in Password mode on a user creation page. Have
>>>> several dropdowns that cause a PostBack out of necessity on this page.
>>>> I cannot separate them. When one of these dropdowns changes, the
>>>> textbox's value is lost. How do I prevent this?
>>>>
>>>> Thanks
>>>>
>>>
>>>
>>
>>
I know for a fact that if you set the value on an input control that is a
password type in javascript, that it does get set correctly. Maybe you need
to post your code then.

I bet your users will like the fact that their password is being sent in
clear text in the browser even less then having to retype their password,
since that is the only way to preserve it in between posts. I would
recommend either accepting that passwords will be blank between posts (this
happens pretty much in every other registration system), re-organize your
registration in such a way that the password gets its own page and it is the
last page in the registration process, or code using the javascript solution
and have the password be sent in clear text - which should be the last
resort.

"James" <minorkeys@.gmail.com> wrote in message
news:uzLRXrjEGHA.1032@.TK2MSFTNGP11.phx.gbl...
> JavaScript doesn't seem to work either. It isn't the last field they will
> enter, and even if it were, there's no way they'd go for that =/.
> "Marina" <someone@.nospam.com> wrote in message
> news:OTk4sojEGHA.524@.TK2MSFTNGP09.phx.gbl...
>> You have to do it on the client side using javascript.
>>
>> Losing the value of a password field is pretty standard. If the password
>> field is the last one on your page, it should in theory be the last field
>> a user fills in, so it geting emptied shouldn't really happen.
>>
>> "James" <minorkeys@.gmail.com> wrote in message
>> news:%235n36mjEGHA.3200@.tk2msftngp13.phx.gbl...
>>> Can I? I've tried setting it in my Page Load event and it doesn't seem
>>> to persist. I've also tried using a client side control with
>>> runat=server. None of the above seem to want to let me set the value.
>>>
>>> "Bruce Barker" <brubar_nospamplease_@.safeco.com> wrote in message
>>> news:umI$3ijEGHA.2012@.TK2MSFTNGP14.phx.gbl...
>>>> the best way would be to remember it from the original postback, so it
>>>> only passes over the network once. otherwise you can use a hack, and
>>>> set the control's "value" attribute.
>>>>
>>>> -- bruce (sqlwork.com)
>>>>
>>>>
>>>>
>>>> "James" <minorkeys@.gmail.com> wrote in message
>>>> news:ODtJUcjEGHA.516@.TK2MSFTNGP15.phx.gbl...
>>>>> Have a textbox that's in Password mode on a user creation page. Have
>>>>> several dropdowns that cause a PostBack out of necessity on this page.
>>>>> I cannot separate them. When one of these dropdowns changes, the
>>>>> textbox's value is lost. How do I prevent this?
>>>>>
>>>>> Thanks
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
Thanks for the help, this seems to work on Postback:

tbPassword.Attributes("value") = tbPassword.Text

"Marina" <someone@.nospam.com> wrote in message
news:eKbInxjEGHA.216@.TK2MSFTNGP15.phx.gbl...
>I know for a fact that if you set the value on an input control that is a
>password type in javascript, that it does get set correctly. Maybe you
>need to post your code then.
> I bet your users will like the fact that their password is being sent in
> clear text in the browser even less then having to retype their password,
> since that is the only way to preserve it in between posts. I would
> recommend either accepting that passwords will be blank between posts
> (this happens pretty much in every other registration system), re-organize
> your registration in such a way that the password gets its own page and it
> is the last page in the registration process, or code using the javascript
> solution and have the password be sent in clear text - which should be the
> last resort.
> "James" <minorkeys@.gmail.com> wrote in message
> news:uzLRXrjEGHA.1032@.TK2MSFTNGP11.phx.gbl...
>> JavaScript doesn't seem to work either. It isn't the last field they
>> will enter, and even if it were, there's no way they'd go for that =/.
>>
>> "Marina" <someone@.nospam.com> wrote in message
>> news:OTk4sojEGHA.524@.TK2MSFTNGP09.phx.gbl...
>>> You have to do it on the client side using javascript.
>>>
>>> Losing the value of a password field is pretty standard. If the
>>> password field is the last one on your page, it should in theory be the
>>> last field a user fills in, so it geting emptied shouldn't really
>>> happen.
>>>
>>> "James" <minorkeys@.gmail.com> wrote in message
>>> news:%235n36mjEGHA.3200@.tk2msftngp13.phx.gbl...
>>>> Can I? I've tried setting it in my Page Load event and it doesn't seem
>>>> to persist. I've also tried using a client side control with
>>>> runat=server. None of the above seem to want to let me set the value.
>>>>
>>>> "Bruce Barker" <brubar_nospamplease_@.safeco.com> wrote in message
>>>> news:umI$3ijEGHA.2012@.TK2MSFTNGP14.phx.gbl...
>>>>> the best way would be to remember it from the original postback, so it
>>>>> only passes over the network once. otherwise you can use a hack, and
>>>>> set the control's "value" attribute.
>>>>>
>>>>> -- bruce (sqlwork.com)
>>>>>
>>>>>
>>>>>
>>>>> "James" <minorkeys@.gmail.com> wrote in message
>>>>> news:ODtJUcjEGHA.516@.TK2MSFTNGP15.phx.gbl...
>>>>>> Have a textbox that's in Password mode on a user creation page. Have
>>>>>> several dropdowns that cause a PostBack out of necessity on this
>>>>>> page. I cannot separate them. When one of these dropdowns changes,
>>>>>> the textbox's value is lost. How do I prevent this?
>>>>>>
>>>>>> Thanks
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>

Password field

In ASP.Net I would like to create a text box that is a Password Field.
How do I do that ?
When I use the Textbox Field (from Toolbox - Standard), I did not find
anything there that can make it a password field.
When I use the Input (Password) Field (From Toolbox - HTML), in my
Submit command button when I do Request.Form("txtPassword") or
Request.QueryString("txtPassword") it returns nothing.

This is from Page1.aspx
<input id="txtPassword" type="password" />

This is from Page1.aspx.vb:
Protected Sub cmdSubmit_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles cmdSubmit.Click
sPassword = Request.Form("txtPassword") --nothing

Thank you.<fiefie.niles@.gmail.comwrote in message
news:1177277182.866667.28220@.b75g2000hsg.googlegro ups.com...

Quote:

Originally Posted by

In ASP.Net I would like to create a text box that is a Password Field.
How do I do that ?


<asp:TextBox ID="txtPassword" runat="server" TextMode="Password" />
When I click on the hyperlink you wrote
news:1177277182.866667.28220@.b75g2000hsg.googlegro ups.com...
it says "Page not found".
Can you please retype the link ? Thank you very much.

On Apr 22, 4:43 pm, "Mark Rae" <m...@.markNOSPAMrae.netwrote:

Quote:

Originally Posted by

<fiefie.ni...@.gmail.comwrote in message
>
news:1177277182.866667.28220@.b75g2000hsg.googlegro ups.com...
>

Quote:

Originally Posted by

In ASP.Net I would like to create a text box that is a Password Field.
How do I do that ?


>
<asp:TextBox ID="txtPassword" runat="server" TextMode="Password" />


You can only click on that hyperlink from a newsreader, not from a browser.

Notice the news: protocol

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
<fiefie.niles@.gmail.comwrote in message
news:1177278845.344621.129990@.y80g2000hsf.googlegr oups.com...

Quote:

Originally Posted by

When I click on the hyperlink you wrote
news:1177277182.866667.28220@.b75g2000hsg.googlegro ups.com...
it says "Page not found".
Can you please retype the link ? Thank you very much.
>
On Apr 22, 4:43 pm, "Mark Rae" <m...@.markNOSPAMrae.netwrote:

Quote:

Originally Posted by

><fiefie.ni...@.gmail.comwrote in message
>>
>news:1177277182.866667.28220@.b75g2000hsg.googlegro ups.com...
>>

Quote:

Originally Posted by

In ASP.Net I would like to create a text box that is a Password Field.
How do I do that ?


>>
><asp:TextBox ID="txtPassword" runat="server" TextMode="Password" />


>
>


<fiefie.niles@.gmail.comwrote in message
news:1177278845.344621.129990@.y80g2000hsf.googlegr oups.com...

Quote:

Originally Posted by

When I click on the hyperlink you wrote


What hyperlink...?
See my earlier reply, MArk.

He means the news: protocol hyperlink which is quoted
in your reply because you used a newsreader to reply to him.

He's using a browser...and the news: protocol doesn't work in browsers
unless it also has the double slashes and the server's address.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Mark Rae" <mark@.markNOSPAMrae.netwrote in message news:O5dS0pShHHA.1312@.TK2MSFTNGP03.phx.gbl...

Quote:

Originally Posted by

<fiefie.niles@.gmail.comwrote in message
news:1177278845.344621.129990@.y80g2000hsf.googlegr oups.com...
>

Quote:

Originally Posted by

>When I click on the hyperlink you wrote


>
What hyperlink...?
>


"Juan T. Llibre" <nomailreplies@.nowhere.comwrote in message
news:ezMak%23ShHHA.3960@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

See my earlier reply, MArk.
>
He means the news: protocol hyperlink which is quoted
in your reply because you used a newsreader to reply to him.
>
He's using a browser...and the news: protocol doesn't work in browsers
unless it also has the double slashes and the server's address.


Ah right...
Oh, I see your reply. I got it. Sorry about the confusion.
That works !
Thanks a lot.

On Apr 22, 5:51 pm, "Mark Rae" <m...@.markNOSPAMrae.netwrote:

Quote:

Originally Posted by

"Juan T. Llibre" <nomailrepl...@.nowhere.comwrote in messagenews:ezMak%23ShHHA.3960@.TK2MSFTNGP02.phx.gb l...
>

Quote:

Originally Posted by

See my earlier reply, MArk.


>

Quote:

Originally Posted by

He means the news: protocol hyperlink which is quoted
in your reply because you used a newsreader to reply to him.


>

Quote:

Originally Posted by

He's using a browser...and the news: protocol doesn't work in browsers
unless it also has the double slashes and the server's address.


>
Ah right...

Password field

In ASP.Net I would like to create a text box that is a Password Field.
How do I do that ?
When I use the Textbox Field (from Toolbox - Standard), I did not find
anything there that can make it a password field.
When I use the Input (Password) Field (From Toolbox - HTML), in my
Submit command button when I do Request.Form("txtPassword") or
Request.QueryString("txtPassword") it returns nothing.
This is from Page1.aspx
<input id="txtPassword" type="password" />
This is from Page1.aspx.vb:
Protected Sub cmdSubmit_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles cmdSubmit.Click
sPassword = Request.Form("txtPassword") --> nothing
Thank you.<fiefie.niles@.gmail.com> wrote in message
news:1177277182.866667.28220@.b75g2000hsg.googlegroups.com...

> In ASP.Net I would like to create a text box that is a Password Field.
> How do I do that ?
<asp:TextBox ID="txtPassword" runat="server" TextMode="Password" />
When I click on the hyperlink you wrote
news:1177277182.866667.28220@.b75g2000hsg.googlegroups.com...
it says "Page not found".
Can you please retype the link ? Thank you very much.
On Apr 22, 4:43 pm, "Mark Rae" <m...@.markNOSPAMrae.net> wrote:
> <fiefie.ni...@.gmail.com> wrote in message
> news:1177277182.866667.28220@.b75g2000hsg.googlegroups.com...
>
> <asp:TextBox ID="txtPassword" runat="server" TextMode="Password" />
You can only click on that hyperlink from a newsreader, not from a browser.
Notice the news: protocol
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
<fiefie.niles@.gmail.com> wrote in message
news:1177278845.344621.129990@.y80g2000hsf.googlegroups.com...
> When I click on the hyperlink you wrote
> news:1177277182.866667.28220@.b75g2000hsg.googlegroups.com...
> it says "Page not found".
> Can you please retype the link ? Thank you very much.
> On Apr 22, 4:43 pm, "Mark Rae" <m...@.markNOSPAMrae.net> wrote:
>
<fiefie.niles@.gmail.com> wrote in message
news:1177278845.344621.129990@.y80g2000hsf.googlegroups.com...

> When I click on the hyperlink you wrote
What hyperlink...?
See my earlier reply, MArk.
He means the news: protocol hyperlink which is quoted
in your reply because you used a newsreader to reply to him.
He's using a browser...and the news: protocol doesn't work in browsers
unless it also has the double slashes and the server's address.
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Mark Rae" <mark@.markNOSPAMrae.net> wrote in message news:O5dS0pShHHA.1312@.TK2MSFTNGP03.phx
.gbl...
> <fiefie.niles@.gmail.com> wrote in message
> news:1177278845.344621.129990@.y80g2000hsf.googlegroups.com...
>
> What hyperlink...?
>
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:ezMak%23ShHHA.3960@.TK2MSFTNGP02.phx.gbl...

> See my earlier reply, MArk.
> He means the news: protocol hyperlink which is quoted
> in your reply because you used a newsreader to reply to him.
> He's using a browser...and the news: protocol doesn't work in browsers
> unless it also has the double slashes and the server's address.
Ah right...
Oh, I see your reply. I got it. Sorry about the confusion.
That works !
Thanks a lot.
On Apr 22, 5:51 pm, "Mark Rae" <m...@.markNOSPAMrae.net> wrote:
> "Juan T. Llibre" <nomailrepl...@.nowhere.com> wrote in messagenews:ezMak%23
ShHHA.3960@.TK2MSFTNGP02.phx.gbl...
>
>
>
> Ah right...

Password Field

Have a textbox that's in Password mode on a user creation page. Have
several dropdowns that cause a PostBack out of necessity on this page. I
cannot separate them. When one of these dropdowns changes, the textbox's
value is lost. How do I prevent this?
Thanksthe best way would be to remember it from the original postback, so it only
passes over the network once. otherwise you can use a hack, and set the
control's "value" attribute.
-- bruce (sqlwork.com)
"James" <minorkeys@.gmail.com> wrote in message
news:ODtJUcjEGHA.516@.TK2MSFTNGP15.phx.gbl...
> Have a textbox that's in Password mode on a user creation page. Have
> several dropdowns that cause a PostBack out of necessity on this page. I
> cannot separate them. When one of these dropdowns changes, the textbox's
> value is lost. How do I prevent this?
> Thanks
>
Can I? I've tried setting it in my Page Load event and it doesn't seem to
persist. I've also tried using a client side control with runat=server.
None of the above seem to want to let me set the value.
"Bruce Barker" <brubar_nospamplease_@.safeco.com> wrote in message
news:umI$3ijEGHA.2012@.TK2MSFTNGP14.phx.gbl...
> the best way would be to remember it from the original postback, so it
> only passes over the network once. otherwise you can use a hack, and set
> the control's "value" attribute.
> -- bruce (sqlwork.com)
>
> "James" <minorkeys@.gmail.com> wrote in message
> news:ODtJUcjEGHA.516@.TK2MSFTNGP15.phx.gbl...
>
You have to do it on the client side using javascript.
Losing the value of a password field is pretty standard. If the password
field is the last one on your page, it should in theory be the last field a
user fills in, so it geting emptied shouldn't really happen.
"James" <minorkeys@.gmail.com> wrote in message
news:%235n36mjEGHA.3200@.tk2msftngp13.phx.gbl...
> Can I? I've tried setting it in my Page Load event and it doesn't seem to
> persist. I've also tried using a client side control with runat=server.
> None of the above seem to want to let me set the value.
> "Bruce Barker" <brubar_nospamplease_@.safeco.com> wrote in message
> news:umI$3ijEGHA.2012@.TK2MSFTNGP14.phx.gbl...
>
JavaScript doesn't seem to work either. It isn't the last field they will
enter, and even if it were, there's no way they'd go for that =/.
"Marina" <someone@.nospam.com> wrote in message
news:OTk4sojEGHA.524@.TK2MSFTNGP09.phx.gbl...
> You have to do it on the client side using javascript.
> Losing the value of a password field is pretty standard. If the password
> field is the last one on your page, it should in theory be the last field
> a user fills in, so it geting emptied shouldn't really happen.
> "James" <minorkeys@.gmail.com> wrote in message
> news:%235n36mjEGHA.3200@.tk2msftngp13.phx.gbl...
>
I know for a fact that if you set the value on an input control that is a
password type in javascript, that it does get set correctly. Maybe you need
to post your code then.
I bet your users will like the fact that their password is being sent in
clear text in the browser even less then having to retype their password,
since that is the only way to preserve it in between posts. I would
recommend either accepting that passwords will be blank between posts (this
happens pretty much in every other registration system), re-organize your
registration in such a way that the password gets its own page and it is the
last page in the registration process, or code using the javascript solution
and have the password be sent in clear text - which should be the last
resort.
"James" <minorkeys@.gmail.com> wrote in message
news:uzLRXrjEGHA.1032@.TK2MSFTNGP11.phx.gbl...
> JavaScript doesn't seem to work either. It isn't the last field they will
> enter, and even if it were, there's no way they'd go for that =/.
> "Marina" <someone@.nospam.com> wrote in message
> news:OTk4sojEGHA.524@.TK2MSFTNGP09.phx.gbl...
>
Thanks for the help, this seems to work on Postback:
tbPassword.Attributes("value") = tbPassword.Text
"Marina" <someone@.nospam.com> wrote in message
news:eKbInxjEGHA.216@.TK2MSFTNGP15.phx.gbl...
>I know for a fact that if you set the value on an input control that is a
>password type in javascript, that it does get set correctly. Maybe you
>need to post your code then.
> I bet your users will like the fact that their password is being sent in
> clear text in the browser even less then having to retype their password,
> since that is the only way to preserve it in between posts. I would
> recommend either accepting that passwords will be blank between posts
> (this happens pretty much in every other registration system), re-organize
> your registration in such a way that the password gets its own page and it
> is the last page in the registration process, or code using the javascript
> solution and have the password be sent in clear text - which should be the
> last resort.
> "James" <minorkeys@.gmail.com> wrote in message
> news:uzLRXrjEGHA.1032@.TK2MSFTNGP11.phx.gbl...
>

Password field is cleared after postback

Hello,
I am developing a C# asp.net application.
I have a webform which contains 2 dropdowns and a textbox with
type="password".
On "SelectedIndexChanged" event of the first dropdown, there is a postback,
in order to fill the second dropdown according to the value selected in the
first dropdown.
The problem is that the password field which has been filled up before is
cleared after postback.
I know this is for security, but is there a way to keep the password'
Thank youdana lees wrote:

> Hello,
> I am developing a C# asp.net application.
> I have a webform which contains 2 dropdowns and a textbox with
> type="password".
> On "SelectedIndexChanged" event of the first dropdown, there is a
> postback, in order to fill the second dropdown according to the value
> selected in the first dropdown.
> The problem is that the password field which has been filled up before is
> cleared after postback.
> I know this is for security, but is there a way to keep the password'
> Thank you
Yes, you can add a "value" attribute to the password textbox on postback:
txtPassword.Attributes.Add("value", txtPassword.Text)
Ben
I have tried that and it didn't work. The field stayed empty...
"Ben Amada" <ben@.REpoMOweVErpick.com> wrote in message
news:OaFdNkA8FHA.3804@.TK2MSFTNGP12.phx.gbl...
> dana lees wrote:
>
is
> Yes, you can add a "value" attribute to the password textbox on postback:
> txtPassword.Attributes.Add("value", txtPassword.Text)
> Ben
>
dana lees wrote:

> I have tried that and it didn't work. The field stayed empty...
Hmm... not sure why that doesn't work. Are you using .NET v2.0? I've done
it in v1.1 without any problems.
Another option is to manually set the value of the password field via
JavaScript. There are several ways to do this.
One way is to create a hidden input field. On postback, put the password in
the hidden input field (i.e. txtHiddenPwd.Value = txtPwd.Text). Then with a
startup script or via the body tag's onload attribute, set the value of the
password textbox to the value of the hidden input field.
Ben
I am using version 1.1.
On debug, I see that i do have the value of the password after postback, i
just can't set the textbox with that value.
I have tried also java script:
document.all.txtPassword.InnerText = "some text";
and this doesn't work as well...
I don't need to use a hidden textbox becuase i do have the value after
postback, i just can't set the textbox's value to that value...
"Ben Amada" <ben@.REpoMOweVErpick.com> wrote in message
news:u2Kz1wA8FHA.4076@.tk2msftngp13.phx.gbl...
> dana lees wrote:
>
> Hmm... not sure why that doesn't work. Are you using .NET v2.0? I've
done
> it in v1.1 without any problems.
> Another option is to manually set the value of the password field via
> JavaScript. There are several ways to do this.
> One way is to create a hidden input field. On postback, put the password
in
> the hidden input field (i.e. txtHiddenPwd.Value = txtPwd.Text). Then with
a
> startup script or via the body tag's onload attribute, set the value of
the
> password textbox to the value of the hidden input field.
> Ben
>
dana lees wrote:

> I am using version 1.1.
> On debug, I see that i do have the value of the password after postback, i
> just can't set the textbox with that value.
> I have tried also java script:
> document.all.txtPassword.InnerText = "some text";
> and this doesn't work as well...
> I don't need to use a hidden textbox becuase i do have the value after
> postback, i just can't set the textbox's value to that value...
Server-side you can't set the textbox's value to the password. However,
with JavaScript (client-side) you should be able to set the value of the
textbox with or without a hidden input field. Without a hidden input field,
you could simply add a runat="server" attribute to the <body> tag, then on
the server-side during a postback, you can add an "onload" attribute to the
body tag specifying the password value. Like this:
===== HTML =====
<body id="myBody" runat="server">
===== Code-Behind =====
myBody.Attributes.Add("onload", _
"document.getElementById('txtPassword').value = '" & _
txtPassword.Text & "'")
(the C# syntax should be similar)
Also, in the code-behind, if Visual Studio doesn't recognize the "myBody"
control (which happens sometimes), you'll probably have to manually add the
control declaration to the code-behind:
Dim myBody As HtmlControls.HtmlGenericControl
... or instead of adding an "onload" attribute to the body tag, you could
use the RegisterStartupScript method to set the password textbox value.
Ben
dana lees wrote:

> I have tried also java script:
> document.all.txtPassword.InnerText = "some text";
> and this doesn't work as well...
By the way, what do you mean that it "doesn't work as well"? How about :
document.getElementById('txtPassword').value = "some text";
Ben
It worked, when using
document.getElementById('txtPassword').value = "some text";
Thank you very much :-)
"Ben Amada" <ben@.REpoMOweVErpick.com> wrote in message
news:%23G3ExQB8FHA.3200@.TK2MSFTNGP11.phx.gbl...
> dana lees wrote:
>
> By the way, what do you mean that it "doesn't work as well"? How about :
> document.getElementById('txtPassword').value = "some text";
> Ben
>
Dana,
As Ben suggested you can use assword.Attributes.Add("value",
txtPassword.Text) to set the password .But instead of txtPassword.Text you
should retrieve password text using
txtPassword.Attributes["value"].ToString().
"dana lees" wrote:

> I have tried that and it didn't work. The field stayed empty...
> "Ben Amada" <ben@.REpoMOweVErpick.com> wrote in message
> news:OaFdNkA8FHA.3804@.TK2MSFTNGP12.phx.gbl...
> is
>
>
Check out:
http://groups.google.com/group/micr...de23fa30643fa4e
and
http://groups.google.com/group/micr...f9f3be06c4f0396
(watch for link brakage). Basically, you need to reset the value manually
via Password.Attributes.Add("value", Password.Text) or something
karl
MY ASP.Net tutorials
http://www.openmymind.net/
http://openmymind.net/redirector.aspx?documentId=51 - Learn about AJAX!
"dana lees" <danal@.idc.ac.il> wrote in message
news:%23jWQj9$7FHA.4036@.TK2MSFTNGP11.phx.gbl...
> Hello,
> I am developing a C# asp.net application.
> I have a webform which contains 2 dropdowns and a textbox with
> type="password".
> On "SelectedIndexChanged" event of the first dropdown, there is a
> postback,
> in order to fill the second dropdown according to the value selected in
> the
> first dropdown.
> The problem is that the password field which has been filled up before is
> cleared after postback.
> I know this is for security, but is there a way to keep the password'
> Thank you
>

password fields

why is it that password fields:

<asp:TextBox Id="txtuserpassword1" TextMode="password" class="textbox" maxlength="20" Columns="15" Runat="Server" /><br
clear everytime validation kicks in or on page refreshes? Can this be stopped? Help!
Also, I can't auto-populate the password field uising a database value.

Help. Thanx.This is the default behavior. If password fields were to refresh, they would have to be stored in ViewState. Since ViewState is stored on the HTML rendered to the browser, the user can easily do a view source and have access to the password. This defeats the purpose of having the password masked.

There is no way to override this, unless you make a custom control, or some other work around.

hope this helps,
John

"Chris" wrote:

> why is it that password fields:
> <asp:TextBox Id="txtuserpassword1" TextMode="password" class="textbox" maxlength="20" Columns="15" Runat="Server" /><br>
> clear everytime validation kicks in or on page refreshes? Can this be stopped? Help!
> Also, I can't auto-populate the password field uising a database value.
> Help. Thanx.
ok, I can buy the "refresh" reason but what about setting to a value via a database call:

txtuserpassword1.Text = "" & memberdata("USER_PASSWORD")
txtuserpassword2.Text = "" & memberdata("USER_PASSWORD")

they won't populate, why?
thanx.

"John Sivilla" wrote:

> This is the default behavior. If password fields were to refresh, they would have to be stored in ViewState. Since ViewState is stored on the HTML rendered to the browser, the user can easily do a view source and have access to the password. This defeats the purpose of having the password masked.
> There is no way to override this, unless you make a custom control, or some other work around.
> hope this helps,
> John
> "Chris" wrote:
> > why is it that password fields:
> > <asp:TextBox Id="txtuserpassword1" TextMode="password" class="textbox" maxlength="20" Columns="15" Runat="Server" /><br>
> > clear everytime validation kicks in or on page refreshes? Can this be stopped? Help!
> > Also, I can't auto-populate the password field uising a database value.
> > Help. Thanx.
My guess is it's built into the design of the server control. It would
seem to be a security risk to allow prepopulating a password field.
Perhaps you could do a JavaScript kludge to work around it though if you
really had to.

Chris wrote:

>why is it that password fields:
><asp:TextBox Id="txtuserpassword1" TextMode="password" class="textbox" maxlength="20" Columns="15" Runat="Server" /><br>
>clear everytime validation kicks in or on page refreshes? Can this be stopped? Help!
>Also, I can't auto-populate the password field uising a database value.
>Help. Thanx.
asp.net clears password fields by default. to set the values in code behind
use the value attribute:

txtuserpassword1.Attributes.Add("value",myPassedValue);

-- bruce (sqlwork.com)

"Chris" <Chris@.discussions.microsoft.com> wrote in message
news:53BA7FBD-26A4-458A-BA32-0AB61190C1E6@.microsoft.com...
> why is it that password fields:
> <asp:TextBox Id="txtuserpassword1" TextMode="password" class="textbox"
maxlength="20" Columns="15" Runat="Server" /><br>
> clear everytime validation kicks in or on page refreshes? Can this be
stopped? Help!
> Also, I can't auto-populate the password field uising a database value.
> Help. Thanx.
This will work, but for security reasons, I would recommend not putting the
actual password value in there (as it can then become visible to the user if
they view source). Rather, I've often put in "********" as the value to
represent that something has been entered. The next time the user posts, if
that value matches, then I know they left it alone and the code responds
accordingly. Otherwise, they've made a change.

Ben Lucas
Lead Developer
Solien Technology, Inc.

"bruce barker" <nospam_brubar@.safeco.com> wrote in message
news:OOApwjbbEHA.368@.TK2MSFTNGP10.phx.gbl...
> asp.net clears password fields by default. to set the values in code
behind
> use the value attribute:
> txtuserpassword1.Attributes.Add("value",myPassedValue);
> -- bruce (sqlwork.com)
> "Chris" <Chris@.discussions.microsoft.com> wrote in message
> news:53BA7FBD-26A4-458A-BA32-0AB61190C1E6@.microsoft.com...
> > why is it that password fields:
> > <asp:TextBox Id="txtuserpassword1" TextMode="password" class="textbox"
> maxlength="20" Columns="15" Runat="Server" /><br>
> > clear everytime validation kicks in or on page refreshes? Can this be
> stopped? Help!
> > Also, I can't auto-populate the password field uising a database value.
> > Help. Thanx.

password fields

why is it that password fields:
<asp:TextBox Id="txtuserpassword1" TextMode="password" class="textbox" maxle
ngth="20" Columns="15" Runat="Server" /><br>
clear everytime validation kicks in or on page refreshes? Can this be stoppe
d? Help!
Also, I can't auto-populate the password field uising a database value.
Help. Thanx.This is the default behavior. If password fields were to refresh, they would
have to be stored in ViewState. Since ViewState is stored on the HTML rende
red to the browser, the user can easily do a view source and have access to
the password. This defeats
the purpose of having the password masked.
There is no way to override this, unless you make a custom control, or some
other work around.
hope this helps,
John
"Chris" wrote:

> why is it that password fields:
> <asp:TextBox Id="txtuserpassword1" TextMode="password" class="textbox" max
length="20" Columns="15" Runat="Server" /><br>
> clear everytime validation kicks in or on page refreshes? Can this be stop
ped? Help!
> Also, I can't auto-populate the password field uising a database value.
> Help. Thanx.
>
ok, I can buy the "refresh" reason but what about setting to a value via a d
atabase call:
txtuserpassword1.Text = "" & memberdata("USER_PASSWORD")
txtuserpassword2.Text = "" & memberdata("USER_PASSWORD")
they won't populate, why?
thanx.
"John Sivilla" wrote:

> This is the default behavior. If password fields were to refresh, they would have
to be stored in ViewState. Since ViewState is stored on the HTML rendered to the bro
wser, the user can easily do a view source and have access to the password. This def
eat
s the purpose of having the password masked.
> There is no way to override this, unless you make a custom control, or som
e other work around.
> hope this helps,
> John
> "Chris" wrote:
>
My guess is it's built into the design of the server control. It would
seem to be a security risk to allow prepopulating a password field.
Perhaps you could do a JavaScript kludge to work around it though if you
really had to.
Chris wrote:

>why is it that password fields:
><asp:TextBox Id="txtuserpassword1" TextMode="password" class="textbox" maxl
ength="20" Columns="15" Runat="Server" /><br>
>clear everytime validation kicks in or on page refreshes? Can this be stopp
ed? Help!
>Also, I can't auto-populate the password field uising a database value.
>Help. Thanx.
>
>
asp.net clears password fields by default. to set the values in code behind
use the value attribute:
txtuserpassword1.Attributes.Add("value",myPassedValue);
-- bruce (sqlwork.com)
"Chris" <Chris@.discussions.microsoft.com> wrote in message
news:53BA7FBD-26A4-458A-BA32-0AB61190C1E6@.microsoft.com...
> why is it that password fields:
> <asp:TextBox Id="txtuserpassword1" TextMode="password" class="textbox"
maxlength="20" Columns="15" Runat="Server" /><br>
> clear everytime validation kicks in or on page refreshes? Can this be
stopped? Help!
> Also, I can't auto-populate the password field uising a database value.
> Help. Thanx.
>
This will work, but for security reasons, I would recommend not putting the
actual password value in there (as it can then become visible to the user if
they view source). Rather, I've often put in "********" as the value to
represent that something has been entered. The next time the user posts, if
that value matches, then I know they left it alone and the code responds
accordingly. Otherwise, they've made a change.
Ben Lucas
Lead Developer
Solien Technology, Inc.
"bruce barker" <nospam_brubar@.safeco.com> wrote in message
news:OOApwjbbEHA.368@.TK2MSFTNGP10.phx.gbl...
> asp.net clears password fields by default. to set the values in code
behind
> use the value attribute:
> txtuserpassword1.Attributes.Add("value",myPassedValue);
> -- bruce (sqlwork.com)
> "Chris" <Chris@.discussions.microsoft.com> wrote in message
> news:53BA7FBD-26A4-458A-BA32-0AB61190C1E6@.microsoft.com...
> maxlength="20" Columns="15" Runat="Server" /><br>
> stopped? Help!
>
does the trick, thanx a lot!
"bruce barker" wrote:

> asp.net clears password fields by default. to set the values in code behin
d
> use the value attribute:
> txtuserpassword1.Attributes.Add("value",myPassedValue);
> -- bruce (sqlwork.com)
> "Chris" <Chris@.discussions.microsoft.com> wrote in message
> news:53BA7FBD-26A4-458A-BA32-0AB61190C1E6@.microsoft.com...
> maxlength="20" Columns="15" Runat="Server" /><br>
> stopped? Help!
>
>
good suggestions, I never thought of that!
"Ben Lucas" wrote:

> This will work, but for security reasons, I would recommend not putting th
e
> actual password value in there (as it can then become visible to the user
if
> they view source). Rather, I've often put in "********" as the value to
> represent that something has been entered. The next time the user posts,
if
> that value matches, then I know they left it alone and the code responds
> accordingly. Otherwise, they've made a change.
> Ben Lucas
> Lead Developer
> Solien Technology, Inc.
> "bruce barker" <nospam_brubar@.safeco.com> wrote in message
> news:OOApwjbbEHA.368@.TK2MSFTNGP10.phx.gbl...
> behind
>
>

Password goes blank. When I make round trip to server

I have a simple Data Entry form that User enters some information....One of these fields is a password field...Now i have a textBox and and the TextMode is set to Password...but I am unable to save the password to the database cause when i check a check box who's AutoPostBack is set to true the text in textbox with its text mode set to password just goes back to being blank when the page reloads....I dont understand why...I am using ASP.Net 1.1 VS 03 and Sql Backend......I just want to be able to save my Passwords to the DB so that the user will be able to log in and I can authenicate him..........

More then likely you are blanking it in the Page_Load()

Ensure you have a:
If Not IsPostBack() then
... clear password
End if


I thought that but when I change the text mode to Single line...it works just fine....

I've seen the same behavior. I believe this is a security feature. You can use the following approach to work around it.

PrivateSub Page_PreRender(ByVal senderAsObject,ByVal eAs System.EventArgs)HandlesMyBase.PreRender

Password.Attributes.Add(

"value", Password.Text)

ConfirmPassword.Attributes.Add(

"value", ConfirmPassword.Text)EndSub

password in TextBox is not appeared in a new asp page

Hi All,

I am typing a password into a textBox with type="password", and then
submitting it into other page where I not see it in the textBox with
type="password" .
A password value is stored in a Session or a local variable.

Session["pwd"] = PasValue.Text;
..
..
..
PasValue.Text = Session["pwd"].ToString(); - is not appeared

Why it is occured?

Thanks & Regards,
KuanThis is by design with ASP.NET you need to-do sommething like...

PasValue.Attributes("Value") = Session["pwd"].ToString();

Kindest Regards,

Ryan Healey

InstantASP Ltd - ASP.NET Collaboration & Support Tools
-------------------
sales@.instantasp.co.uk
http://www.instantasp.co.uk
-------------------

"Kuan" <temir51@.hotmail.com> wrote in message
news:O5IJWdOtDHA.2224@.TK2MSFTNGP09.phx.gbl...
> Hi All,
> I am typing a password into a textBox with type="password", and then
> submitting it into other page where I not see it in the textBox with
> type="password" .
> A password value is stored in a Session or a local variable.
> Session["pwd"] = PasValue.Text;
> .
> .
> .
> PasValue.Text = Session["pwd"].ToString(); - is not appeared
> Why it is occured?
> Thanks & Regards,
> Kuan
>
Opps sorry that should be ...

PasValue.Attributes["Value"] = Session["pwd"].ToString();

for c# ;)

--
Kindest Regards,

Ryan Healey

InstantASP Ltd - ASP.NET Collaboration & Support Tools
-------------------
sales@.instantasp.co.uk
http://www.instantasp.co.uk
-------------------

"support@.instantasp.co.uk" <service@.instantasp.co.uk> wrote in message
news:eUQDiiPtDHA.2508@.TK2MSFTNGP12.phx.gbl...
> This is by design with ASP.NET you need to-do sommething like...
> PasValue.Attributes("Value") = Session["pwd"].ToString();
> Kindest Regards,
> Ryan Healey
> InstantASP Ltd - ASP.NET Collaboration & Support Tools
> -------------------
> sales@.instantasp.co.uk
> http://www.instantasp.co.uk
> -------------------
> "Kuan" <temir51@.hotmail.com> wrote in message
> news:O5IJWdOtDHA.2224@.TK2MSFTNGP09.phx.gbl...
> > Hi All,
> > I am typing a password into a textBox with type="password", and then
> > submitting it into other page where I not see it in the textBox with
> > type="password" .
> > A password value is stored in a Session or a local variable.
> > Session["pwd"] = PasValue.Text;
> > .
> > .
> > .
> > PasValue.Text = Session["pwd"].ToString(); - is not appeared
> > Why it is occured?
> > Thanks & Regards,
> > Kuan
Thank you!
It is working properly!

Best regards
Kuan

"support@.instantasp.co.uk" <service@.instantasp.co.uk> wrote in message
news:O5723QRtDHA.2248@.TK2MSFTNGP09.phx.gbl...
> Opps sorry that should be ...
> PasValue.Attributes["Value"] = Session["pwd"].ToString();
> for c# ;)
>
> --
> Kindest Regards,
> Ryan Healey
> InstantASP Ltd - ASP.NET Collaboration & Support Tools
> -------------------
> sales@.instantasp.co.uk
> http://www.instantasp.co.uk
> -------------------
> "support@.instantasp.co.uk" <service@.instantasp.co.uk> wrote in message
> news:eUQDiiPtDHA.2508@.TK2MSFTNGP12.phx.gbl...
> > This is by design with ASP.NET you need to-do sommething like...
> > PasValue.Attributes("Value") = Session["pwd"].ToString();
> > Kindest Regards,
> > Ryan Healey
> > InstantASP Ltd - ASP.NET Collaboration & Support Tools
> > -------------------
> > sales@.instantasp.co.uk
> > http://www.instantasp.co.uk
> > -------------------
> > "Kuan" <temir51@.hotmail.com> wrote in message
> > news:O5IJWdOtDHA.2224@.TK2MSFTNGP09.phx.gbl...
> > > Hi All,
> > > > I am typing a password into a textBox with type="password", and then
> > > submitting it into other page where I not see it in the textBox with
> > > type="password" .
> > > A password value is stored in a Session or a local variable.
> > > > Session["pwd"] = PasValue.Text;
> > > .
> > > .
> > > .
> > > PasValue.Text = Session["pwd"].ToString(); - is not appeared
> > > > Why it is occured?
> > > > Thanks & Regards,
> > > Kuan
> > > >