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 6087393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:51:56+00:00 2026-05-23T11:51:56+00:00

The 2 options are: use parameters in aspx files or bind through code-behind. Which

  • 0

The 2 options are: use parameters in aspx files or bind through code-behind. Which is better and why?

  • 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-23T11:51:56+00:00Added an answer on May 23, 2026 at 11:51 am

    I recommend using ObjectDataSource because it leads to a cleaner architecture and is much easier to deal with events, e.g., sorting and paging. Otherwise, your control must specifically handle such events, which I find to be a pain in the neck. I always create a business tier and have my Get() methods use signatures like those shown below. My model for this kind of design comes from this book, which I think is a great Web Forms resource:

    http://www.amazon.com/ASP-NET-2-0-Website-Programming-Programmer/dp/0764584642

    In the app_code / business tier:

    public class ProductRepository
    {
      public List<Product> GetAll(/* params here */ string sortOrder, string orderBy, int startRowIndex, int maximumRows)
      {
          // call data access tier for Product entities
      }
    
      public int GetAllCount(/* params here */ )
      {
          // call data access tier for count of Product entities
      }
    }
    

    In the Web Form:

    <asp:ObjectDataSource ID="objProduct" runat="server"
      TypeName="MyNameSpace.BLL.ProductRepository"
      SelectMethod="GetAll"
      EnablePaging="true" 
      SortParameterName="sortOrder"
      SelectCountMethod="GetAllCount"  />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For a personnal page I use the MultiViews options in Apache to determine which
I'm trying to use this sample code from Microsoft to determine what encoder options
I am trying to use the following code to convert a hash of options
I have been trying to use jqgrids, default CRUD options. Below is my code:
I can see some options available: 1) Use PEAR's POP3 class --> tried it,
What compiler (I'm using gcj 4.x) options should I use to generate an exe
How do I use the jQuery Datepicker with a textbox input: $(#my_txtbox).datepicker({ // options
I'm looking for Java rules engine options that will allow me to use the
I use GLib to parse some command-line options. The problem is that I want
I have a report in SSRS and one of the parameters I use is

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.