protected void grdTaskList_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { //e.Row.Cells[2].Style.Add(HtmlTextWriterStyle.TextAlign, "left"); e.Row.Cells[3].Style.Add(HtmlTextWriterStyle.TextAlign, "left"); e.Row.Cells[9].Style.Add(HtmlTextWriterStyle.TextAlign, "right"); e.Row.Cells[10].Style.Add(HtmlTextWriterStyle.TextAlign, "right"); string sFile = DataBinder.Eval(e.Row.DataItem, "ATT_FILE").ToString(); System.Web.UI.WebControls.ImageButton imgFile = (System.Web.UI.WebControls.ImageButton)e.Row.FindControl("imgFile"); if (sFile == "") { imgFile.Visible = false; } else { System.Web.UI.WebControls.HiddenField hdfFile = (System.Web.UI.WebControls.HiddenField)e.Row.FindControl("hdfFile"); hdfFile.Value = sFile; imgFile.OnClientClick = "return mfUpload('" + hdfFile.ClientID + "'); return false;"; } } else if (e.Row.RowType == DataControlRowType.Header) { } }
protected void createGameField(int gridSize) { ImageButton tb = new ImageButton(); if (ListOfButtons != null) ListOfButtons.Clear(); for (int i = 1; i <= gridSize; i++) { tb = new ImageButton(); tb.ID = i.ToString(); tb.Width = 40; tb.Height = 40; tb.BackColor = System.Drawing.Color.White; tb.ImageUrl = @"https://upload.wikimedia.org/wikipedia/commons/c/c7/Minesweeper_unopened_square.svg"; tb.Click += new ImageClickEventHandler(this.Button_Click); gameField.Controls.Add(tb); ListOfButtons.Add(tb); } gameField.Width = (int)(Math.Sqrt(gridSize) * 40); gameField.Height = gameField.Width; }
protected override void OnInit(EventArgs e) { dataTab = this.TabViewDetails.NewTabPage("Videos"); dataTab.Controls.Add(this.tabVideos); btnDownloadVideos = dataTab.Menu.NewImageButton(); btnDownloadVideos.ID = "btnDownloadVideos"; btnDownloadVideos.AlternateText = "Download"; btnDownloadVideos.ClientIDMode = System.Web.UI.ClientIDMode.Static; btnDownloadVideos.ImageUrl = GlobalSettings.Path + "/narnoo/distributors/icons/icons_download.png"; btnDownloadVideos.ValidationGroup = ""; btnRemoveFromChannel = dataTab.Menu.NewImageButton(); btnRemoveFromChannel.ID = "btnRemoveFromChannel"; btnRemoveFromChannel.AlternateText = "Remove from channel"; btnRemoveFromChannel.ClientIDMode = System.Web.UI.ClientIDMode.Static; btnRemoveFromChannel.ImageUrl = GlobalSettings.Path + "/narnoo/distributors/icons/icons_remove_from_channel.png"; btnRemoveFromChannel.ValidationGroup = ""; this.pagerVideos.PageIndexChanged += pagerVideos_PageIndexChanged; this.btnChangeChannel.Click += btnChangeChannel_Click; }
private void SearchTask2Json(string task) { DataTable dtSearchTask = Library.Data.JSONToDataTable(task); int searchTotal = dtSearchTask.Rows.Count; for (int i = 0; i < searchTotal; i++) { ImageButton imgBtn = new ImageButton(); imgBtn.ID = i.ToString(); imgBtn.ImageUrl = "/img/poster.png"; imgBtn.Width = 50; imgBtn.Height = 50; HyperLink hl = new HyperLink(); hl.ID = i.ToString(); hl.Text = dtSearchTask.Rows[i]["TaskTitle"].ToString(); Label lbl = new Label(); lbl.ID = i.ToString(); lbl.Text = dtSearchTask.Rows[i]["TaskDetail"].ToString()+"<br /> <hr />"; pnlSearchTask.Controls.Add(imgBtn); pnlSearchTask.Controls.Add(hl); pnlSearchTask.Controls.Add(lbl); } }
protected void initPage() { RegistedUser MySelf = new RegistedUser(); MySelf = (RegistedUser)Session["User"]; MySelf.Userservice = new UserServiceClasses.RegisterUserService(); List<Message> PublishMessageList = MySelf.Userservice.GetUserUreadPublicMessages(MySelf.UserName); Panel single = new Panel(); foreach (Message singleMessage in PublishMessageList) { HyperLink MessageFrom = new HyperLink(); MessageFrom.Text = singleMessage.userFrom.NickName; MessageFrom.NavigateUrl = "~/WebPage/UserOwnZonePage/UserOwnZonePage/UserOwnZonePage.aspx?VisitedUserID=" + singleMessage.userFrom.UserName; ; single.Controls.Add(MessageFrom); Label MessageCon = new Label(); MessageCon.Text = singleMessage.content; single.Controls.Add(MessageCon); ImageButton deleteButton = new ImageButton(); deleteButton.ImageUrl = "~/newpng/Trash.png"; deleteButton.Height = new Unit(48); deleteButton.ID = singleMessage.ID.ToString(); deleteButton.OnClientClick += "DeleteItem"; deleteButton.Click += new ImageClickEventHandler(deleteButton_Click); single.Controls.Add(deleteButton); } this.ALLPublicMessage.Controls.Add(single); }
protected void deptButton_Click(object sender, ImageClickEventArgs e) { System.Web.UI.WebControls.ImageButton imgButton = (System.Web.UI.WebControls.ImageButton)sender; if (imgButton != null) { if (imgButton.ID.Contains("department")) { drdDepartment.ClearSelection(); drdDepartment_SelectionChanged(null, null); } else if (imgButton.ID.Contains("employee")) { drdEmployee.ClearSelection(); drdEmployee_SelectionChanged(null, null); } else if (imgButton.ID.Contains("requisition")) { drdRequisitions.ClearSelection(); drdRequisitions_SelectionChanged(null, null); } else if (imgButton.ID.Contains("items")) { drdItems.ClearSelection(); drdItems_SelectionChanged(null, null); } } }
public void ShowImages() { if (_images != null) { imgMain.ImageUrl = !_images[0].Contains("no-image.jpg") ? _images[0].Substring(0, _images[0].IndexOf(".jpg")) + "-main.jpg" : _images[0]; lnkImage.NavigateUrl = _images[0]; pnlThumbs.Controls.Clear(); if (_images.Count > 1) { for (int i = 0; i < _images.Count; i++) { ImageButton image = new ImageButton(); image.ID = "imgThumb" + i.ToString(); image.ImageUrl = !_images[i].Contains("no-image.jpg") ? _images[i].Substring(0, _images[i].IndexOf(".jpg")) + "-thumb.jpg" : _images[i]; image.CssClass = "thumb img-responsive"; //image.Click += new ImageClickEventHandler(image_Click); image.OnClientClick = "changeImg(this.src);return false;"; pnlThumbs.Controls.Add(new LiteralControl("<div class='col-lg-4'>")); pnlThumbs.Controls.Add(image); pnlThumbs.Controls.Add(new LiteralControl("</div>")); } } } }
protected override void AttachChildControls() { this.accountList = (Common_Advance_AccountList)this.FindControl("Common_Advance_AccountList"); this.pager = (Pager)this.FindControl("pager"); this.calendarStart = (WebCalendar)this.FindControl("calendarStart"); this.calendarEnd = (WebCalendar)this.FindControl("calendarEnd"); this.dropTradeType = (TradeTypeDropDownList)this.FindControl("dropTradeType"); this.imgbtnSearch = (System.Web.UI.WebControls.ImageButton) this.FindControl("imgbtnSearch"); this.litAccountAmount = (FormatedMoneyLabel)this.FindControl("litAccountAmount"); this.litRequestBalance = (FormatedMoneyLabel)this.FindControl("litRequestBalance"); this.litUseableBalance = (FormatedMoneyLabel)this.FindControl("litUseableBalance"); this.imgbtnSearch.Click += new System.Web.UI.ImageClickEventHandler(this.imgbtnSearch_Click); PageTitle.AddSiteNameTitle("预付款账户"); if (!this.Page.IsPostBack) { Member member = Users.GetUser(HiContext.Current.User.UserId, false) as Member; if (!member.IsOpenBalance) { this.Page.Response.Redirect(Globals.ApplicationPath + string.Format("/user/OpenBalance.aspx?ReturnUrl={0}", System.Web.HttpContext.Current.Request.Url)); } this.BindBalanceDetails(); this.litAccountAmount.Money = member.Balance; this.litRequestBalance.Money = member.RequestBalance; this.litUseableBalance.Money = member.Balance - member.RequestBalance; } }
protected internal override void CreateChildControls() { this.Controls.Clear(); this._logInLinkButton = new LinkButton(); this._logInImageButton = new ImageButton(); this._logOutLinkButton = new LinkButton(); this._logOutImageButton = new ImageButton(); this._logInLinkButton.EnableViewState = false; this._logInImageButton.EnableViewState = false; this._logOutLinkButton.EnableViewState = false; this._logOutImageButton.EnableViewState = false; this._logInLinkButton.EnableTheming = false; this._logInImageButton.EnableTheming = false; this._logInLinkButton.CausesValidation = false; this._logInImageButton.CausesValidation = false; this._logOutLinkButton.EnableTheming = false; this._logOutImageButton.EnableTheming = false; this._logOutLinkButton.CausesValidation = false; this._logOutImageButton.CausesValidation = false; CommandEventHandler handler = new CommandEventHandler(this.LogoutClicked); this._logOutLinkButton.Command += handler; this._logOutImageButton.Command += handler; handler = new CommandEventHandler(this.LoginClicked); this._logInLinkButton.Command += handler; this._logInImageButton.Command += handler; this.Controls.Add(this._logOutLinkButton); this.Controls.Add(this._logOutImageButton); this.Controls.Add(this._logInLinkButton); this.Controls.Add(this._logInImageButton); }
public override void InitializeCell(DataControlFieldCell cell, DataControlCellType cellType, DataControlRowState rowState, int rowIndex) { base.InitializeCell(cell, cellType, rowState, rowIndex); if (cell == null) { throw new ArgumentNullException("cell"); } ImageButton button3 = new ImageButton { ID = "rise", ImageUrl = this.RiseUrl, CommandName = "Rise" }; ImageButton child = button3; ImageButton button4 = new ImageButton { ID = "fall", ImageUrl = this.FallUrl, CommandName = "Fall" }; ImageButton button2 = button4; if (cellType == DataControlCellType.DataCell) { cell.Controls.Add(button2); cell.Controls.Add(child); } }
public void InstantiateIn(System.Web.UI.Control container) { var imageField = new System.Web.UI.WebControls.ImageButton(); imageField.DataBinding += imageField_DataBinding; container.Controls.Add(imageField); }
protected override void OnInit(EventArgs e) { dataTab = this.TabViewDetails.NewTabPage("Videos"); dataTab.Controls.Add(this.tabVideos); btnDownloadVideos = dataTab.Menu.NewImageButton(); btnDownloadVideos.ID = "btnDownloadVideos"; btnDownloadVideos.ClientIDMode = System.Web.UI.ClientIDMode.Static; btnDownloadVideos.AlternateText = "Download"; btnDownloadVideos.ImageUrl = GlobalSettings.Path + "/narnoo/distributors/icons/icons_download.png"; btnDownloadVideos.ValidationGroup = ""; btnAddToChannel = dataTab.Menu.NewImageButton(); btnAddToChannel.ID = "btnAddToChannel"; btnAddToChannel.ClientIDMode = System.Web.UI.ClientIDMode.Static; btnAddToChannel.AlternateText = "AddToChannel"; btnAddToChannel.ImageUrl = GlobalSettings.Path + "/narnoo/distributors/icons/icons_add_to_channel.png"; btnAddToChannel.ValidationGroup = ""; btnDeleteVideo = dataTab.Menu.NewImageButton(); btnDeleteVideo.ID = "btnDeleteVideo"; btnDeleteVideo.ClientIDMode = System.Web.UI.ClientIDMode.Static; btnDeleteVideo.AlternateText = "Delete"; btnDeleteVideo.ImageUrl = GlobalSettings.Path + "/narnoo/distributors/icons/icons_delete_video.png"; btnDeleteVideo.ValidationGroup = ""; this.pagerVideos.PageIndexChanged += pagerVideos_PageIndexChanged; }
public void createTable() { Reservation reservation = (Reservation)Session["reservationBusy"]; List<WorkStation> busy = new List<WorkStation>(reservation.WsBusy); int cont = 1; int z = 0; for (int i = 0; i < 6; i++) { TableRow tr = new TableRow(); myTable.Rows.Add(tr); for (int j = 0; j < 5; j++) { TableCell tc = new TableCell(); tc.ID = "" + cont; ImageButton btn = new ImageButton(); if (z < busy.Count) { if (busy[z].Busy == true) { btn.ImageUrl = "img/StationBusy.png"; btn.Enabled = false; } else { btn.ImageUrl = "Images/indice.png"; } } btn.Click += new ImageClickEventHandler(btn_Click); tc.Controls.Add(btn); tr.Cells.Add(tc); cont++; z++; } } }
protected void ugrdEstOpinion_InitializeRow(object sender, RowEventArgs e) { string sFileId = (e.Row.Cells.FromKey("REVIEW_FILE_ID").Value == null) ? "" : e.Row.Cells.FromKey("REVIEW_FILE_ID").Value.ToString(); TemplatedColumn colEst = (TemplatedColumn)e.Row.Cells.FromKey("EST_LEVEL_NAME").Column; System.Web.UI.WebControls.Label lblLevel = (System.Web.UI.WebControls.Label)((CellItem)colEst.CellItems[e.Row.BandIndex]).FindControl("lblEST_LEVEL_NAME"); System.Web.UI.WebControls.ImageButton btnFile = (System.Web.UI.WebControls.ImageButton)((CellItem)colEst.CellItems[e.Row.BandIndex]).FindControl("iBtnReviewFile"); System.Web.UI.WebControls.HiddenField hdfFile = (System.Web.UI.WebControls.HiddenField)((CellItem)colEst.CellItems[e.Row.BandIndex]).FindControl("iHdfReviewFile"); lblLevel.Text = (e.Row.Cells.FromKey("EST_LEVEL_NAME").Value == null) ? "" : e.Row.Cells.FromKey("EST_LEVEL_NAME").Value.ToString(); string sOpinion = (e.Row.Cells.FromKey("OPINION").Value == null) ? "" : e.Row.Cells.FromKey("OPINION").Value.ToString(); if (sOpinion == "") { e.Row.Hidden = true; } if (sFileId.Length > 0) { hdfFile.Value = sFileId; btnFile.Visible = true; btnFile.OnClientClick = "return mfUpload('" + hdfFile.ClientID.Replace("$", "_") + "')"; } else { hdfFile.Value = ""; btnFile.Visible = false; } }
public void BindData() { GridView1.PagerSettings.Mode = PagerButtons.NumericFirstLast; String kod = (String)Session["kod"]; DataRow gon = veritabani.GetDataRow("select email from giris_bilgileri where kod='" + kod + "' "); String kime = gon["email"].ToString(); SqlConnection Conn = new SqlConnection(s); SqlCommand Cmd = new SqlCommand("SELECT kimden, tarih , konu,okundu,id FROM mesajlar WHERE kime='" + kime + "' or kime='SİSTEM YÖNETİCİSİ' order by okundu, tarih DESC ", Conn); SqlDataAdapter DA = new SqlDataAdapter(Cmd); DataSet DS = new DataSet(); DA.Fill(DS, "mesajlar"); Conn.Open(); Cmd.ExecuteNonQuery(); GridView1.DataSource = DS; GridView1.DataBind(); Conn.Close(); // String[] idler = new String[GridView1.Columns.Count/2]; foreach (GridViewRow dg in GridView1.Rows) { //for (int i = 0; i < GridView1.Rows.Count; i++ ) // Response.Write("<script>alert('"+dg.Cells.Equals("id").ToString();"'); </script>"); System.Web.UI.WebControls.ImageButton id = (System.Web.UI.WebControls.ImageButton)GridView1.Rows[dg.RowIndex].FindControl("okundu"); int m_id = Int32.Parse(id.AlternateText); if (m_id == 0) { id.ImageUrl = "~/image/unread.ico"; GridView1.Rows[dg.RowIndex].BackColor = System.Drawing.Color.Bisque; } else { //GridView1.Rows[dg.RowIndex].Cells.Equals("okundu"); id.ImageUrl = "~/image/read.ico"; } } if (GridView1.Rows.Count == 0) { Button1.Visible = false; Label2.Text = "Gönderilenler Kutusu boş."; Label3.Visible = false; Label4.Visible = false; Label5.Visible = false; mesaj.Visible = false; TextBox1.Visible = false; TextBox2.Visible = false; Button2.Visible = false; Button3.Visible = false; Label7.Visible = false; } }
/**//// <summary> /// Add the confirm message to button /// Created : GuangMing Chu 1,1,2007 /// Modified: GuangMing Chu 1,1,2007 /// Modified: GuangMing Chu 1,1,2007 /// 代码调用: /// UIHelper.AddConfirm(this.Button1, "真的要删了??"); /// 点确定按钮就会执行事件中的代码,点取消不会 /// </summary> /// <param name="button">The control, must be a button</param> /// <param name="strMsg">The popup message</param> public static void AddConfirm(System.Web.UI.WebControls.Button button, string strMsg) { strMsg = strMsg.Replace("\n", "file://n/"); strMsg = strMsg.Replace("\r", "file://r/"); strMsg = strMsg.Replace("\"", "\\\""); strMsg = strMsg.Replace("\'", "\\\'"); button.Attributes.Add("onClick", "return confirm('" + strMsg + "')"); } /**//// <summary> /// Add the confirm message to button /// Created : GuangMing Chu, 1 1,2007 /// Modified: GuangMing Chu, 1 1,2007 /// Modified: /// 代码调用: /// UIHelper.AddConfirm(this.Button1, "真的要删了??"); /// 点确定按钮就会执行事件中的代码,点取消不会 /// /// </summary> /// <param name="button">The control, must be a button</param> /// <param name="strMsg">The popup message</param> public static void AddConfirm(System.Web.UI.WebControls.ImageButton button, string strMsg) { strMsg = strMsg.Replace("\n", "file://n/"); strMsg = strMsg.Replace("\r", "file://r/"); strMsg = strMsg.Replace("\"", "\\\""); strMsg = strMsg.Replace("\'", "\\\'"); button.Attributes.Add("onClick", "return confirm('" + strMsg + "')"); }
private void DataGridRicerca_ItemCreated(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e) { System.Web.UI.WebControls.ImageButton _img = (System.Web.UI.WebControls.ImageButton)(e.Item.FindControl("Imagebutton1")); if (_img != null) { _img.Attributes.Add("onclick", "return confirm('Si vuole effettuare la cancellazione?')"); } }
private void DataGridRicerca_ItemCreated(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e) { System.Web.UI.WebControls.ImageButton _img = (System.Web.UI.WebControls.ImageButton)(e.Item.FindControl("Imagebutton3")); if (_img != null) { _img.Attributes.Add("onclick", "return confirm('Eliminare email con tutte le associazioni edifici e servizi?');"); } }
protected void Page_Load( Object sender, EventArgs e ) { try { UserInfo _UserInfo = UserController.GetCurrentUserInfo(); foreach( ModuleAction action in this.MenuActions ) { if( action.CommandName == ModuleActionType.PrintModule ) { if( action.Visible && PortalSecurity.HasNecessaryPermission( action.Secure, PortalSettings, ModuleConfiguration, _UserInfo.UserID.ToString() ) ) { bool blnPreview = false; if( Request.Cookies["_Tab_Admin_Preview" + PortalSettings.PortalId] != null ) { blnPreview = bool.Parse( Request.Cookies["_Tab_Admin_Preview" + PortalSettings.PortalId].Value ); } if( blnPreview == false || ( action.Secure == SecurityAccessLevel.Anonymous || action.Secure == SecurityAccessLevel.View ) ) { if( PortalModule.ModuleConfiguration.DisplayPrint ) { ImageButton ModuleActionIcon = new ImageButton(); if( !String.IsNullOrEmpty(PrintIcon) ) { ModuleActionIcon.ImageUrl = PortalModule.ModuleConfiguration.ContainerPath.Substring( 0, ModuleConfiguration.ContainerPath.LastIndexOf( "/" ) + 1 ) + PrintIcon; } else { ModuleActionIcon.ImageUrl = "~/images/" + action.Icon; } ModuleActionIcon.ToolTip = action.Title; ModuleActionIcon.ID = "ico" + action.ID; ModuleActionIcon.CausesValidation = false; ModuleActionIcon.Click += new ImageClickEventHandler( IconAction_Click ); this.Controls.Add( ModuleActionIcon ); } } } } } // set visibility if( this.Controls.Count > 0 ) { this.Visible = true; } else { this.Visible = false; } } catch( Exception exc ) //Module failed to load { Exceptions.ProcessModuleLoadException( this, exc ); } }
public ImageButton CrearImagen(String id, String cls, String url) { ImageButton imagen = new ImageButton(); imagen.ID = id; imagen.CssClass = cls; imagen.ImageUrl = url; //imagen.Attributes.Add("runat", "server"); return imagen; }
public MyPager() { _pre = new ImageButton(); _next = new ImageButton(); _first = new ImageButton(); _end = new ImageButton(); _go = new ImageButton(); _lb = new Label(); }
public void OpenDialogForButtonWithLocation(ImageButton button, string message) { ScriptManager.RegisterClientScriptBlock( button, typeof(ImageButton), DateTime.Now.ToString().Replace(":", " "),///使用当前时间作为标识 "alert('" + message + "');location='PaperLists.aspx'", true); }
protected void Page_Load(object sender, EventArgs e) { #region Interfaz //Hashtable htbPermisos = (Hashtable)Session["permisos"]; //char cPermiso = (char)htbPermisos["estados"]; Master.FindControl("btnNuevo").Visible = false; Master.FindControl("btnEliminar").Visible = false; Master.FindControl("btnMostrar").Visible = false; Master.FindControl("btnReportes").Visible = false; Master.FindControl("rdbFiltro1").Visible = false; Master.FindControl("rdbFiltro2").Visible = false; Master.FindControl("rdbFiltro3").Visible = false; Master.FindControl("btnBuscar").Visible = false; Master.FindControl("txtBuscar").Visible = false; Master.FindControl("lblBuscar").Visible = false; //imbNuevo = (ImageButton)Master.FindControl("imgBtnNuevo"); //imbNuevo.Click += new ImageClickEventHandler(this.imbNuevo_Click); imbEditar = (ImageButton)Master.FindControl("imgBtnEditar"); imbEditar.Click += new ImageClickEventHandler(this.imbEditar_Click); //imbEliminar = (ImageButton)Master.FindControl("imgBtnEliminar"); //imbEliminar.Click += new ImageClickEventHandler(this.imbEliminar_Click); //imbMostrar = (ImageButton)Master.FindControl("imgBtnMostrar"); //imbMostrar.Click += new ImageClickEventHandler(this.imbMostrar_Click); //imbReportes = (ImageButton)Master.FindControl("imgBtnReportes"); //imbReportes.Visible = false; imbAceptar = (ImageButton)Master.FindControl("imgBtnAceptar"); imbAceptar.Click += new ImageClickEventHandler(this.imbAceptar_Click); imbAceptar.ValidationGroup = "Configuracion"; imbCancelar = (ImageButton)Master.FindControl("imgBtnCancelar"); imbCancelar.Click += new ImageClickEventHandler(this.imbCancelar_Click); //rdbTodos = (RadioButton)Master.FindControl("rdbFiltro1"); //rdbTodos.Text = "Nombre y Clave"; //rdbTodos.Checked = true; //rdbClave = (RadioButton)Master.FindControl("rdbFiltro2"); //rdbClave.Text = "Clave"; //rdbNombre = (RadioButton)Master.FindControl("rdbFiltro3"); //rdbNombre.Text = "Nombre"; //lblReportes = (Label)Master.FindControl("lblReportes"); //lblReportes.Visible = false; //btnBuscar = (Button)Master.FindControl("btnBuscar"); //btnBuscar.Click += new EventHandler(this.btnBuscar_Click); //txbBuscar = (TextBox)Master.FindControl("txtBuscar"); lblNombreModulo = (Label)Master.FindControl("lblNombreModulo"); lblNombreModulo.Text = "Cambiar Contraseña"; #endregion if (!IsPostBack) { txbUsuario.Text = Session["usuario"].ToString(); txbUsuario.Enabled = false; Habilita(); } }
private void AddEmailImageButton(Panel p) { this.emailImageButton = new ImageButton(); this.emailImageButton.ID = "SendEmailImageButton"; this.emailImageButton.CssClass = this.GetImageButtonCssClass(); this.emailImageButton.ImageUrl = this.Page.ResolveUrl(ConfigurationHelper.GetReportParameter("EmailIcon")); p.Controls.Add(this.emailImageButton); }
public void cargar_ofertas_academicas() { Oferta[] ofertas = new Oferta().cargar_por_tipo("2"); for (int i = 0; i < ofertas.Length; i++) { TableRow fila1 = new TableRow(); TableCell celda = new TableCell(); celda.CssClass = "td"; celda.Text = ofertas[i].Oficio; TableCell celda1 = new TableCell(); celda1.CssClass = "td"; celda1.Text = ofertas[i].Entidad; TableCell celda2 = new TableCell(); celda2.CssClass = "td"; celda2.Text = Convert.ToDateTime(ofertas[i].Fecha).ToString("dd-MM-yyyy"); TableCell celda3 = new TableCell(); celda3.CssClass = "td"; celda3.Text = Convert.ToDateTime(ofertas[i].Fecha_limite).ToString("dd-MM-yyyy"); TableCell celda4 = new TableCell(); celda4.CssClass = "td"; HyperLink link = new HyperLink(); link.Text = "Ir a la oferta"; link.NavigateUrl = Global.ruta + "/mostrar_oferta.aspx?id=" + ofertas[i].Id; celda4.Controls.AddAt(0, link); TableCell celda7 = new TableCell(); celda7.CssClass = "td"; HyperLink link_usu = new HyperLink(); link_usu.Text = ofertas[i].Usuario; celda7.Controls.AddAt(0, link_usu); fila1.Cells.Add(celda); fila1.Cells.Add(celda1); fila1.Cells.Add(celda2); fila1.Cells.Add(celda3); fila1.Cells.Add(celda7); fila1.Cells.Add(celda4); TableCell celda5 = new TableCell(); celda5.CssClass = "td"; TableCell celda6 = new TableCell(); celda6.CssClass = "td"; if (ofertas[i].Cod_usuario.Equals(cod)) { ImageButton edit = new ImageButton(); edit.ImageUrl = "~/Imagenes/edit.png"; edit.CommandName = ofertas[i].Id; edit.PostBackUrl = "~/Paginas/editar_oferta.aspx?tipo=2&ofe=" + ofertas[i].Id; celda5.Controls.AddAt(0, edit); HyperLink link_eli = new HyperLink(); link_eli.Text = "<a href=\"ejemplo.htm\" target=\"_blank\" onClick=\"window.open('/Paginas/mensaje_eliminar.aspx?id=" + ofertas[i].Id + "&op=2', this.target, 'width=250,height=50,left=540,top=200,scrollbars=NO, resizable=NO'); return false;\"><img src=\"/Imagenes/eliminar_btn.png\"></a>"; celda6.Controls.AddAt(0,link_eli); } fila1.Cells.Add(celda5); fila1.Cells.Add(celda6); Table1.Rows.Add(fila1); } }
protected override void InitializeControls(DataControlFieldCell cell, DataControlCellType cellType, DataControlRowState rowState, int rowIndex) { button = new ImageButton { ImageUrl = "", CommandName = CommandName }; button.SetId(ChildId); if (Click != null) button.Click += Click; cell.Controls.Add(button); }
protected void Page_Load(object sender, EventArgs e) { //When using the HttpWebRequest to POST form data using HTTP 1.1, //it ALWAYS adds the following HTTP header "Expect: 100-Continue". //Fixing the problem set it to false. ServicePointManager.Expect100Continue = false; //intialaize objects proxy = new ExtentrixWebServicesForCPS(); credentials = new Credentials(); //set credentials //these values are according to Citrix testdrive presentation server //that Extentrix published a web service for it for deloveper to use it //as a test web service. credentials.Password = "******"; credentials.UserName = "******"; credentials.Domain = "testdrive"; //because it is a sample and we will use no encryption methode //so the password will send as a clear text. credentials.PasswordEncryptionMethod = 0; //set the domain type to windows domain credentials.DomainType = 0; // 1) Get all the published applications list by calling GetApplicationsByCredentialsEx web service. // 2) create an ImageButton for each application // 3) Create Image for the application // 4) Add it to the AppList panel. // 5) Set the event handler for each ImageButton, so when clicking it the associated application will run //calling the web service ApplicationItemEx[] items = proxy.GetApplicationsByCredentialsEx(credentials, Request.UserHostName, Request.UserHostAddress, new string[] { "icon", "icon-info" }, new string[] { "all" }, new string[] { "all" }); //loop for each published application for (int i = 0; i < items.Length; i++) { //create the ImageButton System.Web.UI.WebControls.ImageButton app = new System.Web.UI.WebControls.ImageButton(); //set the Image URL to the created image app.ImageUrl = createIcon(items[i].InternalName, items[i].Icon); //set the ToolTip to the name of the published application app.ToolTip = items[i].InternalName; //add the ImageButton to the AppList panel AppList.Controls.Add(app); //set the event handler for the ImageButton. app.Click += new System.Web.UI.ImageClickEventHandler(this.OnApplicationClicked); } }
/// <summary> /// Set the properites of the savebutton for a tab. /// </summary> /// <param name="saveButton"></param> /// <param name="id"></param> private void SetSaveButtonProperties(string id) { //Create a save button from the current datatab. saveButtonData = dataTab.Menu.NewImageButton(); saveButtonData.ID = id; saveButtonData.Click += new ImageClickEventHandler(SaveButton_Click); saveButtonData.AlternateText = "Save"; saveButtonData.ImageUrl = GlobalSettings.Path + "/images/editor/save.gif"; saveButtonData.ValidationGroup = ""; }
// private void DataGridRicerca2_ItemCreated(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e) // { // if((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.EditItem) ||(e.Item.ItemType == ListItemType.AlternatingItem)) // { // TableCell myTableCell; // myTableCell = e.Item.Cells[1]; // ImageButton myIButton = (ImageButton)myTableCell.Controls[1]; // //myIButton.Attributes.Add("onclick","return confirm(\"Sei sicuro di Cancellare l'apparecchiatura?\");"); // myIButton.Attributes.Add("onclick","alert(\"Sei sicuro di Cancellare l'apparecchiatura?\");"); // } // // } private void DataGridRicerca2_ItemCreated(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e) { System.Web.UI.WebControls.ImageButton _img = (System.Web.UI.WebControls.ImageButton)(e.Item.FindControl("Imagebutton3")); if (_img != null) { string numeroRdlC = e.Item.Cells[7].Text.ToString().Trim(); //_img.Attributes.Add("onclick", "return confirm('Sei sicuro di voler eliminare la RdL n°' + numeroRdl + '?');"); _img.Attributes.Add("onclick", "return confirm('Sei sicuro di voler eliminare la RdL n°?');"); } }
public static ImageButton CreateNewImage(string cssClass, string id, string src, string[] attrs, string[] values) { var newImage = new ImageButton { CssClass = cssClass, ID = id, ImageUrl = src }; var c = 0; foreach (var attr in attrs) { newImage.Attributes.Add(attr, values[c++]); } return newImage; }
private void AddCloseImageButton(Panel p) { this.closeImageButton = new ImageButton(); this.closeImageButton.CssClass = this.GetImageButtonCssClass(); this.closeImageButton.ID = "CloseImageButton"; this.closeImageButton.OnClientClick = "window.close();"; this.closeImageButton.ImageUrl = this.Page.ResolveUrl(ConfigurationHelper.GetReportParameter("CloseIcon")); p.Controls.Add(this.closeImageButton); }
protected virtual void AddCalendarButton() { ImageButton child = new ImageButton(); child.ImageUrl = GlobalConfig.ImagesPath + "calendaricon.gif"; child.ImageAlign = ImageAlign.Top; child.Width = Unit.Pixel(18); child.Height = Unit.Pixel(18); child.Click += new ImageClickEventHandler(this.calendarButton_Click); this.Controls.Add(child); }
protected void Page_Load(object sender, EventArgs e) { Guid currentUserID = Guid.Parse(System.Web.Security.Membership.GetUser().ProviderUserKey.ToString()); int whiskyID = int.Parse(Request.QueryString["id"]); freundeTableAdapter freundeTable = new freundeTableAdapter(); pictureTableAdapter pictureTable = new pictureTableAdapter(); DataTable uploadedImages = pictureTable.GetImageByUserAndWhisky(currentUserID,int.Parse(Request.QueryString["id"])); if (uploadedImages.Rows.Count > 0) panUpload.Visible = false; DataTable freePictures = new DataTable(); DataTable freunde = freundeTable.GetFriendsByUserID(currentUserID); DataTable allPictures = pictureTable.GetImagesByWhisky(whiskyID); if (freunde.Rows.Count == 0 || allPictures.Rows.Count == 0) return; // Die veroeffentlichten Bilder der freunde herraussuchen bzw. mit freigabe fuer alle User foreach (DataRow picture in allPictures.Rows) { foreach (DataRow friend in freunde.Rows) { if ( picture["userID"] == friend["freundID"] && ( (int.Parse(picture["allowFriends"].ToString()) == 1 ) || (int.Parse(picture["allowAll"].ToString()) == 1) ) ) freePictures.Rows.Add(picture); } } //Falls noch Bilder anzuzeigen sind... if (freePictures.Rows.Count == 0) { Label noSee = new Label(); noSee.Text = "Hier gibt es nichts zu sehen!"; panImages.Controls.Add(noSee); return; } //Image-Buttons erstellen foreach (DataRow picture in freePictures.Rows) { Panel imgPanel = new Panel(); imgPanel.CssClass = "imgpanel"; ImageButton imgBtnControl = new ImageButton(); imgBtnControl.CssClass = "select"; imgBtnControl.ImageUrl = "ImageHandler.ashx?imgid=" + picture["id"]; imgBtnControl.ImageAlign = ImageAlign.Middle; imgBtnControl.ID = picture["id"].ToString(); imgBtnControl.Click += new ImageClickEventHandler(selectImage_Click); imgPanel.Controls.Add(imgBtnControl); panImages.Controls.Add(imgPanel); } }
public UploadContainer(string content, int id = 0) { Panel pnlLabel = new Panel(); Panel wrapPanel = new Panel(); Panel pnlObject = new Panel(); Label lblDropHere = new Label(); DragNDrop = new Panel(); lblDropHere.Text = "Drop Here OR Click Below"; DragNDrop.CssClass = "drop_zone"; DragNDrop.ID = "drop_zone "+ id.ToString(); DragNDrop.Controls.Add(lblDropHere); DragNDrop.Attributes.Add("ondragover", "handleDragOver(event)"); DragNDrop.Attributes.Add("ondrop", "handleDnDFileSelect(event)"); pnlLabel.CssClass = "DD-label"; pnlObject.CssClass = "DD-buttons"; contentLabel = content; DocClassId = id; Content = new Label(); Content.Text = contentLabel; wrapPanel.CssClass = "wrapPanel"; BrowseButton = new FileUpload(); BrowseButton.Attributes["style"] = "padding: 20px; opacity: 0.0; z-index: 1;"; BrowseButton.Attributes["title"] = "Click to add file"; BrowseImage = new Image(); BrowseImage.ImageUrl = @"Images\DueDiligence\browse.png"; BrowseImage.Attributes["style"] = "z-index: 0; height: 80px; margin-top: -67px;"; SubmitDocs = new ImageButton(); SubmitDocs.ImageUrl = @"Images\DueDiligence\successful_submit.png"; DownloadButton = new ImageButton(); DownloadButton.Attributes.Add("chris", DocClassId.ToString()); DownloadButton.ImageUrl = @"Images\DueDiligence\download.png"; pnlLabel.Controls.Add(Content); wrapPanel.Controls.Add(BrowseButton); wrapPanel.Controls.Add(BrowseImage); DragNDrop.Controls.Add(wrapPanel); pnlObject.Controls.Add(SubmitDocs); pnlObject.Controls.Add(DownloadButton); this.ID = id.ToString(); Controls.Add(pnlLabel); Controls.Add(pnlObject); Controls.Add(DragNDrop); }
private void AddButtonToCell(DataControlFieldCell cell, string commandName, string buttonText, bool causesValidation, string validationGroup, int rowIndex, string imageUrl) { IButtonControl control; IPostBackContainer container = base.Control as IPostBackContainer; bool flag = true; switch (this.ButtonType) { case ButtonType.Button: if ((container == null) || causesValidation) { control = new Button(); } else { control = new DataControlButton(container); flag = false; } break; case ButtonType.Link: if ((container == null) || causesValidation) { control = new DataControlLinkButton(null); } else { control = new DataControlLinkButton(container); flag = false; } break; default: if ((container != null) && !causesValidation) { control = new DataControlImageButton(container); flag = false; } else { control = new ImageButton(); } ((ImageButton) control).ImageUrl = imageUrl; break; } control.Text = buttonText; control.CommandName = commandName; control.CommandArgument = rowIndex.ToString(CultureInfo.InvariantCulture); if (flag) { control.CausesValidation = causesValidation; } control.ValidationGroup = validationGroup; cell.Controls.Add((WebControl) control); }
private void AssignGodBorder(System.Web.UI.WebControls.ImageButton pictureBox) { if (_god.godType == GodType.Guardian || _god.godType == GodType.Mage) { pictureBox.ImageUrl = "~/Resources/DankFrameBlue.png"; } else { pictureBox.ImageUrl = "~/Resources/DankFrameRed.png"; } }
private void AddExcelImageButton(Panel p) { this.excelImageButton = new ImageButton(); this.excelImageButton.ID = "ExcelImageButton"; this.excelImageButton.CssClass = this.GetImageButtonCssClass(); this.excelImageButton.ImageUrl = this.Page.ResolveUrl(ConfigurationHelper.GetReportParameter("ExcelIcon")); this.excelImageButton.Click += this.ExcelImageButton_Click; this.excelImageButton.OnClientClick = this.GetReportHtmlScript(); p.Controls.Add(this.excelImageButton); }
public static void RegistraScriptExcluirGrid(System.Web.UI.Page aPage, System.Web.UI.WebControls.ImageButton ImgBttnExcluir, System.String Msg) { System.String jsScript = "<script language=JavaScript> \n" + "function confirmDelete() {\n\n" + " return confirm ('" + Msg + "')\n" + "}\n" + "</script>"; aPage.ClientScript.RegisterClientScriptBlock(aPage.GetType(), "Excluir", jsScript); ImgBttnExcluir.Attributes.Add("onclick", "return confirmDelete();"); }
private void DeleteEventHandler(object sender) { GridViewRow objGridViewRow; GridView objGridView; SPList objSPList; int objSelectedRowIndex; string objSelectedRow = string.Empty; Guid objSelectedRowID; Label lblGUID; SPEventReceiverDefinitionCollection eventReceivers; if (listId != null) { objSPList = SPContext.Current.Web.Lists[new Guid(listId)]; eventReceivers = objSPList.EventReceivers; } else { eventReceivers = SPContext.Current.Web.EventReceivers; } System.Web.UI.WebControls.ImageButton objImage = (System.Web.UI.WebControls.ImageButton)sender; objGridViewRow = (GridViewRow)objImage.NamingContainer; objGridView = (GridView)objGridViewRow.Parent.NamingContainer; objSelectedRowIndex = objGridViewRow.RowIndex; objSelectedRow = objGridViewRow.Cells[0].Text; lblGUID = (Label)objGridViewRow.Cells[5].FindControl(GlobalConstants.LBLGUID); objSelectedRowID = new Guid(lblGUID.Text); eventReceivers[objSelectedRowID].Delete(); if (listId != null) { objSPList = SPContext.Current.Web.Lists[new Guid(listId)]; BindGrid(objSPList.EventReceivers); } else { using (SPSite objSPsite = new SPSite(SPContext.Current.Site.Url)) { using (SPWeb objWeb = objSPsite.OpenWeb()) { eventReceivers = objWeb.EventReceivers; } } BindGrid(eventReceivers); } }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); try { foreach (ModuleAction action in Actions) { if (action.CommandName == ModuleActionType.PrintModule) { if (action.Visible) { if ((PortalSettings.UserMode == PortalSettings.Mode.Edit) || (action.Secure == SecurityAccessLevel.Anonymous || action.Secure == SecurityAccessLevel.View)) { if (ModuleContext.Configuration.DisplayPrint) { var ModuleActionIcon = new ImageButton(); if (!String.IsNullOrEmpty(PrintIcon)) { ModuleActionIcon.ImageUrl = ModuleContext.Configuration.ContainerPath.Substring(0, ModuleContext.Configuration.ContainerPath.LastIndexOf("/") + 1) + PrintIcon; } else { ModuleActionIcon.ImageUrl = "~/images/" + action.Icon; } ModuleActionIcon.ToolTip = action.Title; ModuleActionIcon.ID = "ico" + action.ID; ModuleActionIcon.CausesValidation = false; ModuleActionIcon.Click += IconAction_Click; Controls.Add(ModuleActionIcon); } } } } } //set visibility if (Controls.Count > 0) { Visible = true; } else { Visible = false; } } catch (Exception exc) //Module failed to load { Exceptions.ProcessModuleLoadException(this, exc); } }
public override void InitializeCell(System.Web.UI.WebControls.TableCell cell, int index, CartGridItem item) { base.InitializeCell (cell, index, item); if (item.ItemType == ListItemType.Item) { ImageButton button = new ImageButton(); button.CommandName = "Delete"; button.CommandArgument = item.Item.Id.ToString(); button.Command += new CommandEventHandler(button_Command); button.ImageUrl = this.Src; cell.Controls.Add(button); } }
protected override void CreateChildControls() { //Create button imageButton = new ImageButton(); imageButton.ID = "facebookImageButton"; imageButton.Width = Unit.Pixel(200); imageButton.Height = Unit.Pixel(37); imageButton.Click += new ImageClickEventHandler(imageButton_Click); imageButton.ImageUrl = Page.ClientScript.GetWebResourceUrl(this.GetType(), "GLFToolboxASP.images.facebook_bred.png"); //Add child controls to CustomCalendar control this.Controls.Add(imageButton); }
protected override void AttachChildControls() { this.txtOrderId = (System.Web.UI.WebControls.TextBox) this.FindControl("txtOrderId"); this.imgbtnSearch = (System.Web.UI.WebControls.ImageButton) this.FindControl("imgbtnSearch"); this.listReplace = (Common_OrderManage_ReplaceApply)this.FindControl("Common_OrderManage_ReplaceApply"); this.ddlHandleStatus = (System.Web.UI.WebControls.DropDownList) this.FindControl("ddlHandleStatus"); this.pager = (Pager)this.FindControl("pager"); this.imgbtnSearch.Click += new System.Web.UI.ImageClickEventHandler(this.imgbtnSearch_Click); if (!this.Page.IsPostBack) { this.BindRefund(); } }
protected override void AttachChildControls() { this.txtOrderId = (System.Web.UI.HtmlControls.HtmlInputText) this.FindControl("txtOrderId"); this.imgbtnSearch = (System.Web.UI.WebControls.ImageButton) this.FindControl("imgbtnSearch"); this.RefundList = (Common_OrderManage_RefundApply)this.FindControl("Common_OrderManage_RefundApply"); this.handleStatus = (System.Web.UI.HtmlControls.HtmlSelect) this.FindControl("handleStatus"); this.pager = (Pager)this.FindControl("pager"); this.imgbtnSearch.Click += new System.Web.UI.ImageClickEventHandler(this.imgbtnSearch_Click); if (!this.Page.IsPostBack) { this.BindRefund(); } }
protected void distanceGridView_RowDataBound(object sender, GridViewRowEventArgs e) { e.Row.Cells[0].Visible = false; e.Row.Cells[1].Visible = false; e.Row.Cells[2].Visible = false; e.Row.Cells[3].Visible = false; TableCell distanceCell = new TableCell(); TableCell nameCell = new TableCell(); TableCell imageCell = new TableCell(); TableCell cityCell = new TableCell(); e.Row.Cells.Add(distanceCell); e.Row.Cells.Add(nameCell); e.Row.Cells.Add(imageCell); e.Row.Cells.Add(cityCell); e.Row.Height = 56; e.Row.Cells[4].Width = 45; e.Row.Cells[5].Width = 130; e.Row.Cells[6].Width = 320; if (e.Row.RowType == DataControlRowType.Header) { e.Row.Height = 0; e.Row.Font.Bold = true; e.Row.Cells[6].Text = "Entfernung"; //Entfernung e.Row.Cells[5].Text = ""; //Name e.Row.Cells[4].Text = ""; //Bild e.Row.Cells[7].Text = ""; //Stadt } if (e.Row.RowType == DataControlRowType.DataRow) { Mitglied mitglied = Datareader.getMitgliedByID(Int64.Parse(e.Row.Cells[2].Text)); e.Row.Cells[5].Text = mitglied.mitgliedVorname + System.Environment.NewLine + mitglied.mitgliedNachname; e.Row.Cells[6].Text = e.Row.Cells[3].Text + " km"; e.Row.Cells[7].Text = Datareader.getStadtByID(mitglied.stadtID).stadtName; ImageButton goProfileButton = new ImageButton(); goProfileButton.Enabled = true; goProfileButton.ID = mitglied.mitgliedID.ToString(); goProfileButton.Visible = true; //goProfileButton.ImageUrl = "Images/Template_redaccent/ButtonZumProfilNormal.png"; goProfileButton.ImageUrl = "images.aspx?ImageID=" + mitglied.mitgliedID.ToString(); goProfileButton.Width = 35; goProfileButton.Height = 50; goProfileButton.Click += new ImageClickEventHandler(directToProfileNew); e.Row.Cells[4].Controls.Add(goProfileButton); } }
private void FillPage() { if (!String.IsNullOrWhiteSpace(Request.QueryString["id"])) { int id = Convert.ToInt32(Request.QueryString["id"]); ProductModel productModel = new ProductModel(); List<Product> products = productModel.GetProductsByType(id); if (products != null) { foreach (Product product in products) { Panel productPanel = new Panel(); ImageButton imageButton = new ImageButton(); Label lblName = new Label(); Label lblPrice = new Label(); Label lblShortDescription = new Label(); imageButton.ImageUrl = "~/Images/Products/" + product.Image; imageButton.CssClass = "ProductImage"; imageButton.PostBackUrl = "~/Pages/ProductPage.aspx?id=" + product.Id; lblName.Text = product.Name; lblName.CssClass = "ProductName"; lblPrice.Text = product.Price + " kr "; lblPrice.CssClass = "ProductPrice"; lblShortDescription.Text = product.ShortDescription; productPanel.Controls.Add(imageButton); productPanel.Controls.Add(new Literal { Text = "<br />" }); productPanel.Controls.Add(lblName); productPanel.Controls.Add(new Literal { Text = "<br />" }); productPanel.Controls.Add(lblPrice); productPanel.Controls.Add(new Literal { Text = "<br />" }); productPanel.Controls.Add(lblShortDescription); PanelProduct.Controls.Add(productPanel); } } } else { //If no products... PanelProduct.Controls.Add(new Literal { Text = "No Products found" }); } }
protected override void AttachChildControls() { this.txtOrderId = (System.Web.UI.HtmlControls.HtmlInputText) this.FindControl("txtOrderId"); this.imgbtnSearch = (System.Web.UI.WebControls.ImageButton) this.FindControl("imgbtnSearch"); this.listOrders = (Common_OrderRecycleBin_OrderList)this.FindControl("common_orderrecyclebin_orderlist"); this.listOrders.ItemDataBound += new Common_OrderRecycleBin_OrderList.DataBindEventHandler(this.listOrders_ItemDataBound); this.listOrders.ItemCommand += new Common_OrderRecycleBin_OrderList.CommandEventHandler(this.listOrders_ItemCommand); this.pager = (Pager)this.FindControl("pager"); this.imgbtnSearch.Click += new System.Web.UI.ImageClickEventHandler(this.imgbtnSearch_Click); if (!this.Page.IsPostBack) { this.BindOrders(); } }
protected override void CreateChildControls() { // Setup the controls on the page. btnImage = new System.Web.UI.WebControls.ImageButton(); btnDisableImage = new System.Web.UI.WebControls.Image(); btnDisableImage.ImageUrl = DisableImageURLFromViewState; btnDisableImage.Visible = false; // Setup the events on the page. btnImage.Click += new ImageClickEventHandler(this.OnBtnImage_Click); Controls.Add(btnImage); Controls.Add(btnDisableImage); }
/// <summary> /// Overrides <see cref="Control.CreateChildControls"/>. /// </summary> protected override void CreateChildControls() { base.CreateChildControls(); button = new System.Web.UI.WebControls.ImageButton(); button.CausesValidation = false; button.ID = "clicker"; button.Click += new System.Web.UI.ImageClickEventHandler(this.button_Click); this.Controls.Add(button); tracker = new HtmlInputHidden(); tracker.Name = "tracker"; tracker.ID = "tracker"; tracker.ServerChange += new EventHandler(this.ClientExpanedStateChanged); this.Controls.Add(tracker); }
protected override void AttachChildControls() { this.coupons = (Common_Coupon_CouponList)this.FindControl("Common_Coupons_CouponsList"); this.txtCoupon = (System.Web.UI.WebControls.TextBox) this.FindControl("txtCoupon"); this.status = (SmallStatusMessage)this.FindControl("status"); this.btnAddCoupon = ButtonManager.Create(this.FindControl("btnAddCoupon")); this.selectCouponStatus = (System.Web.UI.HtmlControls.HtmlSelect) this.FindControl("selectCouponStatus"); this.imgbtnSearch = (System.Web.UI.WebControls.ImageButton) this.FindControl("imgbtnSearch"); this.pager = (Pager)this.FindControl("pager"); this.btnAddCoupon.Click += new System.EventHandler(this.btnAddCoupon_Click); this.imgbtnSearch.Click += new System.Web.UI.ImageClickEventHandler(this.imgbtnSearch_Click); new System.Web.UI.WebControls.HyperLink(); if (!this.Page.IsPostBack) { this.BindCoupons(); } }
private void DataGrid2_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { //Label lbl=new Label(); System.Web.UI.WebControls.ImageButton lk = (ImageButton)e.Item.Cells[9].FindControl("btScarica"); if (DataBinder.Eval(e.Item.DataItem, "filename") != System.DBNull.Value) { lk.Visible = true; } else { lk.Visible = false; } } }
private void OnApplicationClicked(object sender, System.EventArgs e) { // Get the event source object. System.Web.UI.WebControls.ImageButton app = (System.Web.UI.WebControls.ImageButton)sender; ServicePointManager.Expect100Continue = false; //Get the ICA file content by calling LaunchApplication web service. string ica = proxy.LaunchApplication(app.ToolTip, credentials, Request.UserHostName, Request.UserHostAddress); //Set the response content type to "application/x-ica" to run the ICA file. Response.ContentType = "application/x-ica"; //Run the application by writing the ICA file content to the response. Response.BinaryWrite(Response.ContentEncoding.GetBytes(ica)); Response.End(); }
protected void dlRenties_ItemDataBound(object sender, DataListItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { System.Web.UI.WebControls.ImageButton img = e.Item.FindControl("imgRead") as System.Web.UI.WebControls.ImageButton; ImageButton imgDel = e.Item.FindControl("imgDel") as ImageButton; TextBox txtName = e.Item.FindControl("txtName") as TextBox; TextBox txtIdCard = e.Item.FindControl("txtIdCard") as TextBox; img.Attributes.Add("onClick", "javascript:ReadCardByDesc(\'" + txtName.ClientID + "','" + txtIdCard.ClientID + "\');"); if (!string.IsNullOrEmpty(RRAID)) { img.Visible = false; imgDel.Visible = false; } } }
protected override void AttachChildControls() { this.favorites = (ThemedTemplatedRepeater)this.FindControl("rptFavorites"); this.favoritesTags = (ThemedTemplatedRepeater)this.FindControl("rptFavoritesTags"); this.btnSearch = (System.Web.UI.WebControls.ImageButton) this.FindControl("imgbtnSearch"); this.txtKeyWord = (System.Web.UI.WebControls.TextBox) this.FindControl("txtKeyWord"); this.pager = (Pager)this.FindControl("pager"); this.btnDeleteSelect = (System.Web.UI.WebControls.LinkButton) this.FindControl("btnDeleteSelect"); this.btnSearch.Click += new System.Web.UI.ImageClickEventHandler(this.btnSearch_Click); this.btnDeleteSelect.Click += new System.EventHandler(this.btnDeleteSelect_Click); PageTitle.AddSiteNameTitle("商品收藏夹"); if (!this.Page.IsPostBack) { this.BindList(); this.BindFavoritesTags(); } }
protected void dl_Clanci_ItemDataBound(object sender, DataListItemEventArgs e) { int id = (int)DataBinder.Eval(e.Item.DataItem, "id"); using (TriglavBL temp = new TriglavBL()) { List <Posts_Tags> listaPostsTags = temp.getPost_TagsByPostID(id); List <Tag> listaTagova = new List <Tag>(); foreach (var pt in listaPostsTags) { listaTagova.Add(temp.getTagByID(Convert.ToInt32(pt.TagID))); } DataList dl_Tags = (DataList)e.Item.FindControl("dl_Tagovi"); dl_Tags.DataSource = listaTagova; dl_Tags.DataBind(); // img_Clanak_Photo Post p = temp.getPostByID(id); Data.EntityFramework.DAL.Korisnik k = temp.getKorisnikByID(p.VlasnikID.Value); System.Web.UI.WebControls.ImageButton img_User = (System.Web.UI.WebControls.ImageButton)e.Item.FindControl("img_User"); img_User.ImageUrl = k.SlikaURL; img_User.PostBackUrl = "/Public/Home.aspx?KorisnikID=" + p.VlasnikID.Value; System.Web.UI.WebControls.Image img_Clanak_Photo = (System.Web.UI.WebControls.Image)e.Item.FindControl("img_Clanak_Photo"); img_Clanak_Photo.ImageUrl = p.SlikaURL; Label reputacija = (Label)e.Item.FindControl("lbl_Reputacija"); reputacija.Text = "Reputacija: " + k.Reputacija; PodKategorija pk = temp.getPodKategorijaByID(p.PodKategorija.Value); LinkButton lb_oPodKategorija = (LinkButton)e.Item.FindControl("lb_oPodKategorija"); lb_oPodKategorija.Text = pk.Naslov; lb_oPodKategorija.PostBackUrl = "/Public/QA_Pitanja.aspx?PodKategorijaID=" + pk.id; LinkButton lb_oKategorija = (LinkButton)e.Item.FindControl("lb_oKategorija"); lb_oKategorija.Text = temp.getKategorijaByID(pk.KategorijaID.Value).Naslov; lb_oKategorija.PostBackUrl = "/Public/QA_Pitanja.aspx?KategorijaID=" + temp.getKategorijaByID(pk.KategorijaID.Value).id; } }
public void BindData() { SqlConnection Conn = new SqlConnection(s); SqlCommand Cmd = new SqlCommand("SELECT ciftci.kod, ciftci.ad, ciftci.soyad, ciftci.cep_tel,ciftci.ev_tel, adres_il.ad as adres, giris_bilgileri.aktifpasif as ap, giris_bilgileri.email FROM ciftci INNER JOIN adres_il on (ciftci.adres_il=adres_il.kod) INNER JOIN giris_bilgileri on giris_bilgileri.kod=ciftci.kod", Conn); SqlDataAdapter DA = new SqlDataAdapter(Cmd); DataSet DS = new DataSet(); DA.Fill(DS, "ciftci"); Conn.Open(); Cmd.ExecuteNonQuery(); GridView1.DataSource = DS; GridView1.DataBind(); Conn.Close(); Label13.Visible = false; if (GridView1.Rows.Count == 0) { Button1.Visible = false; Label13.Visible = true; } foreach (GridViewRow dg in GridView1.Rows) { //for (int i = 0; i < GridView1.Rows.Count; i++ ) // Response.Write("<script>alert('"+dg.Cells.Equals("id").ToString();"'); </script>"); System.Web.UI.WebControls.ImageButton id = (System.Web.UI.WebControls.ImageButton)GridView1.Rows[dg.RowIndex].FindControl("ap"); int m_id = Int32.Parse(id.AlternateText); if (m_id == 0) { id.ImageUrl = "~/image/pasive.ico"; GridView1.Rows[dg.RowIndex].BackColor = System.Drawing.Color.Aqua; } else { //GridView1.Rows[dg.RowIndex].Cells.Equals("okundu"); id.ImageUrl = "~/image/active.ico"; } } if (GridView1.Rows.Count == 0) { Label12.Text = "Sisteme kayıtlı çiftçi yok."; } }
/**//// <summary> /// Add the javascript method showModalDialog to button /// </summary> /// <param name="button">The control, must be a link button</param> /// <param name="strUrl">The page url, including query string</param> /// <param name="intWidth">Width of window</param> /// <param name="intHeight">Height of window</param> public static void AddShowDialog(System.Web.UI.WebControls.LinkButton button, string strUrl, int intWidth, int intHeight) { string strScript = ""; strScript += "var strFeatures = 'dialogWidth=" + intWidth.ToString() + "px;dialogHeight=" + intHeight.ToString() + "px;center=yes;help=no;status=no';"; strScript += "var strName ='';"; if (strUrl.Substring(0, 1) == "/") { strUrl = strUrl.Substring(1, strUrl.Length - 1); } strUrl = BaseUrl + "DialogFrame.aspx?URL=" + strUrl; strScript += "window.showModalDialog(\'" + strUrl + "\',strName,strFeatures);return false;"; button.Attributes.Add("onClick", strScript); } #endregion #region AddShowDialog /**//// <summary> /// Add the javascript method showModalDialog to button /// </summary> /// <param name="button">The control, must be a button</param> /// <param name="strUrl">The page url, including query string</param> /// <param name="intWidth">Width of window</param> /// <param name="intHeight">Height of window</param> public static void AddShowDialog(System.Web.UI.WebControls.ImageButton button, string strUrl, int intWidth, int intHeight) { string strScript = ""; strScript += "var strFeatures = 'dialogWidth=" + intWidth.ToString() + "px;dialogHeight=" + intHeight.ToString() + "px;center=yes;help=no;status=no';"; strScript += "var strName ='';"; if (strUrl.Substring(0, 1) == "/") { strUrl = strUrl.Substring(1, strUrl.Length - 1); } strUrl = BaseUrl + "DialogFrame.aspx?URL=" + strUrl; strScript += "window.showModalDialog(\'" + strUrl + "\',window,strFeatures);return false;"; button.Attributes.Add("onClick", strScript); }
protected void grid_RowDataBound(object sender, DataListItemEventArgs e) { /* Cargo los atributos para usar con jquery para cargar las subgrillas*/ // Reviso si estoy en el detalle de items if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { //Estoy en el detalle de items. Busco los controles a configurar System.Web.UI.WebControls.ImageButton btnSeleccionar = (System.Web.UI.WebControls.ImageButton)e.Item.FindControl("botonAgencia"); System.Web.UI.WebControls.Panel pnlMostrar = (System.Web.UI.WebControls.Panel)e.Item.FindControl("panelAgencias"); // Configuro los controles btnSeleccionar.Attributes.Add("data-OrdenA", ((System.Data.DataRowView)(e.Item.DataItem))[0].ToString()); btnSeleccionar.Attributes.Add("data-PanelA", pnlMostrar.ClientID); btnSeleccionar.Attributes.Add("data-DatosCargadosA", "0"); btnSeleccionar.Attributes.Add("data-ExpandidoA", "0"); btnSeleccionar.Attributes.Add("data-BotonA", btnSeleccionar.ClientID); } }
//Create Link Button in grid view to open excel protected void gvResults_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.DataItem != null) { string INSTANCE_NAME = TextBoxSource.Text; string CATALOG_NAME = e.Row.Cells[1].Text; string CUBE_NAME = e.Row.Cells[3].Text; //below code is not used as a hyperlink is used for ODC file, we can also use a imagebutton to do run a client function var FormLink = new System.Web.UI.WebControls.ImageButton(); FormLink.ImageUrl = "img/xl.png"; FormLink.Width = 25; FormLink.Height = 25; //pass control to Javascript function ExcelLoad with cube parameters FormLink.OnClientClick = "ExcelLoad(\"" + INSTANCE_NAME.Replace("\\", "\\\\") + "\",\"" + CATALOG_NAME + "\",\"" + CUBE_NAME + "\"); return false;"; e.Row.Cells[0].Controls.Add(FormLink); } }
protected override void AttachChildControls() { this.batchbuys = (Common_BatchBuy_ProductList)this.FindControl("Common_BatchBuy_ProductList"); this.btnBatchBuy = ButtonManager.Create(this.FindControl("btnBatchBuy")); this.imgbtnSearch = (System.Web.UI.WebControls.ImageButton) this.FindControl("imgbtnSearch"); this.dropBrandCategories = (BrandCategoriesDropDownList)this.FindControl("dropBrandCategories"); this.ddlCategories = (Common_CategoriesDropDownList)this.FindControl("ddlCategories"); this.pager = (Pager)this.FindControl("pager"); this.txtProductName = (System.Web.UI.WebControls.TextBox) this.FindControl("txtProductName"); this.btnBatchBuy.Click += new System.EventHandler(this.btnBatchBuy_Click); this.imgbtnSearch.Click += new System.Web.UI.ImageClickEventHandler(this.imgbtnSearch_Click); this.batchbuys.ItemDataBound += new Common_BatchBuy_ProductList.ItemEventHandler(this.batchbuys_ItemDataBound); if (!this.Page.IsPostBack) { this.dropBrandCategories.DataBind(); this.ddlCategories.DataBind(); this.BindProducts(); } }