DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2007
    Posts
    3

    User Control Focus Problem.....Plz. help

    I have a user control on my asp.net page . This user control has 4 buttons on click of these buttons a new page opens below these user controls. Now after the page is opened and i click anwhere on the page the focus goes to 1st button in user control irrespective of the button i click. Hence when my user hits enter every time the first page opens. I have checked the code and there is no focus set for this in my code. I dont understand why it is happening. I wnt that when the user select a button the focus remains on it even if i click on the page.could some body help me..... I require it.............

  2. #2
    Join Date
    Jun 2004
    Location
    Pakistan
    Posts
    292
    This is more of HTML problem then .NET. It is probably your TabIndex. You just need to figure out a way to set the tab index: either by using the form or URL variables to keep track of which button was clicked and then set that one's tab index as 1. I could be wrong though but it seems like it's just that issue.
    new to programming but getting ther

  3. #3
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    How are you opening the new page below the buttons? Are you using a JavaScript window.open? If so, you can add a line of JavaScript to set the focus to the button that was clicked. Or, rather than opening another browser window, you can use a <div> that appears to float over the main page; since the page never loses focus, the browser should not set the focus to a different button.

    The bottom line is that focus is a client-side issue; you'll have to manage it with JavaScript in the browser. Kashif is correct that it really has nothing to do with .NET.
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

Similar Threads

  1. Dynamic User Control Problem
    By webchetan in forum ASP.NET
    Replies: 1
    Last Post: 11-16-2005, 05:01 AM
  2. Replies: 0
    Last Post: 03-21-2003, 04:00 PM
  3. User control ****
    By Jeff Pipes in forum .NET
    Replies: 2
    Last Post: 04-15-2002, 11:26 PM
  4. problem in setting focus on link
    By Mishra in forum Web
    Replies: 0
    Last Post: 01-03-2002, 01:41 AM
  5. pass a form to a web user control (pagelet)
    By Annie Wang in forum ASP.NET
    Replies: 0
    Last Post: 05-24-2001, 04:07 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links