<form> in master page, setting default button and 1st control

G

Guest

Hi;

I have my <form> in the master page because the master page includes the
menu for all pages. But I would like to set the default button and control to
place the caret in for each page. Is there a way to do this? (My
understanding is this has to be done in the form tag.)
 
Y

Yuan Ren[MSFT]

Hi Dave,

Thanks for posting!

After performing a test, I think the current issue is not easy to
implement. The default button can not be set on the master page when the
button is a portion of the content page. The InvalidOperationException will
be thrown at compilation time if we perform this. Please submit your
feedback by accessing the link below for the current issue:
http://lab.msdn.microsoft.com/ProductFeedback/

Your idea will be appreciated!

Thanks for your understanding.

Regards,

Yuan Ren [MSFT]
Microsoft Online Support
 
Y

Yuan Ren[MSFT]

Hi,

Your idea is appreciated! I forget we can use the default button in the
Panel control. Thanks for reminder!

Regards,

Yuan Ren [MSFT]
Microsoft Online Support
 
G

Guest

Or some simpler code for Page_Load (just tried this from your idea):

Page.Form.DefaultButton = btnSave.UniqueID;

Still doesn't solve the set caret to a specific control though...
 
Y

Yuan Ren[MSFT]

Hi Dave,

Thanks for your reply!

Could you please tell me which specific control is used? If the control is
a naming control, I suggest you use the findcontrol method to get the
reference of it.

Regards,

Yuan Ren [MSFT]
Microsoft Online Support
 
Y

Yuan Ren[MSFT]

Hi Dave,

Thanks for your reply!

Please use the findcontrol method to instead of uniqueID and try again to
figure out whether the problem still occurs.

Regards,

Yuan Ren [MSFT]
Microsoft Online Support
 
G

Guest

Hi;

Page.Form.DefaultButton = btnSave.UniqueID;

works fine to set the default button. Why should I use find control instead?
 
Y

Yuan Ren[MSFT]

Hi Dave,

Sorry for misunderstanding!

I'm confused about "Still doesn't solve the set caret to a specific control
though..." which you mentioned before. Could you please give me more detail
explanation? Thanks.

Regards,

Yuan Ren [MSFT]
Microsoft Online Support
 
G

Guest

Hi;

No problem. The caret is the blinking vertical bar that shows where text you
type will be inserted. When a web page comes up, it is generally in the first
TextBox on the page.

I would like it to be in the 3rd TextBox on one page I have. How do I set it
there? If the <form ...> tag was not in the master page I could do <form
defaultfocus="textBoxID' ...>. But with the <form...> in the master page,
that is not an option.
 
Y

Yuan Ren[MSFT]

Hi Dave,

Thanks for posting!

I understand the issue. I have performed the test. Unfortunately, I think
the current issue is a product limitation. Your scenario is different with
other communicators'. The lifecycle of master page is earlier than the
content, so that we can not set the property dynamically. If we do this,
the reference can not be found at rendering time. And we will encounter the
error. However, I think the current idea is very useful and appreciated.
Please don't hesitate to submit your feedback to Microsoft. Thanks!

Regards,

Yuan Ren [MSFT]
Microsoft Online Support
 

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,780
Messages
2,569,611
Members
45,280
Latest member
BGBBrock56

Latest Threads

Top