Asp Control
ASP.Net
-
Home
-
ASP.Net
-
Asp Control
- Using the ListBox to select list items
<%@ Page Language="C#" %>
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
id="lstFavoriteProducts"
Runat="server" />
id="btnSubmit"
Text="Submit Form"
Runat="server" OnClick="btnSubmit_Click" />
id="lblResults"
EnableViewState="false"
Runat="server" />
id="srcProducts"
SelectCommand="SELECT Id, Title FROM Products"
ConnectionString="<%$ ConnectionStrings:Products %>"
Runat="server" />
File: Web.config
connectionString="Data Source=.\SQLEXPRESS;
AttachDbFilename=|DataDirectory|MyDatabase.mdf;Integrated Security=True;User Instance=True" />