.Net Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - More.Net Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 30th, 2003, 05:14 AM
Anneke Anneke is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Belgium
Posts: 3 Anneke User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
set focus to webcontrol on usercontrol in ASP.NET

I'm developing an webapplication with ASP.NET.

On the login page I would like to set the focus on the username textbox.

I have tried to use the javascript code like document.formname.textboxname.focus();.
This works when the textbox stands on the page.

But my textbox stands on a user control that stands on the page. When I try the code document.formname.usercontrolname.textboxname.focus();, it does not work. I don't get an error on the page.

Can somebody tell me what I do wrong or give an other solution?

Thank you

Anneke

Reply With Quote
  #2  
Old November 26th, 2003, 12:52 PM
DERDOUR DERDOUR is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 1 DERDOUR User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Lightbulb textbox focus

.NET generate an ID like UserControlName_TextBoxName
try:
document.formname.usercontrolname_textboxname.focus()

Reply With Quote
  #3  
Old December 12th, 2003, 05:36 AM
Anneke Anneke is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Belgium
Posts: 3 Anneke User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thumbs up textbox focus

Your suggestion works.

Thank you for your help.

Anneke

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - More.Net Development > set focus to webcontrol on usercontrol in ASP.NET


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT