このフォト アルバムを asp.net Web サイトに統合しようとしています。データベースから 3 つの画像の URL を選択し、特定のアルバムからそれらの 3 つの画像を表示しています。問題は、ユーザーが複数のアルバムを持っている場合はどうなるかということです。そのユーザーに関連付けられたデータベースにあるのと同じ数の Jquery アルバムをページ上に生成できる必要があります。
<div class="image_stack" style="margin-left:300px" runat="server" >
<img id="photo1" class="stackphotos" runat="server" clientidmode="static" >
<img id="photo2" class="stackphotos" runat="server" clientidmode="static">
<img id="photo3" class="stackphotos" runat="server" clientidmode="static" >
</div>
public DataTable dt = new DataTable();
dboperation dbo = new dboperation();
protected void Page_Load(object sender, EventArgs e)
{
string q = "select photourl ,AlbumName from PhotoAlbum where UserId=42";
dt = dbo.Getdt(q);
string a = dt.Rows[0]["photourl"].ToString();
string b = dt.Rows[1]["photourl"].ToString();
string c = dt.Rows[2]["photourl"].ToString();
photo1.Src = a.Substring(1, a.Length - 1);
photo2.Src = b.Substring(1, b.Length - 1);
photo3.Src = c.Substring(1, c.Length - 1);
q = " select PhotoAlbum.AlbumId,PhotoAlbum.AlbumName from PhotoAlbum where UserId=42";
dt = dbo.Getdt(q);
drpalbum.DataSource = dt;
drpalbum.DataTextField = "albumname";
drpalbum.DataValueField = "albumid";
drpalbum.DataBind();
}
さらにコードが必要な場合はお知らせください。