Web Forms :: Cannot Debug Lower Layer Methods
Oct 27, 2010I can not debug BLL and DAL methods VS doesn't step into those projects. Only I can debug UI project.
What's wrong with VWD express?
I can not debug BLL and DAL methods VS doesn't step into those projects. Only I can debug UI project.
What's wrong with VWD express?
I recently read Phil Haack's post where he gives an example of implementing Model View Presenter for ASP.NET. One of the code snippets shows how the code for the view class.
public partial class _Default : System.Web.UI.Page, IPostEditView
{
PostEditController controller;
public _Default()
{
this.controller = new PostEditController(this, new BlogDataService());
}
}
However, here the view constructs the instance of the BlogDataService and passes it along to the presenter. Ideally the view should not know about BlogDataService or any of the presenter's lower layer dependencies. But i also prefer to keep the BlogDataService as a constructor injected dependency of the presenter as it makes the dependencies of the presenter explicit.
This same question has been asked on stackoverflow here.
One of the answers suggests using a service locator to get the instance of the BlogDataService and passing it along to the presenter's constructor.This solution however does not solve the problem of the view knowing about the BlogDataService and needing to explicitly get a reference to it.
Is there a way to automatically construct the presenter object using an IoC or DI container tool such that the view does not have to deal with explicitly creating the BlogDataService object and also injecting the view and service instances into the presenter's constructor. I prefer to use the constructor injection pattern as far as possible.
Or is there a better design available to solve the problem?. Can there be a better way to implement this If i am building a WinForms application instead of a ASP.NET WebForms application?
Actually I have done all my Biz(business layer) and DAL CRUD Opprations using static methodes
and I just send my error messages to my log table a sample of biz layer
public static bool Delete(Guid LogGroupID)
{
using (DAL.ChroXEntities db = new ChroX.DAL.ChroXEntities())
{
var q = (from lg in db.LogGroupSet
[code]...
so what should i do to propagate an user friendly error to my users?
How can I see debug/trace type info for the MVC layer. This would be things like see the incoming HTTP requests, which routes they are mapped again, the incoming parameters etc.
(i.e. same kind of info I see when I am working on a Ruby on Rails app for it's MVC infrastructure)
I am developing a web application, which has Data Access Layer and this layer has only one class, in which all methods are static methods like static Insert, static Update, static Search. It has no properties. I am using these methods in my Bussiness Logic class for my users who are visiting my website.Now my question is : 1. Is it right to use static methods in this scenario ?2. What will happen if 10 users call Insert method at the same time ?
View 3 RepliesI have created a table adapter in DAL. I have created a gridview in the page and want to fill the gridview with a table data by calling a method. My table has 11 columns but i want to display only 2 columns of the table. My getSong() method has a query as Select title, category from Muisc. But it diaplyas all columns with no data except title and category and the autoincrement primary key column with negative values. The pic is given below. How can i solve it?
View 2 RepliesI'm currently using asp.net mvc 3 on vs 2010, i can't debug the action methods of the controllers (if its a ajax call/request).
View 6 RepliesI have VWD Express and I can't debug lower layer methods in the application the debugger doesn't step into breakpoints that are set in these layers. what do I do? I need to debug lower layer assemblies most of the time.
View 10 Repliesis there any impact of using static methods in Business Access layer in 3 tier applciation,
View 4 Repliesem all new in C# and .NET.I am following this tutorial: [URL]And i am at step 3: Adding Parameterized Methods to the Data Access Layer - i have No problems in getting out all information from my database.But when i try to get a specific item by CategoryID i get a Error.This is what i type in my Query in the table adapter:
SELECT ProductID, ProductName, SupplierID, CategoryID, QuantityPerUnit, UnitPrice, UnitsInStock, UnitsOnOrder, ReorderLevel, Discontinued
FROM Products
WHERE CategoryID = @CategoryID
Here is the error i get when i click finish:The wizard detected the following problems when configuring TableAdapter Query "FillByCategoryID":
Details:
Generated SELECT statement.
Error in WHERE clause near '@'.
Unable to parse query text.
I want to debug EditPanel.debug.js file of HTML Editor, but it never shows in VS 08 and Im sure it executes to that line.What I did to enable debuggingUnchecked both 2 checkboxes for disabling the debugging
Set ScriptMode="Debug"
Change following line
[ClientScriptResource("AjaxControlToolkit.HTMLEditor.EditPanel", "AjaxControlToolkit.HTMLEditor.EditPanel.js")]
to
[ClientScriptResource("AjaxControlToolkit.HTMLEditor.EditPanel", "AjaxControlToolkit.HTMLEditor.EditPanel.debug.js")]
I am new to this .NET what is the difference between N-Tier and 3- Tier Architecture. If they are same. How to pass the values from presentation layer to business logic layer.
For Example
I have 10 controls in presentation layer. I passing values to these controls. How the architecture works.
I am building a web site following the tutorials on asp.net. I am using dataset as data access lay, and writing classes to access the dataset. But the example is just basic ideas, how do I retrieve individual table column value in the business layer?For example, if I have a table called Product, I only want to find out what is the product name by product id. I did this in my ProductBLL:
public ProductBLL
{
public int GetProductName(string productId)
{
ProductDataSet.ProductDataTable prodData = Adapter.GetProductById(productId);
[code]...
Is there a better way, or am I doing this correctly? Can anybody give me a reference to a more complicated business logic model?
how the data pass from one layer to another layer in mvc design pattern...
View 2 RepliesI've even got my JQuery Ajax submission going on now but I've encountered another problem. I *think* it's something to do with the structure I'm using but like I say, I'm fairly newo this.I have my AJAX form submission which builds my "PersonViewModel" (model for the presentation layer) in JSON and sends it to "@Url.Action("RegisterSubmit")" in my Person Controller. Now, I seperate my business layer from my View/presentation layer so in "RegisterSubmit"I'm verifying the model is valid then instantiating a new instance of my business model "Person", adding the values from "PersonViewModel" and then calling my "Save" function.
View 7 RepliesWe're building a large web app that has numerous layers. In order to communicate to the business layer we're using a service layer that the web layer calls when data is needed. Unfortunately, it seems that if exceptions are thrown in the business layer, it seems that the services on the web side are wrapping the exceptions and re-throwing them. We're looking for a clear way to encapsulate the error and log it, without WCF wrapping a new exception around the original.
View 2 RepliesMy repositories throw exceptions (System.Exception) when some things go bad and I know this is bad practice.. so i will create a custom exception (DataException). My question is should this custom ex class be in the repository layer or the domain layer? Im thinking it should be in Domain layer where all business objects and repository interfaces live but just want to make sure.
View 3 RepliesOn my web form, I have a RadioButtonList nested within a ListView as follows:
Nested RadioButtonList, and Inconsistency between Debug and Run without Debug
I have created a horizontal menu using <UL> and <li> tags. Hovering over a top level <ul> causes the lower lever <li>'s to drop down. This works well but there are two narrow <div>'s below that act as decoration. These disappear when the drop down submenus lay over them. I have played with the z-index properties of both lower <div> and of the menu items but have not resolved the issue. I want the submenus to drop down over the <div> but for the <div> to remain visible outside of the covering sub-menu.
[Code]....
public class CacheHelper { /// <summary> /// Removes object with the specified key. /// </summary> /// <param name="key">The key.</param> [code]....
I have this methods for caching..I need to change this methods to use in aDictionary<string,object>
How do I need to change this code Because I am new to asp.net I am still learning..
I'm trying to reevaluate our n-layer architecture and would love to get some based on your experiences. Here is our typical .NET n-layer (sometimes n-tier) design.
Project.UI
Project.Services
Project.Business
Project.Model
Project.DataAccess
DataAccess typically consists of Entity Framework 4 and Repository classes. I attempt to follow the Aggregate Root concept in order to avoid having a repository for table, easier said than done in my experience. I tend to have ~70% match between Repositories and Tables.
Model usually consists of my Entity Framework 4 entities, I've been using Self-Tracking EF entities with success.
Business is what I struggle with the most. I typically have a Manager class for every Repository. This class will contain methods like .Add() which will perform business validation before forwarding down to repository.Add().
Services, typically I will only implement this if in fact I am looking to create a web service based solution. This layer will be tasked with marshaling requests/responses between DTOs and entities. And most importantly provide the more coarse grained interface. For example a TradingService.SubmitTrade(), which is really a facade for a business transaction which might include AccountManager.ValidateCash(), OrderManager.SubmitOrder(), etc.
My business layer is very entity centric, really it's just the glue between the entities and the repository, with validation in between. I've seen many designs where the Service Layer is what holds a reference to the repositories (in essence skipping the "business layer"). In essence it serves the same purpose as my Business layer, it does the validation, however its' responsibility (and naming) is a higher level, more coarse grained business transaction. Using the example above the TradingService.submitTrade() will not delegate to any business manager classes, it would itself query the necessary repositories, perform all the validation etc.
I like my design in a sense that I can reuse a business layer method in multiple service calls, however I hate the fact that for every repository I have a matching business layer manager, creating tons of extra work. Maybe the solution is a different type of grouping at the Business Layer level? For example combine individual Manager classes like PhoneManager and EmailManager (note I have Phone entities and Email entities) into a logical Manager class such as ContactsManager (note I don't have a "Contact" entity type). With methods such as ContactManager.GetPhones() and ContactManager.GetEmail(), etc.
hide webpart if screen size lower than 1280?
[Code]....
how to Convert Uppercase to Lower case during Binding in datalist in Asp.Net.
we have data in uppercase in sql server database . Now we want to display data in datalist at aspx pages in lowercase.
we are using datalist where control is as
<asp:Label ID="lblAdd" runat="server"
Text='<%# Eval("c_Address", "{0:ToLower}") %>' ></asp:Label>
how to convert data into lower case while dispalying in datalist .
here i have in 3-tier architecture , how to pass the data between DAL and BAL. i am using grid view to edit the data,when ever i click on the edit button all the corresponding fields should come to textboxes. i tried for delete ,it works fine bt not working to EDIT.
View 7 RepliesWhen using the template helpers in ASP.NET MVC, e.g. Html.EditorFor(x => x.Property) the rendered Html with have a capitalized ID - matching my property name. In order to standardize the ID's of all html elements I want this to be lower case. Rather than specifying the ID manually - which won't get updated if I rename my property, I'd like to establish a convention. I'm sure I read this was possible somewhere and I'm currently scanning the interwebz to find it.
View 2 Replies