Velocity Reviews

Velocity Reviews (
-   ASP .Net Web Controls (
-   -   Generate Server Controls at Runtime (

Jeffrey Jones 12-15-2005 05:58 PM

Generate Server Controls at Runtime
Hello All,

I am trying to develop a web app that will allow a user to upload files
to a folder. I have an xml file that allows a person to add or delete a
file. Basic format follows.

I also have an XSLT file that transforms the XML into HTML Controls.
Format follows.
<xsl:template match="/">
<table cellSpacing="0" cellPadding="4" rules="groups">
<xsl:for-each select="//file">
<asp:panel id="pnl{endname}" runat="server">
<td><b><xsl:value-of select="label" /></b></td>
<td><input type="file" id="browse{endname}" runat="server" /></td>
<td><asp:button id="submit{endname}" runat="server" text="Submit" /></td>
<td><asp:hyperlink id="display{endname}" runat="server">Current File: NO

So far I can create the controls at runtime and can even add a
javascript onclick event to the submit button. What I can't seem to do
is add a Server side event to the submit button. Has anyone run into
this problem? Should I just read the XML file into an XML doc and add
the controls to the page at runtime instead of using XSLT? If I choose
this method, how do I add the logic to the buttons to handle the click

Thanks for your advice.

Jeff Jones

All times are GMT. The time now is 04:46 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.