473,406 Members | 2,710 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

finding the form that owns the usercontrol

i have various usercontrols that get dynamically into a page
my usercontrol has html Input fields,
and from javascript i need to access them, however to access them i
need to know the form..
currently the code i use to generate the javascript i do for example

....
document.forms[0]." + GRIDENTER.ClientID + @".value= 'YES';
....
(gridenter is a htmlinputtext )

which works, however what if there is more than one form in the host
page
surely there is a way i can get the clientID of the controls host
form.

Karl
Nov 18 '05 #1
1 1084
I think I understand what you are asking, and you might be looking to
do more work than you need. ASP.NET generates the ClientID so it is
always unique.

If you are worrying about multiple forms appearing on an aspx page, be
aware that aspx pages allow only one server side form tag, so this
should not present a problem either.

This article goes into some more detail on both subjects:
Form-based Programming in ASP.NET
http://msdn.microsoft.com/msdnmag/is...e/default.aspx

HTH,
--
Scott
http://www.OdeToCode.com

On 21 Jan 2004 23:30:05 -0800, kl****@xtra.co.nz (Karl Prosser) wrote:
i have various usercontrols that get dynamically into a page
my usercontrol has html Input fields,
and from javascript i need to access them, however to access them i
need to know the form..
currently the code i use to generate the javascript i do for example

...
document.forms[0]." + GRIDENTER.ClientID + @".value= 'YES';
...
(gridenter is a htmlinputtext )

which works, however what if there is more than one form in the host
page
surely there is a way i can get the clientID of the controls host
form.

Karl


Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Todd Schinell | last post by:
Back in July, Jeffery Tan posted this: http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=OWOTdf0VDHA.2296%40cpmsftngxa06.phx.gbl In response as to how to get click events from a...
4
by: athlonman | last post by:
Hi all!! II'm trying to set the Text of a TextBox in "Form1" when I click a Button in a UserControl. My code is: : public class Form1 : System.Windows.Forms.Form { public...
6
by: Peter Wone | last post by:
Hosting the WebBrowser control is easy. Customising it is not. You have to implement IDocHostShowUI, IDocHostUIHandler, IDocHostUIHandler2, and IOleClientSite, not one of which appears in a typelib...
5
by: EqDev | last post by:
I have a class that is a control derived from UserControl. I want to use serialization and deserialization with this calss but I get an exception "Cannot serialize member...
2
by: Alex Maghen | last post by:
I want to create a utility function that will seach the current page for one of my UserControls by it's type. So, let's say that I have a UserControl whose class I defined as follows: namespace...
0
by: hmm | last post by:
Hi all I have two problems: Problem #1: I'm using a .NET Form with the property 'FormBorderStyle' set to 'None'. The idea is to completely cover the area of that Form with a UserControl. In...
8
by: Brad Pears | last post by:
I am working on a contract generation application for our log home business. I have a main form that has many controls on it including tabbed controls, panes etc... When the user decides they...
13
by: Screaming Eagles 101 | last post by:
Hi, I have a solution containing two projects - main project with main form containing a statusstrip - second project containing a usercontrol. I have added the usercontrol to my main form,...
0
by: luckilian | last post by:
Hi everyone, i need some help with a tabbed interface. I have this scenario: 1 Main Form 1 UserControl 1 Form when main form is loaded the Usercontrol load .. In the _load handler i...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.