By the way,the submit button is rendered in the custom control's Render method.
"han zhiyang" wrote:
> Thank you very much for your Response.
> I read the version1.1 SDK,and tried to use a submit button named with the
> UniqueID of my custom control.i had thought the control on server side and
> the html tags rendered by it are two different entity,so the asp.net runtime
> may find the UniqueID in submited contents and also can find the custom
> control with the same UniqueID in the requested page.because the latter has
> inherited those two interfaces,so the expected methods could work. but i
> failed and don't know why. I've implemented the LoadPostData and
> RaisePostBackEvent method according to the instructions in Nikhil's book.It
> is really not so difficult to use and works pretty well,although still it
> seems not so elegant.
> say thank you again.
> "Teemu Keiski" wrote:
>
> > And by the way, in ASP.NET v2 their use is not so crucial as Framework is
> > smarter in calling both event implementations. That's just based on my
> > tests.
> >
> > Teemu
> >
> > "Teemu Keiski" <joteke@aspalliance.com> wrote in message
> > news:uAmSNTOwFHA.3756@tk2msftngp13.phx.gbl...
> > > Well,
> > >
> > > how would you do it better? Please share as that would ne crucial
> > > information for MS to make the ASP.NET even better.
> > >
> > > Personally, I find those methods useful and not so hard to use, especially
> > > thanks to Nikhil's book, but sure everything can always be implemented
> > > better.
> > >
> > > That line of code is because implementing IPostBackDataHandler goes over
> > > IPostBackEventhandler when control's implementation is checked (postback
> > > data checked and determined what interface implementation to call) so when
> > > control implements both interfaces, IPostBackEventHandler implementation
> > > must be manually called since framework deals then only with
> > > IPostBackDataHandler
> > >
> > > --
> > > Teemu Keiski
> > > ASP.NET MVP, AspInsider
> > > Finland, EU
> > >
http://blogs.aspadvice.com/joteke > > >
> > > "han zhiyang" <hanzhiyang@discussions.microsoft.com> wrote in message
> > > news:130DCCD0-01C6-475E-97E3-485DA6A2FDF3@microsoft.com...
> > >>I wonder if the Page.RegisterRequiresRaiseEvent and Page.RequiresPostBack
> > >>are
> > >> asp.net bugs,for they are somewhat "ugly" and difficult to use.At the
> > >> same
> > >> time, I wonder if there is other alternatives I can choose.I've read the
> > >> book
> > >> "Developing Microsoft ASP.NET Server Controls and Components" by Nikhil
> > >> Kothari, and here is some codes in LoadPostData method in code list
> > >> 9-11:
> > >>
> > >> bool buttonClicked = (buttonValue != null) && (buttonValue.Length != 0);
> > >> if (buttonClicked) Page.RegisterRequiresRaiseEvent(this);
> > >>
> > >> Reading these codes,I feel I go back to the asp times again. these are
> > >> somewhat ugly.
> > >>
> > >
> > >
> >
> >