Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Building Controls / October 2003

Tip: Looking for answers? Try searching our database.

ParseControl

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Matt Crego - 30 Sep 2003 23:22 GMT
What approaches has anyone found that would allow for
parsing of serverside events when using the
Page.ParseControl method?  I currently have the following
snippet in an xsl file:

Login:<br/>
<asp:TextBox ID="userid" Runat="server" /><br/>
<asp:LinkButton ID="login" Runat="server"
OnServerClick="Login_Click" />

When I use the ParseControl method to parse it and add
this to the Page Controls Collection, it works fine, with
the exception of not including the OnServerClick as the
handler for this click event.  It is sent to the client.

I have read an article which uses server-side code to look
for specific controls and manually add the event handlers
to each control.  I do not know up front what the controls
are called, and which events would fire which handlers, so
this is not really possible to do in the code.  Is there a
better or different way to do this?
Andy Smith - 01 Oct 2003 19:42 GMT
After the control is parsed, you would presumably have
access to the Attributes collection. From there, you could
cycle thru them, and pick out the ones that start
with "on". Then you could use reflection to see if that
control type has an event named the same. if it does, then
use a bit more reflection to look for the appropriate
method to connect with.

__
Andy Smith

>-----Original Message-----
>What approaches has anyone found that would allow for
[quoted text clipped - 19 lines]
>better or different way to do this?
>.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.