Beginer problem with ImageButton even
-
Hi Every body i need help.My question is conected with even OnClick on server side.So i get some PostBackUrl from Db who is change for every postback randomly.When is a clicked botton i go to Redirected page unfortunatly when i click back on web browser my pictures is same but my redirection is diffrent.I put that in if(!PostBack) but now how to store the url for last click and if i have same page in different window??Please help. her is a code //Url who is appear when button is pressed private String sLinkUrl; protected void imgBut_Click(object sender, ImageClickEventArgs e) { if (sLinkUrl == null) { sLinkUrl = Session["Url"].ToString(); } Response.Redirect(@"http://"+sLinkUrl); } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //idBanner int nId; ///Title of banner String sTitle; ///Imagine Url String sImgUrl; //check if GetRandomBanner function have online banner if (ControlAccess.GetRandomBanner(out nId, out sTitle, out sImgUrl, out sLinkUrl) > 0) { //set title imgBtn.ToolTip = sTitle; ///set imagine url imgBtn.ImageUrl = sImgUrl; //Add object to the sesion state Session["Url"] = sLinkUrl; } HttpContext.Current.Trace.Write(ControlAccess.SumBannerImpression(nId).ToString()); } } Best regard N.Nikolov
when i want to read something good just seat and type it