How do I update a DataList (on a UserControl) on a Master Page from a Content Page

P

pierre

Hi,

I have a DataList inside a UserControl, which I use on a MasterPage.
My ContentPage lists items which a user can add to his/her shopping
basket. Can someone PLEASE let me know how I can "refresh" the
datalist, contained within a usercontrol (which is on the MasterPage),
from the ContentPage.

Thanks in advance,
Pierre
 
K

Kuldeep

Hi Pierre,

Say you have a Label in the Master Page as shown below:

<asp:Label ID="lblHeaderText" runat="server" CssClass="pageHeader"
Text="Label on Master Page"></asp:Label>

Now, on the content page, to work with this "lblHeaderText" on the Content
Page, you can do something like this..
Label lbHeader = (Label)Master.FindControl("lblHeaderText");
lbHeader.Text = "Conent Page Name";

Hope this helps..
Kuldeep
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,989
Messages
2,570,207
Members
46,782
Latest member
ThomasGex

Latest Threads

Top