Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Does it need to be an ASP .NET control or could it just be normal HTML?</p> <p>If you want an ASP .NET control these, by design, are rendered on the server so there would either need to add the controls by using one of the following approaches:</p> <p>1) Synchronous PostBack (normal postback) 2) Async PostBack (javascript postback which doesn't refresh the page visually but still does a postback) 3) Traditional AJAX</p> <p>You've probably already tried the Sync PostBack since you're mentioning that you want to do this in Javascript. So that leaves Async PostBack or traditional AJAX.</p> <p>The Async PostBack is the easiest because you just need to wrap everything in an <code>UpdatePanel</code></p> <pre><code>&lt;asp:UpdatePanel id="Updater" runat="server"&gt; &lt;asp:PlaceHolder id="AddControlsToThis" runat="server" /&gt; &lt;asp:Button id="Submit" runat="server" /&gt; &lt;/asp:UpdatePanel&gt; </code></pre> <p>Treat this like a normal postback and in the codebehind add whatever control you want to the placeholder on button click.</p> <p>The third approach (adding via AJAX) is a little too much to describe here but basically you would use AJAX to make a request to a web service that you would set up on the server and then you would need to "render" the control on the server (each control has a RenderControl function...you would need to use this to get the resulting HTML) and use the resulting HTML to send back as a response of the web server...sorry if that's a little vague. Like I said the traditional AJAX approach requires more description than I can get into here.</p> <p>Good luck.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload