Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 154881
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T10:03:27+00:00 2026-05-11T10:03:27+00:00

I’m just beinning basic data driven ASP.NET webforms design. I have the first part

  • 0

I’m just beinning basic data driven ASP.NET webforms design. I have the first part of a form working, but I don’t know what to do next.

Please see this screenshot of what I have created so far: http://www.twitpic.com/2gnmr

I need help knowing what kind of HTML element to use in the master list, and what event/trigger on that element to use to fire off the ‘get child records for this selected item’ sequence?

Also, is a ListView even the correct way to present the master list? At this time, I’m not trying to provide any editing features; I’ll get to that later, I guess.

Should I use some other ASP.NET data control rather than hand-coding a listview like I am doing?

I don’t want to see an actual ‘Select’ link item beside each Customer Name (that looks goofy). I want the Customer Name to be the link to click on.

So, you can see in my code below that I have a ListView to present a list of CustomersWithOpenOrders. But, it’s just a static list, so how do I make the Company Name label clickable, and what else will I need to make it fire back to some code-behind to fetch the child records. I already have a code-behind method to get child records for a passed-in CustomerNumber into a DataTable, and I think I would know how to bind that to a grid or listview for child records, but I do not know how to pass the CustomerNumber from the master ListView to the method from the UI form.

<asp:ListView ID='ListView1' runat='server'>     <LayoutTemplate>       <table cellpadding='2' border='0' ID='tbl1' runat='server'>         <tr id='Tr1' runat='server' class='lvHeader'>           <th id='Th1' runat='server'>Customer</th>         </tr>         <tr runat='server' id='itemPlaceholder' />       </table>     </LayoutTemplate>     <ItemTemplate>       <tr id='Tr2' runat='server'>         <td>           <asp:Label ID='label2' class='FirstLine' runat='server' Text='<%# Eval('company') %>' />           <br />           <div class='SecondLine'>             <asp:Label ID='labelCustNo' runat='server' Text='<%# Eval('custno') %>'/>             <asp:Label runat='server' Text='Ph: '></asp:Label>             <asp:Label ID='label3' runat='server' Text='<% # Eval('phone') %>' />           </div>         </td>       </tr>     </ItemTemplate> </asp:ListView> 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T10:03:28+00:00Added an answer on May 11, 2026 at 10:03 am

    I personally haven’t found a case where the ListView can’t solve my needs. If you want to create a customer selection style list you can use a link button for binding.

    <asp:ListView runat='server' id='CustomersList' ItemCommand='CustomersList_ItemCommand'>   <LayoutTemplate>     <table cellpadding='2' border='0' ID='tbl1' runat='server'>       <tr id='Tr1' runat='server' class='lvHeader'>         <th id='Th1' runat='server'>Customer</th>       </tr>       <tr runat='server' id='itemPlaceholder' />     </table>   </LayoutTemplate>   <ItemTemplate>     <tr id='Tr2' runat='server'>       <td>         <asp:LinkButton ID='link1' class='FirstLine' runat='server' Text='<%# Eval('company') %>' CommandName='Select' />         <br />         <div class='SecondLine'>           <asp:Label ID='labelCustNo' runat='server' Text='<%# Eval('custno') %>'/>           <asp:Label runat='server' Text='Ph: '></asp:Label>           <asp:Label ID='label3' runat='server' Text='<% # Eval('phone') %>' />         </div>       </td>     </tr>   </ItemTemplate> </asp:ListView>  <asp:ListView runat='server' ID='OrderList'>   <!-- Child Rows implementation --> </asp:ListView> 

    Then you would need to bind the event to the ListView.ItemCommand.

    protected void CustomersList_ItemCommand(object sender, ListViewCommandEventArgs e) {   if (e.CommandName = 'Select')   {     if (e.Item.ItemType != ListViewItemType.DataItem) return;      var dataItem = e.Item as ListViewDataItem;     if (dataItem == null) return;      var customer = dataItem.DataItem as Customer;     if (customer == null) return;      this.OrdersList.DataSource = GetChildRecords(customer.ID);     this.OrdersList.DataBind();   } } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 105k
  • Answers 105k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You can define verbose_name and verbose_name_plural in your model's inner… May 11, 2026 at 8:40 pm
  • Editorial Team
    Editorial Team added an answer See swftools. Here is an example: $ jpeg2swf -o movie.swf… May 11, 2026 at 8:40 pm
  • Editorial Team
    Editorial Team added an answer What is the actual problem you are having? Referenced assemblies… May 11, 2026 at 8:40 pm

Related Questions

I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I am currently running into a problem where an element is coming back from
Seemingly simple, but I cannot find anything relevant on the web. What is the
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.