Thanks for the post.
The trouble is accessing the user control once it is in a seperate
project. I can reference it ok, but at run-time the control within
the user control do not exist.
Thanks,
Jen
> Thanks for the post.
> The trouble is accessing the user control once it is in a seperate
[quoted text clipped - 3 lines]
> Thanks,
> Jen
Do you mean that you have multiple controls within your usercontrol?
If so you must provide the method of accessing the controls. This can be
done with functions or readonly properties.
Hope this helps
Lloyd Sheen
Jenni.Haughton@googlemail.com - 11 Jun 2007 14:12 GMT
> Do you mean that you have multiple controls within your usercontrol?
>
> If so you must provide the method of accessing the controls. This can be
> done with functions or readonly properties.
I have form objects such as labels and text boxes in the user control
which I need to access. Here is my code -
HTML in user control -
<asp:image Height="33" AlternateText="Powered by WorldPay" Width="139"
ImageAlign="AbsMiddle" Runat="server" ID="imageWorldPay"></asp:image>
Code that gives the error in the code behind of the UC -
imageWorldPay.ImageUrl = "~/images/poweredbyworldpay.gif";
Code in the other project which loads the uc -
protected System.Web.UI.Control pricegridcontrol;
pricegridcontrol = new
LumleyJacobsSharedLibrary.controls.BuyingProcessPriceGrid();
wlnav_pricegrid.Controls.Add(pricegridcontrol);
The code in the user control to set the ImageUrl does not work because
the label does not seem to exist. Is this a;ways the case when
dynamically adding user controls, or is there another way?
Thanks,
Jen