.NETGURU
How to use the html hidden control?
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngreuse' list.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.

li
Hi all:
I want to keep value in hidden field and access it when I click button. I want to use hidden field in my user control ?

Any idea ?

Thanks
Reply to this message...
 
    
Trevor Pinkney
use javascript. have some function that goes

document.all["YourHiddenFieldClientID"].value = whatever

At 10:54 PM 7/20/2002 -0600, you wrote:
[Original message clipped]

Reply to this message...
 
    
Tony Stark
Ok guys, I believe this thread is now being discussed on aspngfreeforall =
(www.aspfriends.com/aspfriends/aspfreeforall.asp). Let's move it there, =
as this list is more oriented towards user controls and the like.

Thanks everyone,
Tony Stark
ASPFriends Moderation Team

----- Original Message -----
From: Trevor Pinkney <Click here to reveal e-mail address>
To: Click here to reveal e-mail address
Sent: Sun, 21 Jul 2002 12:20:00 -0500
Subject: Re: [aspngreuse] How to use the html hidden control?
[Original message clipped]

Reply to this message...
 
    
li
It don't work
I build one custom control(name:mycontrol)
then I add child control.One of them is hidden field in the
creatchildControl() method.
When I view source, the child control
id is like mycontrol:crtl_0 so I can't use
the document.form1.controlName to access it
because It is not on the web application.It is inside one custom control

So who can help me to find how I can access
child control in my custom control ?

Thanks for any help
----- Original Message -----
From: "Trevor Pinkney" <Click here to reveal e-mail address>
To: "aspngreuse" <Click here to reveal e-mail address>
Sent: Sunday, July 21, 2002 11:20 AM
Subject: [aspngreuse] Re: How to use the html hidden control?

[Original message clipped]

-------------------------------------------
Introducing NetZero Long Distance
Unlimited Long Distance only $29.95/ month!
Sign Up Today! www.netzerolongdistance.com

Reply to this message...
 
    
Brian Bilbro (VIP)
I use this method to retrieve the client-side "name" of a control:

public static String GetNameFromID(String strClientID)

{

String strReturn = "";

strReturn = strClientID.Substring(1).Replace("_",":").Replace("::",":_");

strReturn = strClientID.Substring(0,1) + strReturn;

return strReturn;

}

It's not perfect (it doesn't work if your control name itself has an
underscore....so don't do that :). You can only call this method "after"
the control has been added to it's parent Controls collection. For example,

Label myLabel = new Label();
this.Controls.add(myLabel)

string clientName = GetNameFromID(myLabel.ClientID);

or here's another example:
HtmlInputHidden myHiddenInput = new HtmlInputHidden();

this.Controls.Add(myHiddenInput);

string clientName = GetNameFromIdD(myHiddenInput.ClientID);

or don't forget about Page.RegisterHiddenField:
HtmlInputHidden myHiddenInput = new HtmlInputHidden();

this.Page.RegisterHiddenField("myclientName",myHiddenInput);

HTHs
Brian

----- Original Message -----
From: "li" <Click here to reveal e-mail address>
To: "aspngreuse" <Click here to reveal e-mail address>
Sent: Monday, July 22, 2002 12:26 AM
Subject: [aspngreuse] Re: How to use the html hidden control?

[Original message clipped]

Reply to this message...
 
 
System.Reflection.Emit.Label
System.Web.UI.HtmlControls.HtmlInputHidden
System.Web.UI.MobileControls.Label
System.Web.UI.Page
System.Web.UI.WebControls.Label
System.Windows.Forms.Label




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification