[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.buildingcontrols

Set Page properties in custom control

NKaufman

7/22/2008 9:53:00 PM

I have a custom control that creates some labels, textboxes and
buttons. In the PreRender() I am trying to set up something similar
to
the following;

form.defaultbutton = Button1
form.defaultfocus = TextBox1


It does not work. Any pointers would be appreciated.


Thanks


1 Answer

Peter Bucher [MVP]

8/20/2008 10:28:00 AM

0

Hi NKaufman

>I have a custom control that creates some labels, textboxes and
> buttons. In the PreRender() I am trying to set up something similar
> to
> the following;
>
> form.defaultbutton = Button1
> form.defaultfocus = TextBox1
>
>
> It does not work. Any pointers would be appreciated.
Use the PreRender Event in the CustomControl.

protected overrides OnPreRender(object sender, EventArgs e) {
this.Page.Form.<XXXX> = <XX>;
}

--
Gruss, Peter Bucher
Microsoft MVP - Visual Developer ASP / ASP.NET, Switzerland
http://www.aspn... - ASP.NET Zone, die ASP.NET Community
http://www.aspn...blogs/peterbucher/ - Auf den Spuren von .NET