set focus

N

nil

hi..suppose there is only one textbox in the form and one command
button...
can anyone tell me how can i setfocus of textbox when page is load?
should i do that by java script?please send me coding how to do that?


and can anyone tell me how can i send mail to the group of user?and how
can i add user in the vb.net?
i am developing one web application for one designing institute and
they want mailing facility so if i send one mail then all the member of
institute get that mail and for that i am supposed to create one group
for that....and any member can leave any time and one can be a member
of the institute so no of user are not fixed so tell me how can i do?i
did coding for sending one mail to the single user but i don't know how
to do for the group?should i take one array?please send me the code
snippet and it's better if it's in visual basic and not asp..thanks a
lot in advance



Nil
 
E

Eliyahu Goldin

If you are in 2.0, use method SetFocus.

In 1.1 you need to do it in with javascript in the body's onload event.

And it is always a good idea to post different questions in separate
threads.
 
G

Guest

Sorry Eliyahu, I meant to say that in 2.0 he could also use control.focus().
Didn't mean to repeat you...

--
Nick Wegner



Nick Wegner said:
Nil,

Eliyahu is right on. Here's what the javascript would look like if you are
using the 1.1 framework:

<script type='text/javascript'>
textbox = document.getElementById('[Replacewithnameofcontrol]');
if (textbox)
{
textbox.focus();
}
else
{
// The textbox doesn't exist you have an error
}
</script>

If you are using the 2.0 framework you can do what Eliyahu mentioned or you
could do it this way:

Page.SetFocus(control);

Note: You must call this on or before the PreRender event.

--
Nick Wegner



Eliyahu Goldin said:
If you are in 2.0, use method SetFocus.

In 1.1 you need to do it in with javascript in the body's onload event.

And it is always a good idea to post different questions in separate
threads.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]


nil said:
hi..suppose there is only one textbox in the form and one command
button...
can anyone tell me how can i setfocus of textbox when page is load?
should i do that by java script?please send me coding how to do that?


and can anyone tell me how can i send mail to the group of user?and how
can i add user in the vb.net?
i am developing one web application for one designing institute and
they want mailing facility so if i send one mail then all the member of
institute get that mail and for that i am supposed to create one group
for that....and any member can leave any time and one can be a member
of the institute so no of user are not fixed so tell me how can i do?i
did coding for sending one mail to the single user but i don't know how
to do for the group?should i take one array?please send me the code
snippet and it's better if it's in visual basic and not asp..thanks a
lot in advance



Nil
 

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

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top