working but content not loaded.
error
This page isn't working
localhost redirected you too many times.
namespace hsptl
{
public partial class indx : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Response.AppendHeader("Refresh", "1");
if (!this.IsPostBack)
{
this.BindGrid();
this.BindGrid1();
//this.BindGrid2();
}
if (DateTime.Today.DayOfWeek == DayOfWeek.Thursday)
{
// Redirect to this chng_pg if sunday.
Response.Redirect("/chng_pg.aspx");
}
else
{
// Redirect to Indx page on other days.
Response.Redirect("/indx.aspx");
}
Label2.Text = System.DateTime.Now.ToString("dd/MM/yyyy");
}
private void BindGrid()
{
string constr = ConfigurationManager.ConnectionStrings["constr"].ConnectionString;
using (SqlConnection con = new SqlConnection(constr))
{
using (SqlCommand cmd = new SqlCommand("SELECT doc_nm, spl,room,fn,an,rmk FROM aval"))
{
using (SqlDataAdapter sda = new SqlDataAdapter())
{
cmd.Connection = con;
sda.SelectCommand = cmd;
using (DataTable dt = new DataTable())
{
sda.Fill(dt);
GridView1.DataSource = dt;
GridView1.DataBind();
}
}
}
}
}
private void BindGrid1()
{
string constr = ConfigurationManager.ConnectionStrings["constr"].ConnectionString;
using (SqlConnection con = new SqlConnection(constr))
{
using (SqlCommand cmd = new SqlCommand("SELECT doc_nm, spl,room,fn,an,rmk FROM vstr_doc"))
{
using (SqlDataAdapter sda = new SqlDataAdapter())
{
cmd.Connection = con;
sda.SelectCommand = cmd;
using (DataTable dt = new DataTable())
{
sda.Fill(dt);
GridView2.DataSource = dt;
GridView2.DataBind();
}
}
}
}
}
}
}