Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

asp:repeater

Posted on 2004-10-13
3
Medium Priority
?
841 Views
Last Modified: 2008-02-26
hi.

i have a UserControl i created. for datarow in my dataset i want to display one of these controls on my page. do i want to use a repeater control to do this?  how do i pass a datarow to each of the user controls created?

thx. bg
0
Comment
Question by:BeerGod
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 28

Accepted Solution

by:
mmarinov earned 800 total points
ID: 12305356
Hi BeerGod,

you can use datagrid, repeater or datalist - everything depends on the purpose
all of these controls has an event ItemDataBound (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWebUIWebControlsDataListClassItemDataBoundTopic.asp) which is fired before the current row of the control is shown
so if you use this event  ( and the example of the given url ) you can pass a value from your datarow to the user control

Regards!
B..M
0
 
LVL 2

Expert Comment

by:raed_hasan
ID: 12310736
Inside the ItemTemplate for the Repeater you can add the markup for
your user control.

<ItemTemplate>
    <uc:MyControl runat="server" id="MyControl1"/>
</ItemTemplate>

Catch the Repeater's data binding event to manipulate your user
control in each row:

protected void Repeater1_ItemDataBound(
        object sender,
        RepeaterItemEventArgs e
    )
{
    // get the control
    MyControl c = e.Item.FincControl("MyControl1");
 
    // get the data container
    object o = e.Item.DataItem;

    // get o into c

}

Makeing some sense?
0
 

Author Comment

by:BeerGod
ID: 12313970
thx. that was easy.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question