Good Morning All
I have the following code that find the controls in my page
this Works for buttons i have my form , so i have changed my page and i have added image buttons and i want find them in my page like thisCode:Find Windows Control Control control = null, c = null; foreach (string ctl in Page.Request.Form) { c = Page.FindControl(ctl); if (c is System.Web.UI.WebControls.Button) { control = c; break; } }
This does not work, the image buttons in my page are not found the "control " is always null.Code:Control control = null, c = null; foreach(string ctl in Page.Request.Form) { c = Page.FindControl(ctl); if (c is System.Web.UI.WebControls.ImageButton) { control = c; break; } }
and the above code i have to use it here
Thank youCode:if ((control == null) || ((!(control.ID.Contains("btnApplyToSelected_"))) && (!(control.ID.Contains("btnSaveConstraints_"))))) { lstbxFilter_SelectedIndexChanged(sender, e); loadConstraintsXM(); }




Reply With Quote