Pages

Showing posts with label add class in aspx. Show all posts
Showing posts with label add class in aspx. Show all posts

Thursday, December 26, 2013

Write Code in aspx page - using directive - call asp.net method from design .aspx page

Add classes:

<%@ Page Language="C#" MasterPageFile="~/RT/RTMaster.master" AutoEventWireup="true"
    CodeFile="Welcome.aspx.cs" Inherits="RT_Welcome" Title="Super Recharge" %>

<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>


 <div id="Div1" style="margin-bottom: 10px;">
                    <marquee direction="Horizontal" scrolldelay="130" onmouseover="this.stop()" onmouseout="this.start()">
                    <% SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ERecharge"].ConnectionString); %>
                    <% SqlDataAdapter adap = new SqlDataAdapter("Select date,news from postnews Where PostId = 'RT' Order by date desc", con); %>
                    <% DataTable dt = new DataTable(); %>
                    <% adap.Fill(dt); %>
                    <% if (dt.Rows.Count > 0) %>
                    <%{ %>
                    <% foreach(DataRow dr in dt.Rows) %>
                    <% { %>
                    <span style="color:Red; font-size:larger; font-family:Sans-Serif;"><%= dr["news"].ToString()%> (on <%= dr["date"].ToString()%>) </span>
                     <%} %>
                     <%} %></marquee>
                </div>