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;
using System.Data.SqlClient;

public partial class Ajax_TOPAjax2 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        SqlConnection conn = CDatabase.wtoconn();
        conn.Open();
        SqlCommand smd = new SqlCommand("select * from Advertisement where type='3' and Condition='y'", conn);
        SqlDataReader sdr = smd.ExecuteReader();
        string strall = "";

        if (Session["ad"] == "1")
        {
            while (sdr.Read())
            {
                strall += sdr.GetString(3) + "|" + Server.HtmlDecode(sdr.GetString(19)).Replace("http://127.0.0.1/","") + "|" + sdr.GetInt32(4) + "|" + sdr.GetInt32(5) + "$";
            }
            sdr.Close();
        }
        Session["ad"] = "2";
        conn.Close();
        Response.Write(strall);

        
    }
}
