too many Questions.. How to Access a Field in the USER control

Discussion in 'ASP .Net' started by RSB, May 13, 2004.

  1. RSB

    RSB Guest

    Hi all,

    Sorry for asking to many questions..

    one more problem.

    i have a Form and in that form i am adding a user control "myUserControl"
    which has two text boxes. textbox1 and textbox2.

    Now if i am executing a Javascript function right inside the user control ..
    say again a validation function then how do i refer to these textboxes
    inside the Usercontrol.

    as so far i been using this.. window.document.myform.text.value... etc etc.

    but now in that user control how do i refer the textbox.


    Also if i am executing the javascript Function in the Main Page then how do
    i access these fields. As ASP.NEt change the name and Id of the Child
    fields. as once my page is painted and if i look at the source the ID and
    Name for these Text boxes is some what like this. myForm1_TextBox1 or
    myForm:textBOx1.


    please help...

    Thanks
    RSB.
    RSB, May 13, 2004
    #1
    1. Advertising

  2. Hi
    I am not sure if you are looking for something specific but the control inside a user control can be accessed by using
    window.document.forms[0].UserControl1_txtUser.value where UserControl1 is the id of the user control and txtUser is id of a textbox inside the user control
    regard
    srin
    =?Utf-8?B?c3Jpbmk=?=, May 14, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Phil Winstanley [Microsoft MVP]

    Re: too many Questions.. How to Access a Field in the USER control

    Phil Winstanley [Microsoft MVP], May 13, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    369
  2. RSB
    Replies:
    0
    Views:
    406
  3. peelman

    How many threads is too many?

    peelman, Jan 13, 2005, in forum: Java
    Replies:
    12
    Views:
    818
    Esmond Pitt
    Jan 15, 2005
  4. Rhino
    Replies:
    33
    Views:
    1,281
    Oliver Wong
    Dec 22, 2005
  5. Dag Sunde
    Replies:
    4
    Views:
    345
Loading...

Share This Page