|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
referencing a control in a webform that uses master pageImage img = new Image(); img = (Image) FormView1.Controls[0].NamingContainer.FindControl("Image1"); if (img.ImageUrl.Length < 20) img.ImageUrl = "images/unavailable.jpg"; The page uses a master page with ContentPlaceHolder1 in which I have placed FormView1. FormView1.Controls[0].NamingContainer.UniqueID returns ctl00$ContentPlaceHolder1.$FormView1 this works fine until placed on the production server at which point it barfs with: Object reference not set to an instance of an object. what would cause this? Maybe the code being in the page_load event? Perhaps it should be moved to another event? I did try the same code in the Formview1.PreRender event as well.....same results Thanks, Mike
How to know the selected row in a DataControlField
DetailsView Default Mode Why does OnClick event not work in 2.0 for DataGrid can i assign a name for a control dynamically? UpdatePanel, Postback Customising the CatalogZone class Why doesn't work DataFormatString for GridView.BoundField ? tie ENTER to a button? wrong TreeView node selected Heterogeneous objects and a GridView |
|||||||||||||||||||||||