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. 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. =?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,781
    Ton Strankinga
    Feb 10, 2006
  2. Replies:
    2
    Views:
    414
  3. archana

    Focus to textbox in user control.

    archana, Aug 18, 2009, in forum: ASP .Net
    Replies:
    0
    Views:
    354
    archana
    Aug 18, 2009
  4. Replies:
    2
    Views:
    341
    Thomas 'PointedEars' Lahn
    Jun 6, 2005
  5. Roger
    Replies:
    3
    Views:
    329
Loading...

Share This Page