<asp:Button ID="btn1" type="button" runat="server" Text="test" OnClick="Click_Me" data-toggle="modal" data-target="#modal_10" class="btn btn-primary"/> <div class="modal fade" id="modal_10" tabindex="-1" role="dialog" aria-labelledby="ModalLabel_10" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h4 class="modal-title" id="ModalLabel_10">Modal title</h4> </div> <div class="modal-body" id="modals"> <img class="img-rounded" id="modal_Img" runat="server" src='<%# Eval("image_path","~/{0}")%>' style="height:50px; width:50px;" /> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <button type="button" class="btn btn-primary">Save</button> </div> </div> </div> </div>
protected void Click_Me(object sender, EventArgs e) { //Display modal_10 image inside the popup con.Open(); cmd = new SqlCommand("select top(1) image_path from Images", con); dr = cmd.ExecuteReader(); while (dr.Read()) { modal_Img.Src = dr["image_path"].ToString(); } con.Close(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)