btnNext always gets focus

D

DalePres

I suppose it might really be an IE problem but since I'm developing in C#
and .Net, I'm asking here.

I have an app with a couple pages that each have a button Web Server control
named btnNext. To see the button, the user has to scroll down once from the
top of the screen...or should have to. Adjacent on the page to the btnNext
button is another identical button: btnCancel.

The problem I was having is that whenever the page loaded, it automatically
scrolled down to show the btnNext button. If I disabled or deleted the
button, the page would show the top of the page on load, as desired, rather
than scrolling down. I even tried deleting btnNext and making a new one by
copying btnCancel. Same problem. btnCancel alone didn't cause the scroll.
btnNext still caused the scroll but only after I changed the name from the
default of Button1 to btnNext. What is weird that if I rename btnNext to
anything except btnNext, the problem goes away. It is the name and the
name alone that is causing the problem.

Has anyone else run across this?

Dale
 
D

DalePres

Thanks for the reply but I understand how to set the focus. What I am
trying to understand is why I need to in this case. And why just the name
of the control will make IE set the focus to it. Weird stuff.

Dale
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top