0% found this document useful (0 votes)
47 views2 pages

ASP.NET Page for Database Message Display

This document contains code for an ASP.NET web page class called Ashwani that retrieves advertisement character data from a database table and displays it in a scrolling message. The Page_Load method connects to the database, selects the ad character field, and passes it to the myfucntion method. Myfucntion generates JavaScript code to continuously scroll the character string in the browser window status bar and registers this code to be included on the page.

Uploaded by

sidratanveer
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views2 pages

ASP.NET Page for Database Message Display

This document contains code for an ASP.NET web page class called Ashwani that retrieves advertisement character data from a database table and displays it in a scrolling message. The Page_Load method connects to the database, selects the ad character field, and passes it to the myfucntion method. Myfucntion generates JavaScript code to continuously scroll the character string in the browser window status bar and registers this code to be included on the page.

Uploaded by

sidratanveer
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

using System;

using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
namespace IndianHoliday
{
/// <summary>
/// Summary description for Ashwani.
/// </summary>
public class Ashwani : [Link]
{
string str1;
private void Page_Load(object sender, [Link] e)
{

SqlCommand cmd= new SqlCommand("SELECT advercharacter


from adrequesttable",cn);
[Link]();
SqlDataReader dr = [Link]();
if ([Link]())
{
str1=(dr[0].ToString());
}
[Link]();
myfucntion(str1);
}

#region Web Form Designer generated code


override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the [Link] Web Form
Designer.
//
InitializeComponent();
[Link](e);
}

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
[Link] += new [Link](this.Page_Load);

}
#endregion
#region global veriable
SqlConnection cn = new
SqlConnection([Link]["Con"]);
SqlCommand cmd = new SqlCommand();
SqlDataAdapter da = new SqlDataAdapter();
protected [Link] TextBox1;
DataSet ds = new DataSet();
#endregion

public void myfucntion(string s)


{
string str = "\n";
str += "<script language=JavaScript>\n";
str += " var i=0\n";
str += " myMsg='" + s +"
'\n";
str += " function scrollMsg() {\n";
str += " frontPart = [Link](i,[Link])\n";
str += " backPart = [Link](0,i)\n";
str += " [Link] = frontPart + backPart\n";
str += " if (i<[Link])\n";
str += " {\n";
str += " i++}\n";
str += " else{\n";
str += " i = 0}\n";
str += " setTimeout('scrollMsg()',100)}\n";
str += "[Link]=scrollMsg()\n<" + "/" + "script>\n";
[Link] = str;
RegisterClientScriptBlock("script",str);
[Link]();
}
}
}

You might also like