Settng Focus on textbox using User Control

Discussion in 'ASP .Net Web Controls' started by Huzaifa, Sep 2, 2003.

  1. Huzaifa

    Huzaifa Guest

    hi

    I have User control with some Text Boxes

    i want to set the focus on the text box depending on the page where i am
    using the User control

    I tried couple of things in the ASPX Page and User Control but no luck


    Thanks
    Huzaifa

    document.forms(0).txtABC.focus();



    StringBuilder sb=new StringBuilder();

    sb.Append("<script>");

    sb.Append("document.forms(0).txtABC.focus();");

    sb.Append("</script>");

    ImageButton1.ImageUrl=sImageURL;

    if (!(IsStartupScriptRegistered("HighTher")))

    RegisterStartupScript("HighTher", sb.ToString()) ;
     
    Huzaifa, Sep 2, 2003
    #1
    1. Advertisements

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. =?Utf-8?B?U3JpZGhhcg==?=

    setting the focus to a textbox in a user control

    =?Utf-8?B?U3JpZGhhcg==?=, Feb 10, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    2,898
    Ton Strankinga
    Feb 10, 2006
  2. Mad Scientist Jr
    Replies:
    0
    Views:
    906
    Mad Scientist Jr
    Mar 22, 2006
  3. Replies:
    2
    Views:
    490
  4. archana

    Focus to textbox in user control.

    archana, Aug 18, 2009, in forum: ASP .Net
    Replies:
    0
    Views:
    432
    archana
    Aug 18, 2009
  5. Jonathan Wood

    User Control to Control Other User Control

    Jonathan Wood, Jan 24, 2010, in forum: ASP .Net
    Replies:
    4
    Views:
    813
    Jonathan Wood
    Feb 2, 2010
  6. Jesper Dannemamm

    HELP: setting focus asp:textbox in a user control

    Jesper Dannemamm, Dec 6, 2003, in forum: ASP General
    Replies:
    3
    Views:
    351
    Aaron Bertrand [MVP]
    Dec 6, 2003
  7. Replies:
    2
    Views:
    545
    Thomas 'PointedEars' Lahn
    Jun 6, 2005
  8. Roger
    Replies:
    3
    Views:
    620
Loading...