The 2 options are: use parameters in aspx files or bind through code-behind. Which is better and why?
The 2 options are: use parameters in aspx files or bind through code-behind. Which
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
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:
In the Web Form: