I have several user controls that contain a drop down list, various validation controls, and a SQL Data Source control. I want to know if its possible to make the Data Source control invisible at design time.
When i use these controls to build various forms the datasource controls show up in the design view and take up space and its kind of annoying.
<asp:DropDownList ID="ddlAccounts" runat="server" DataSourceID="dsAccounts"
DataTextField="name" DataValueField="accountId"
AppendDataBoundItems="True">
<asp:ListItem Value="NOT SET">- Select an account -</asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="rfvAccounts" runat="server"
ControlToValidate="ddlAccounts" CssClass="ValidationError" Display="Dynamic"
ErrorMessage="!" InitialValue="NOT SET" ToolTip="You must select an account."></asp:RequiredFieldValidator>
<asp:SqlDataSource ID="dsAccounts" runat="server"
ConnectionString="<%$ ConnectionStrings:MySqlConnectionString %>"
ProviderName="MySql.Data.MySqlClient"
SelectCommandType="StoredProcedure"
SelectCommand="AccountSelector_Select">
</asp:SqlDataSource>
well, you can add it programmatically through code behind and then you won’t see it in the designer.