Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
BOOK: ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solutio
This is the forum to discuss the Wrox book ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solution by Vincent Varallo; ISBN: 9780470396865
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solutio section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 5th, 2009, 01:27 AM
ocn ocn is offline
Authorized User
 
Join Date: Jun 2009
Posts: 15
Thanks: 5
Thanked 0 Times in 0 Posts
Default Implementation of Presentation Layer. Please Help!

I would like to use standard ASP.NET controls like Gridview, Textbox, etc. rather the custom girdview mentioned in the book in Chapter 4. How would I invoke methods directly from BLL and DAL classes to get data listed on the standard gridview? In other words, if I don't want to use BasePage and BaseEditPage, is there a direct way to invoke entities in the codes behind of aspx pages? If so, please show me an example or sample.

I want to do something in Page_load method like:

ENTUserAccountEO userAccount = new ENTUserAccount();

txtWindowsAccount.Text = userAccount.WindowsAccountName

.....

I truly appreciate your help.
  #2 (permalink)  
Old November 6th, 2009, 12:43 PM
Authorized User
 
Join Date: Mar 2009
Posts: 79
Thanks: 4
Thanked 4 Times in 4 Posts
Default

You would still need to inherit from the BasePage. Doing so will not prevent you from using a standard control.

Follow the standard pattern presented in the book and instead of invoking the cgv that is there add your gridview from the toolbox and build it in codebehind.
Since you are not binding anything to the cgv it will never populate with data and it shouldnt render either.

Let me know if this helps or if you need further help.
The Following User Says Thank You to ZeroFactorial For This Useful Post:
ocn (November 8th, 2009)
  #3 (permalink)  
Old November 8th, 2009, 03:53 PM
ocn ocn is offline
Authorized User
 
Join Date: Jun 2009
Posts: 15
Thanks: 5
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by ZeroFactorial View Post
You would still need to inherit from the BasePage. Doing so will not prevent you from using a standard control.

Follow the standard pattern presented in the book and instead of invoking the cgv that is there add your gridview from the toolbox and build it in codebehind.
Since you are not binding anything to the cgv it will never populate with data and it shouldnt render either.

Let me know if this helps or if you need further help.
Thank you for your reply!

Could you please clarify further for me? I follow the the standard pattern, but I can't get it working. I have a user table, and I want to get the list of users shown on the standard gridview. My code is below.

public partial class test : BasePage
{
protected void Page_Load(object sender, EventArgs e)
{

tblUserEOList myUser = new tblUserEOList();
gvUserList.DataSource = myUser.LoadData();
gvUserList.DataBind();

}
}

I received an error "cannot implicitly convert type void to object" at the line gvUserList.DataSource = myUser.LoadData().

I don't quite understand how I can invoke methods from BLL directly in UI layer using standard ASP.NET controls. Should I need to implement the LoadScreenFromObject and LoadObjectFromScreen methods? Chapter 4 is little difficult to follow.

Thanks for your help in advance.
  #4 (permalink)  
Old November 9th, 2009, 09:09 PM
Wrox Author
 
Join Date: Jan 2009
Posts: 73
Thanks: 0
Thanked 7 Times in 7 Posts
Default

The LoadData method returns void. You should call the LoadData() method on a separate line and then set the gvUserList.DataSource = myUser.
The Following User Says Thank You to varallov For This Useful Post:
ocn (November 12th, 2009)
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Handle error from database layer to applican layer khatu_jec ASP.NET 2.0 Basics 1 November 9th, 2008 03:51 PM
parent child presentation db96s1 Beginning PHP 0 February 7th, 2006 06:19 PM
create presentation package moha General .NET 0 January 29th, 2006 04:46 AM
Presentation Database fs22 Classic ASP Basics 2 June 25th, 2004 12:53 AM
SSL(Secured Socket Layer)Implementation in ASP hrishimusale Classic ASP Professional 0 November 12th, 2003 01:35 AM



All times are GMT -4. The time now is 01:50 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.