|
|
 |
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 p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

November 5th, 2009, 01:27 AM
|
|
Authorized User
|
|
Join Date: Jun 2009
Posts: 11
Thanks: 5
Thanked 0 Times in 0 Posts
|
|
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.
|

November 6th, 2009, 12:43 PM
|
|
Authorized User
|
|
Join Date: Mar 2009
Posts: 72
Thanks: 4
Thanked 4 Times in 4 Posts
|
|
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:
|
|

November 8th, 2009, 03:53 PM
|
|
Authorized User
|
|
Join Date: Jun 2009
Posts: 11
Thanks: 5
Thanked 0 Times in 0 Posts
|
|
Quote:
Originally Posted by ZeroFactorial
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.
|

November 9th, 2009, 09:09 PM
|
|
Wrox Author
|
|
Join Date: Jan 2009
Posts: 62
Thanks: 0
Thanked 6 Times in 6 Posts
|
|
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 |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |