using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; using System.Data.SqlClient; using System.Configuration; using System.IO; using System.Net.Mail; using System.Net; using System.Web.UI.HtmlControls; public partial class school1_Achievement : System.Web.UI.Page { string hostName; int idddd; SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["dbcon"].ConnectionString); protected void Page_Load(object sender, EventArgs e) { Uri myuri = new Uri(System.Web.HttpContext.Current.Request.Url.AbsoluteUri); string pathQuery = myuri.PathAndQuery; hostName = myuri.ToString().Replace(pathQuery, ""); if (hostName.StartsWith("www.", StringComparison.OrdinalIgnoreCase)) hostName = hostName.Replace("www.", string.Empty); Session["dom"] = hostName; string text = Request.Url.ToString(); string lastPart = text.Split('=').Last(); Session["CMid"] = lastPart; Label3.Text = lastPart; //Label1.Text = lastPart; getnews22(); getnews222(); } protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { //Image img = (Image)e.Item.FindControl("p1"); //string imagePath = DataBinder.Eval(e.Item.DataItem, "p1").ToString(); //// Check if the image path is empty or null //if (img.ImageUrl == "~/uploads/noimage.jpg") //{ // img.Visible = false; //} } } private void getnews22() { SqlCommand cmd = new SqlCommand("SELECT * FROM FACC where REM='ACHIEVMENT' and sid='" + Session["sid"] + "' and session='" +Session["CMid"] + "'", con); SqlDataAdapter da = new SqlDataAdapter(cmd); DataTable dt = new DataTable(); da.Fill(dt); if (dt.Rows.Count > 0) { Repeater5.DataSource = dt; Repeater5.DataBind(); } } private void getnews222() { SqlCommand cmd = new SqlCommand("select * from epggs WHERE sPG='" + Session["PID"] + "' and sid='" + Session["sid"] + "'", con); SqlDataAdapter da = new SqlDataAdapter(cmd); DataTable dt = new DataTable(); da.Fill(dt); if (dt.Rows.Count > 0) { Repeater1.DataSource = dt; Repeater1.DataBind(); } } }