Note that there are some explanatory texts on larger screens.

plurals
  1. POUser Input and Server / User Controls
    primarykey
    data
    text
    <p>When creating an application page or web part, I will occasionally find that I have the same few drop down lists and labels in a pattern at multiple places around my page.</p> <pre><code>Application Page _____________________ | lbl ddl lbl dll | | lbl ddl lbl ddl | | | | lbl ddl lbl dll | | lbl ddl lbl ddl | ----------------------- </code></pre> <p>Originally, I would take one instance of these say, 2 labels and 2 drop down controls, and I would mock it out in an ascx file, call it a user control (complete with code behind), and then paste it into my main application page in multiple locations.</p> <pre><code>Application Page _____________________ | user user | User Control | control control | ___________ | | | lbl ddl | | user user | | lbl ddl | | control control | ----------- ----------------------- </code></pre> <p><strong>THE QUESTION</strong> Recently, I was told that if the number of drop down lists or labels or etc that are being displayed in each user control is dynamic, then instead of a user control, I should use a server control.</p> <p>But I can't seem to make that work! In server controls, there seems to be no html mockup, so you only have code behind to use. I can't figure out how to store user input, or move user input to the code behind from the generated code.</p> <p><strong>So does that mean server controls only for creating individual controls, like MySpecialTextBox? Or am I going about this entirely wrong?</strong> (Does anyone have a good, complicated sample project I can view?)</p>
    singulars
    1. This table or related slice is empty.
    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. 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