Showing posts with label typing. Show all posts
Showing posts with label typing. Show all posts

Monday, March 26, 2012

Passing Values To A User Control

I have seen examples where you can set values in a user control by typing in
the value like te following:
<uc1:MyUserCtrl id="myUserCtrl" ScreenName="User Entry" runat="server" />
So in the case I am populating a variable called "ScreenName" with "User Ent
ry".
Can I not create properties in the main codebehind form and make these prope
rties availble to the usercontrol? I know you can create properties in the
control and make those availble to the main page, but how can you go the oth
er way?
Thanks!"Issac Gomez" <anonymous@.discussions.microsoft.com> wrote in message
news:D7323912-CD68-461C-8DB0-CDC414DD4E8E@.microsoft.com...
> I have seen examples where you can set values in a user control by typing
in the value like te following:
> <uc1:MyUserCtrl id="myUserCtrl" ScreenName="User Entry" runat="server" />
> So in the case I am populating a variable called "ScreenName" with "User
Entry".
> Can I not create properties in the main codebehind form and make these
properties availble to the usercontrol? I know you can create properties in
the control and make those availble to the main page, but how can you go the
other way?
That's the reverse of what you should do. The Page should be in charge, not
the user control. If you want to pass something from the page to the user
control, then have the page set a property of the user control.
--
John Saunders
johnwsaundersiii at hotmail
sure ya can
Make sure to set a public property in the control
From there you should be able to
1) declare the control in the codebehind
2) populate it
myUserCtrl.ScreenName = "User Entry"
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Issac Gomez" <anonymous@.discussions.microsoft.com> wrote in message
news:D7323912-CD68-461C-8DB0-CDC414DD4E8E@.microsoft.com...
> I have seen examples where you can set values in a user control by typing
in the value like te following:
> <uc1:MyUserCtrl id="myUserCtrl" ScreenName="User Entry" runat="server" />
> So in the case I am populating a variable called "ScreenName" with "User
Entry".
> Can I not create properties in the main codebehind form and make these
properties availble to the usercontrol? I know you can create properties in
the control and make those availble to the main page, but how can you go the
other way?
> Thanks!
You can access public property of the main page in usercontrol like this,
DirectCast(Page, <mainpage> ).<publicproperty>
Saravana
Microsoft MVP - ASP.NET
www.extremeexperts.com
"Issac Gomez" <anonymous@.discussions.microsoft.com> wrote in message
news:D7323912-CD68-461C-8DB0-CDC414DD4E8E@.microsoft.com...
> I have seen examples where you can set values in a user control by typing
in the value like te following:
> <uc1:MyUserCtrl id="myUserCtrl" ScreenName="User Entry" runat="server" />
> So in the case I am populating a variable called "ScreenName" with "User
Entry".
> Can I not create properties in the main codebehind form and make these
properties availble to the usercontrol? I know you can create properties in
the control and make those availble to the main page, but how can you go the
other way?
> Thanks!

Friday, March 16, 2012

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