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.OleDb; using ParameterPasser; public partial class foto : System.Web.UI.Page { string connStr = ConfigurationManager.ConnectionStrings["Fotogalerija"].ConnectionString; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ucitajFotografije(); } } // // protected void ucitajFotografije() { int katId; //string fotoId = null; //string foto = null; //string visible = null; string kategorija = null; // katId = Convert.ToInt32(Request["katId"]); ArrayList photo_arr = new ArrayList(); // OleDbConnection aConnection = new OleDbConnection(connStr); OleDbCommand aCommand = new OleDbCommand("SELECT * FROM HA_UcitajFoto WHERE KatId=" + katId, aConnection); aConnection.Open(); OleDbDataReader aReader = aCommand.ExecuteReader(); while (aReader.Read()) { kategorija = Server.UrlDecode(aReader["Kat"].ToString()); photo_arr.Add(new PhotoData( aReader["FotoId"].ToString(), Server.UrlDecode(aReader["Foto"].ToString()), Server.UrlDecode(aReader["Visible"].ToString()), Server.UrlDecode(aReader["Potpis"].ToString()), Server.UrlDecode(aReader["Mapa"].ToString()), Server.UrlDecode(aReader["Kat"].ToString()) )); // //fotoId = aReader["FotoId"].ToString(); //foto = aReader["Foto"].ToString(); //visible = Server.UrlDecode(aReader["Visible"].ToString()); //potpis = Server.UrlDecode(aReader["Potpis"].ToString()); // } // // aConnection.Close(); Repeater1.DataSource = photo_arr; Repeater1.DataBind(); // Label1.Text = kategorija; // //Response.Write(Request.Path.ToString()); //Response.Write("kategorija= " + kategorija); // //rewriteURL(); } public class PhotoData { private string fotoId; private string foto; private string visible; private string potpis; private string mapa; private string kategorija; public PhotoData(string fotoId, string foto, string visible, string potpis, string mapa, string kategorija) { this.fotoId = fotoId; this.foto = foto; this.visible = visible; this.potpis = potpis; this.mapa = mapa; this.kategorija = kategorija; } public string FotoId { get { return fotoId; } } public string Foto { get { return foto; } } public string Visible { get { return visible; } } public string Potpis { get { return potpis; } } public string Mapa { get { return mapa; } } public string Kategorija { get { return kategorija; } } } protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e) { } protected void Repeater2_ItemCommand(object source, RepeaterCommandEventArgs e) { } public void RaisePostBackEvent(string eventArgument) { SessionParameterPasser sessionWrapper = new SessionParameterPasser("fotogalerija.aspx"); sessionWrapper["fotoId"] = eventArgument; sessionWrapper.PassParameters(); } }