<asp:DataList runat="server" ID="dataimg" RepeatColumns="4" RepeatDirection="Horizontal" ItemStyle-CssClass="panel" CssClass="table"> <ItemTemplate> <li class="list-group-item list-group" style="width: 200px"> <a href='<%# String.Concat("Img/",Eval("image")) %>' class="fancybox" target="_blank" title='<%#Eval("detail") %>' data-fancybox-group="testgroup"> <img src='Img/<%#Eval("image") %>' alt="image" width="160px" height="160px" /> </a> <asp:Label ID="Label1" runat="server" CssClass="text text-default" Font-Size="12px" Text='<%#Eval("detail") %>'></asp:Label> <%--<label id="label"> <a href="<%#"design.aspx?pid="+Eval("ID") %>">View Details</a></label>--%> </li> </ItemTemplate> </asp:DataList>
protected void Unnamed1_Click(object sender, EventArgs e) { // NB: The "as" operator can return null: LinkButton lnk = sender as LinkButton; if (lnk == null) { throw new InvalidOperationException("sender is not a LinkButton!"); } DateTime theDate; // NB: If your date is in a specific format, use TryParseExact instead. string format = "yyyy-MM-dd"; if (!DateTime.TryParseExact(lnk.Text, format, null, DateTimeStyles.None, out theDate)) { // The text is not a valid date: throw new FormatException(string.Format("The value '{0}' is not a valid date.", lnk.Text)); } TextBox1.Text = lnk.Text; using (SqlConnection con1 = new SqlConnection(ConfigurationManager.AppSettings["str"])) using (SqlCommand cmd = new SqlCommand("SELECT * FROM date1 WHERE ddate = @ddate", con1)) { cmd.Parameters.AddWithValue("@ddate", theDate.Date); DataSet ds1 = new DataSet(); SqlDataAdapter da1 = new SqlDataAdapter(cmd); da1.Fill(ds1); dataimg.Visible = true; dataimg.DataSource = ds1; dataimg.DataBind(); } } Please HELP!!
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)