CharlieDev
asked on
c#,asp.net-passing data to a control
Hi,
I am trying to pass data to a control from an aspx page.
On the aspx page I have:
<div class="polaroid01">
<HatPhotoControl:HatPic HatID='<%# GetRandomImageURL()%>' runat="server" />
</div>
GetRandomImageURL returns a guid for the HatID
The control page has:
private Guid HatID;
public string hatID
{
get { return HatID.ToString(); }
set { HatID = new Guid(value); }
}
But the guid isnt being transfered
Anyone see why?
Thanks
I am trying to pass data to a control from an aspx page.
On the aspx page I have:
<div class="polaroid01">
<HatPhotoControl:HatPic HatID='<%# GetRandomImageURL()%>' runat="server" />
</div>
GetRandomImageURL returns a guid for the HatID
The control page has:
private Guid HatID;
public string hatID
{
get { return HatID.ToString(); }
set { HatID = new Guid(value); }
}
But the guid isnt being transfered
Anyone see why?
Thanks
ASKER
I can see that the hatID in the aspx page is being assigned the correct guid! It wont transfer over to the control though!
based on what you posted, I see case sensativity issue, try
<HatPhotoControl:HatPic hatID='<%# GetRandomImageURL()%>' runat="server" />
hatID starts lower case as the public property
<HatPhotoControl:HatPic hatID='<%# GetRandomImageURL()%>' runat="server" />
hatID starts lower case as the public property
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks
Hardcode a server side property/variable value and check whether it is working from aspx page or not.