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

  • SEARCH
  • Home
  • 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 6196307
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:37:12+00:00 2026-05-24T03:37:12+00:00

Just wondering what method professionals choose for a page for viewing data from a

  • 0

Just wondering what method professionals choose for a page for viewing data from a database table in ASP.NET Web Forms, for example a single product details page on an ecommerce website?

Some of the methods I consider are:

  1. Data bound DetailsView;
  2. Data bound FormView;
  3. Lots of label controls assigned values in the code-behind;
  4. Lots of Response.Writes on the markup page (eg. <%= object.field %>); or,
  5. Any other methods???

  6. The code excerpt below is the method I am using at present. Is it bad practice?

Markup…

<asp:Panel ID="panOrder" runat="server">
<table>
    <tr>
        <td>Order Number</td>
        <td><asp:Label ID="lblOrderId" runat="server" Text='<%# Order.orderid %>' /></td>
    </tr>
   <tr>
        <td>Order Date</td>
        <td><asp:Label ID="lblCreationDate" runat="server" Text='<%# Order.creationdate.ToString("dd/MM/yyyy") %>' /></td>
   </tr>
</table>

Code behind…

protected order Order { get; set; }
protected void Page_Load(object sender, EventArgs e)
{
    int orderId = Request.QueryString["orderid"] == null ? 0 : Utilities.IntParse(Request.QueryString["orderid"]);
    Order = order.SelectByOrderId(orderId);
    panOrder.DataBind();
}
  • 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. Editorial Team
    Editorial Team
    2026-05-24T03:37:14+00:00Added an answer on May 24, 2026 at 3:37 am

    It all depends on what you need in specific situation:

    1. use DetailsView if you need simple operations on your data (basic select, update, insert) and your data will be presented in single view in a list (top to bottom)

    2. the same as for DetailsView but keep in mind that with FormView you are more free of how to present your data out of the box (DetailsView need some tweaks to behave the same). You won’t be limited to top to bottom presentation, you can freely choose where on your page some info is presented.

    3. when you have only 2 to 3 databound elements maybe, but when you have more fields I would rather go for one of the above methods. It is easier.

    4. this method in webforms I personally use very rarely. Maybe if you have to redesign some old ASP (any non webforms) page where is a lot of HTML to handle, and is already structured nicely?

    5. using other Data controls too, like Gridview when presenting tabular data for example. Repeater is also another nice control like Muhammad mentioned (I agree it is the most customizable).

    Sorry for so long answer. I was wondering the same question couple of years back too, so I thought it is in place to share this with you. The above helped me a lot when identifying methods to show this or that in webforms.

    To answer your given example: Single products details page will be easiest to achieve with DetailsView or FormView. I would go for the second one.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

just was wondering if there is a way to access a method from my
just wondering if anyone knows of a truly restful Put/delete implementation asp.net mvc preview
how to call an AppDelegate method from RootViewController without passing a delegate? Just wondering
I am just wondering how I can call a method of a service from
I was just wondering what this method does because just from the title it
I'm just wondering which method is the most effective if I'm literally just wanting
So I understand what a static method or field is, I am just wondering
Just wondering if a .NET app can be compiled down to native machine code
Just wondering what the best (fastest execution time) method for translating the following SQL
Just wondering if there is any kind of framework or method of making a

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.