Display marquees text from database in ASP.Net

kankon
 
on Aug 22, 2021 11:06 PM
449 Views

marquee not show name add the text

html site.master

<div class="marquee">          
    <asp:SqlDataSource ID="datanews" runat="server" 
        ConnectionString="<%$ ConnectionStrings:kankonConnectionString %>" SelectCommand="SELECT chat, Name FROM Customers"></asp:SqlDataSource>
 
       <marquee  onmouseover="this.stop()" behavior="alternate" onmouseout="this.start()" scrolldelay="10" scrollamount="5" Direction="Right" >
        <asp:Repeater ID="Repeater2" runat="server" DataSourceID="datanews">
          <itemTemplate> 
                       <asp:HyperLink ID="HyperLink2"  runat="server" text=  '<%# Eval("chat") %>' text2= '<%# Eval("name") %>'></asp:HyperLink>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    
                    </itemTemplate>
              </asp:Repeater></marquee>
</div>
<%--  اسم الموقع--%>
<div class="auto-style3" 
            style="background-color: #0E5297; font-family: Arial; font-size: medium; color: #FFFFFF; ">
</div >

 

using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace gsc.Admin
{
    public partial class News : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                this.BindGrid();
            }
        }

        private void BindGrid()
        {
            string constr = ConfigurationManager.ConnectionStrings["kankonConnectionString"].ConnectionString;
            using (SqlConnection con = new SqlConnection(constr))
            {
                using (SqlCommand cmd = new SqlCommand("Customers_chat"))
                {
                    cmd.Parameters.AddWithValue("@Action", "SELECT");
                    using (SqlDataAdapter sda = new SqlDataAdapter())
                    {
                        cmd.CommandType = CommandType.StoredProcedure;
                        cmd.Connection = con;
                        sda.SelectCommand = cmd;
                        using (DataTable dt = new DataTable())
                        {
                            sda.Fill(dt);
                            GridView1.DataSource = dt;
                            GridView1.DataBind();
                        }
                    }
                }
            }
        }
    }
}

 

Download FREE API for Word, Excel and PDF in ASP.Net: Download
kankon
 
on Aug 23, 2021 09:11 AM
dharmendr says:
kankon says:
marquee not show name add the text

Please explain the issue in details.

its fiexd by you : marquee

<asp:HyperLink ID="HyperLink2" runat="server" Text='<%# String.Format("{0}-{1}",Eval("CustomerId"),Eval("Name")) %>' ></asp:HyperLink>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;