I'm doing a project in asp.net 2.0 c#. In that project the client need to display text in marquee and should be uploaded by themselves. For that i created admin page, the text should stored in sqldatabase and retrive from database and then display. But
now the client need to click the text running in marquee, then it should go to the next page for its explanation. The text should be uploaded by the client itself in admin page.
I attached the coding what i used for marquee.
Dump the marquee tag. It isn't supported and was an IE only tag. Your best bet would be to use a jQuery slider or carousel instead. They are much more adaptive and have cross-browser support and better control options.
Don't forget to mark useful responses as Answer if they helped you towards a solution.
if you dont mine pls send this full code with database to my mail id or posted here.i tried some other way, but its not working,still now i faced problems.
Nandhini Dev...
Member
34 Points
42 Posts
how to display text in marquee &retrive from sql database in asp.netc#
Feb 20, 2012 11:48 AM|LINK
I'm doing a project in asp.net 2.0 c#. In that project the client need to display text in marquee and should be uploaded by themselves. For that i created admin page, the text should stored in sqldatabase and retrive from database and then display. But now the client need to click the text running in marquee, then it should go to the next page for its explanation. The text should be uploaded by the client itself in admin page.
I attached the coding what i used for marquee.
Please give me correct solution for this problem.
<marquee direction="up" scrollamount="3" onmouseover="this.setAttribute('scrollamount', 0, 0);" onmouseout="this.setAttribute('scrollamount', 3.0, 0);" style="cursor:default; height:192px; width:215px; left: 12px; position: relative; top: 8px;">
<ul style="text-decoration:none; font-weight:normal; list-style:none; font-family:'Times New Roman', Times, serif;">
<asp:Repeater ID="rpt1" Runat="server">
<ItemTemplate>
<li>
<%# DataBinder.Eval(Container.DataItem, "news") %>
</li>
</ItemTemplate>
</asp:Repeater>
</ul>
</marquee></div>
me_ritz
Star
9337 Points
1447 Posts
Re: how to display text in marquee &retrive from sql database in asp.netc#
Feb 20, 2012 02:45 PM|LINK
You can place <%# DataBinder.Eval(Container.DataItem, "news") %> inside linkbutton and
catch its click event in rpt1.ItemCommand event...sending newsid in the process....and redirect
to another page with newsid...fetch text on another page using the querystring.
Repeater markup ------------------ <style> .noclass { text-decoration:none; color:Black; } </style> <marquee direction="up" scrollamount="3" onmouseover="this.setAttribute('scrollamount', 0, 0);" onmouseout="this.setAttribute('scrollamount', 3.0, 0);" style="cursor: default; height: 192px; width: 215px; left: 12px; position: relative; top: 8px;"> <ul style="text-decoration:none; font-weight:normal; list-style:none; font-family:'Times New Roman', Times, serif;"> <asp:Repeater ID="rpt1" runat="server" OnItemCommand="rpt1_ItemCommand"> <ItemTemplate> <asp:LinkButton ID="lnk" runat="server" CssClass="noclass" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "NEWSID") %>' CommandName="go"> <%# DataBinder.Eval(Container.DataItem, "NEWS") %> </asp:LinkButton> </ItemTemplate> </asp:Repeater> </ul> </marquee> CS Code ----------------- protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { YourDataBindingMethod(); } } protected void rpt1_ItemCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandName == "go") { Response.Redirect("YourTextPage.aspx?news=" + e.CommandArgument.ToString()); } } On YourTextPage.aspx ---------------------- On Page_Load() { if(!IsPostBack) { string s = Request.QueryString["news"]; string text = YourMethodToGetTextById(s); } }markfitzme
Star
14439 Points
2230 Posts
Re: how to display text in marquee &retrive from sql database in asp.netc#
Feb 20, 2012 02:50 PM|LINK
Dump the marquee tag. It isn't supported and was an IE only tag. Your best bet would be to use a jQuery slider or carousel instead. They are much more adaptive and have cross-browser support and better control options.
abiruban
All-Star
16048 Points
2734 Posts
Re: how to display text in marquee &retrive from sql database in asp.netc#
Feb 20, 2012 03:07 PM|LINK
Hi try this
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Marquee.aspx.cs" Inherits="Marquee" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <div> <marquee id="ml" style="text-align: center" direction="up" width="195" height="170" scrolldelay="20" scrollamount="1"> <asp:Repeater ID="Repeater1" runat="server"> <ItemTemplate> <br /> <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("URL") %>'> <asp:Label ID="Label1" runat="server" Text='<%# Eval("Desc") %>'></asp:Label></asp:HyperLink><br /> </ItemTemplate> </asp:Repeater> </marquee> </div> </form> </body> </html> using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; public partial class Marquee : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Repeater1.DataSource = GetData(); Repeater1.DataBind(); } } public DataSet GetData() { DataSet ds = new DataSet(); DataTable dt = new DataTable("News"); DataRow dr; dt.Columns.Add(new DataColumn("Id", typeof(Int32))); dt.Columns.Add(new DataColumn("Url", typeof(string))); dt.Columns.Add(new DataColumn("Desc", typeof(string))); for (int i = 1; i <= 10; i++) { dr = dt.NewRow(); dr[0] = i; dr[1] = "URL" + i.ToString(); dr[2] = "Description " + i.ToString(); dt.Rows.Add(dr); } ds.Tables.Add(dt); Session["dt"] = dt; return ds; } }***DON'T FORGET TO CLICK “MARK AS ANSWER” ON THE POST IF HELPED YOU.
Nandhini Dev...
Member
34 Points
42 Posts
Re: how to display text in marquee &retrive from sql database in asp.netc#
Feb 21, 2012 04:40 AM|LINK
Thank You so much its working great! Thanks a lot
a.periyanaya...
Member
3 Points
15 Posts
Re: how to display text in marquee &retrive from sql database in asp.netc#
Dec 01, 2012 12:39 PM|LINK
hi nandhini devi,
if you dont mine pls send this full code with database to my mail id or posted here.i tried some other way, but its not working,still now i faced problems.
regards
samy.