Решено: я использовал обработчики. Спасибо, кстати.
http://www.aspdotnetcodes.com/Insert_Images_Database.aspx
Как я могу отобразить свое изображение внутри DataList1?
У меня нет четкого представления о привязке данных и тому подобном. Я надеюсь, что вы, ребята, можете помочь. Спасибо
Это мой код для моего ASPX
<asp:DataList ID="DataList1" runat="server" DataSourceID="SqlDataSource1">
<ItemTemplate>
itemID:
<asp:Label ID="itemIDLabel" runat="server" Text='<%# Eval("itemID") %>' />
<br />
Cloth ID:
<asp:Label ID="Cloth_IDLabel" runat="server" Text='<%# Eval("[Cloth ID]") %>' />
<br />
Style:
<asp:Label ID="StyleLabel" runat="server" Text='<%# Eval("Style") %>' />
<br />
Size:
<asp:Label ID="SizeLabel" runat="server" Text='<%# Eval("Size") %>' />
<br />
Color:
<asp:Label ID="ColorLabel" runat="server" Text='<%# Eval("Color") %>' />
<br />
Image 1:
<asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("[Image 1]") %>' />
<br />
Image 2:
<asp:Image ID="Image2" runat="server" ImageUrl='<%# Eval("[Image 2]") %>' />
<br />
Price:
<asp:Label ID="PriceLabel" runat="server" Text='<%# Eval("Price") %>' />
<br />
Notes:
<asp:Label ID="NotesLabel" runat="server" Text='<%# Eval("Notes") %>' />
<br />
Alignment of Image 1:
<asp:Label ID="Alignment_of_Image_1Label" runat="server"
Text='<%# Eval("[Alignment of Image 1]") %>' />
<br />
Alignment of Image 2:
<asp:Label ID="Alignment_of_Image_2Label" runat="server"
Text='<%# Eval("[Alignment of Image 2]") %>' />
<br />
</ItemTemplate>
</asp:DataList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:TPSConnectionString %>"
SelectCommand="SELECT CustomizedOrder.userid, CustomizedOrder.itemID, ClothInventory.clothID AS [Cloth ID], ClothInventory.style AS Style, ClothInventory.size AS Size, Color.color AS Color, CustomizedOrder.image1 AS [Image 1], CustomizedOrder.image2 AS [Image 2], CustomizedOrder.itemPrice AS Price, CustomizedOrder.notes AS Notes, Alignment.description AS [Alignment of Image 1], Alignment_1.description AS [Alignment of Image 2] FROM CustomizedOrder INNER JOIN ClothInventory ON CustomizedOrder.clothID = ClothInventory.clothID INNER JOIN Color ON ClothInventory.colorID = Color.colorID INNER JOIN Alignment ON CustomizedOrder.alignment1 = Alignment.alignmentID INNER JOIN Alignment AS Alignment_1 ON CustomizedOrder.alignment2 = Alignment_1.alignmentID WHERE (CustomizedOrder.userid = @userid)">
<SelectParameters>
</SelectParameters>
</asp:SqlDataSource>
и это для aspx.cs
public partial class addtoShoppingCart : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
MembershipUser User = Membership.GetUser();
object UserGUID = User.ProviderUserKey;
SqlDataSource1.SelectParameters.Add("userid", UserGUID.ToString());
SqlDataSource1.DataBind();
}
}