Trying To Implement A Business Delegate Pattern?

Jun 28, 2010

I am using ASP .NET and C#, and using the code-behind-pages concept.I am trying to implement a business delegate pattern in ASP .NET to reduce coupling between the presentation and business tiers.I want to have several ASP pages send information (through asp buttons clicks) to a "business delegate" ASP page, which will in turn send the necessary information to a C# method.The problem is that each button_click event in ASP .NET is directly tied to a C# method. I am having trouble understanding how to separate the presentation and business logic because of that.

View 1 Replies


Similar Messages:

Implement For Each Delegate In Razor Viewengine?

Feb 22, 2011

The following code works for webform view engine.

<% Model.Categories.ForEach(x => { %>
<li><a href="#">@x.Name</a></li>
<% }) %>

I wrote the above code as below in razor view:

@Model.Categories.ForEach(x => {
<li><a href="#">@x.Name</a></li>
})

But this doesn't work. Is there any way to achieve this in razor view?

View 2 Replies

Implement Task Recurrence Pattern In .NET Like Outlook?

Sep 7, 2010

I have to implement Scheduler like outlook in my .NET application.I have already started working on it but I can't implement Recurrence Pattern. how could i achieve this functionality. how to save task with Recurrence in database? I found this RadScheduler for ASP.NET AJAX but unfortunately this controller is commercial

View 1 Replies

Architecture :: Implement The Entity Translation Pattern?

Feb 7, 2011

Are there any tools out there which I can use to implement the Entity Translation Pattern? I dont want to write all the mappings by hand.

View 2 Replies

Using WCF Callback And Web Application To Implement Publish/subscribe Pattern?

Mar 1, 2011

I'm trying to use WCF Callback to implement publish/subscribe pattern. I would like to send the message from UserA to UserB or UserA to every clients at the moment. I got an example from here

In my app, I use asp.net as a client to connect wcf service instead and I found a problem when I subscrib to wcf service.

The wcf service does not hold any other clients object. So when I call GetAllClients(_guid), It will return only 1 client which is itself.

Here is the code in asp.net page (i put every control inside updatePanel)

[code]...

Is it possible to implement this publish/subscribe with asp.net and wcf callback? (I already tried on window app and it worked fine)If it is possible, how can I keep all clients that is connecting to WCF Service so I can use those GuId to call callback method.

View 1 Replies

Implement Transaction In Business Logic Layer?

Jan 17, 2011

I'am using enterprise library data access block in my asp.net application. I want to implement transaction from the Business logic layer, across multiple stored procs. Entlib opens a new connection for database access. Does using Transaction Scope in the following way lead to distributed transaction?

using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required))
{
// calling necessary DAL methods
scope.Complete();
}

Is there better methods to implement transaction from BLL?

View 1 Replies

Architecture :: Implement Observer Pattern To Refresh Another User Webpage?

Mar 13, 2011

I have some problem about observer pattern. My example is webboard system.

My solution wanna be refresh page after another user submit discussion.

I try to use observer but i don't know how to refresh another user's web page.

View 1 Replies

How To Implement Existing Business Layer To A SilverLight 4.0 Application

Sep 20, 2010

Lets assume that I have my own business layer containing my business objects and my business services. And I have decided to create a "SilverLight Business Application" (with SL v 4.0) and I want to use my already used Business Layer from the SL application I plan to develop.

I know that I cannot include a project which is not a SL project.

View 2 Replies

Forms Data Controls :: How To Implement Datagrid Events In Business Layer

Jan 28, 2010

<p>Dear All </p> <p>i am developing a small asp.net application in vs 2005. my application consists of 3 layers.presentation, business layer and data layer. now i got a small problem in using datagrid events like itemcommand , databound events in presentation layer. </p><p>this is my first asp.net application with different layers , upto now i dint work with layers. i created datagrid as follows in my page load i craeted an instance for my businesslayer as </p><p>

mywebsite businesslayer .customerinfo cs = new mywebsite businesslayer .customerinfo();
</p><p>

in customer info i have a function to bind the grid

</p><p>bindgrid(datagrid dg1, datatable dt)
{
dg1.datasource=dt; dg1.databind();
}
</p><p>

now i want to add itemcommand event ad databound events. can any one advice me how to add these events and where should i have to add these events? </p><p>

<p>p
</p><p>
</p><p>kishore</p>

View 1 Replies

C# - How To Implement And Maintain E-commerce Application When Business Don't Want To Disclose Merchant Details To Developers

Jan 14, 2010

Recently we've developed an E-Commerce web application for a client. We are at the stage before launch and the client is not happy to disclosing live merchant account details to us because they don't want us to potentially being able to see their clients' data.

Since we are going to maintain their website (running off their servers but we will still have access to the site files) I cannot see an easy solution to this other than trust.

How to implement and maintain E-commerce application when business don't want to disclose merchant details to developers?

View 2 Replies

Pattern For Retrieving Complex Object Graphs With Repository Pattern With Entity Framework

Oct 13, 2010

We have an ASP.NET MVC site that uses Entity Framework abstractions with Repository and UnitOfWork patterns. What I'm wondering is how others have implemented navigation of complex object graphs with these patterns. Let me give an example from one of our controllers:

[code]....

It's a registration process and pretty much everything hangs off the POCO class Person. In this case we're caching the person through the registration process. I've now started implementing the latter part of the registration process which requires access to data deeper in the object graph. Specifically DPA data which hangs off Legal inside Country.

The code above is just mapping out the model information into a simpler format for the ViewModel. My question is do you consider this fairly deep navigation of the graph good practice or would you abstract out the retrieval of the objects further down the graph into repositories?

View 2 Replies

MVC :: AsyncController Gripes / Working Pattern For Converting A GET-POST-GET Pattern To Asny?

Feb 23, 2010

Does anyone have a working pattern for converting a GET-POST-GET pattern to asny?

I'm encountering the following issues:

1. You cannot mix Sync and Async action methods SubmitForm(), SubmitFormAsync(bool? confirm), SubmitFormCompleted() ... (because the resolver gets all confused ... it doesn't use the HTTP verb to decide who to target. BTW: I think that's poor design, or a bug)

2. Renaming the get method name to something else eg: SubmitFormConfirmation(), SubmitFormAsync(bool? confirm), SubmitFormCompleted() would be very awkward if it works ... because you have to doctor the <form markup to specify an action name.

3. You cannot give them all async names SubmitFormAsync(), SubmitFormAsync(bool? confirm), submitFormCompleted(), because the call just keeps malfunctioning. It sometime even behaves as if you are requesting a delete of something.

Can someone give an insight from an actually working sample.

View 5 Replies

Best Design Pattern For Associating Subdomain With Area And PRG Pattern?

Aug 21, 2010

Now that the next version of ASP.NET MVC is being prototyped and previewed (ASP.NET MVC 3 Preview 1 came out a couple of weeks ago), I wonder if we should call the attention of the Core Dev team (S Hanselman, Phil Haack and all) to this "feature."there a easy/non tacky way of associating subdomains &#8594; areas?Something like:
[URL]Also, whats the best accepted design pattern in implementing PRG pattern in ASP.NET MVC? I guess it should also get some official loving in MVC 3.

View 2 Replies

Translating C# Delegate To VB.NET?

Nov 19, 2010

I am trying to translate or convert C# code that a friend gave me. I have limited C# knowledge but was going along OK until I hit the following code that includes a delegate. I cannot figure out how to get the equivalent functionality in VB.NET. I'm using
.NET 2.0 and VS2005.

public bool TryGetRedirectMatch(UrlContext url, out RedirectMatch match)
{
if (url.Path.StartsWith("/product.aspx", StringComparison.InvariantCultureIgnoreCase))[code]....

View 5 Replies

How To Apply Delegate And BeginInvoke

Mar 12, 2010

I am working with .net 3.5 and making application in asp.net. I show some application which is make in C# in Windows form where i see following code in class level declaration

[Code]....
and following code in form load

[Code]....

and following code in some event

[Code]....

Now my problem is I am making application in asp.net code behind VB.net where I cannot how to apply all this in my application. I more confuse with Delegate and BeginInvoke. I read somewhere that to use BeginInvoke in VB you should use Ajax.

View 4 Replies

How To Create A Delegate To Allow The Label To Get Updated

Dec 14, 2010

In my code behind on a button click event I want to set the text of a label to inform the user where in the process we are. How do I create a delegate to allow the label to get updated

View 1 Replies

AJAX :: Protected Delegate Sub AsyncTaskDelegate ()

Sep 2, 2010

I am trying to get this to bind to a gridview, without any luck. I would like each asynctask to ultimately return seperate datasets, but for now I can deal with the same one being returned.

[Code]....

View 1 Replies

Web Forms :: How To Declare Delegate Or Call Upon Method

Jan 6, 2011

I am using c# and socket programming to create a web application. Anyone knows how to declare a useable delegate or using another method to invoke or call a method such that my codes will not have error? I am stuck for at least a week!

View 1 Replies

Gridview Event, No Overload Matches Delegate

Jan 27, 2011

<asp: GridView..... ID="MyGrid" AllowSorting = "True" OnSorting = "SortMyGrid">
protected void SortMyGrid(object sender, GridViewPageEventArgs e)
DataTable TheGridData = MyGrid.DataSource as DataTable;

And then when I run the codeNo overload for 'SortMyGrid' matches delegat

View 1 Replies

CS0123: No Overload For UserInfoDataSource_Selecting Matches Delegate

Aug 9, 2010

I am getting this error and can't figure out how to resolve it. CS0123: No overload for 'UserInfoDataSource_Selecting' matches delegate System.Web.UI.WebControls.ObjectDataSourceSelectingEventHandler'.

<Fields>
asp:BoundField
DataField="FirstName"
HeaderText="FirstName" SortExpression="FirstName"
<asp:BoundField
DataField="LastName"
HeaderText="LastName" SortExpression="LastName"
[code]...

View 3 Replies

C# - Adding Delegate Or Event Property To Class?

Oct 4, 2010

I created a control where other developers can create an instance and use. There is a button click in the control. How do I allow developers to plug in their own code in a certain part of my control? I am not sure if or how exactly to use a delegate or event in this scenario.

[code].....

How to I update MyControl to allow this?

View 4 Replies

Web Forms :: Simple Delegate Example - Cleaner Code?

Jun 5, 2010

I need to pass a value from the selected button in user control to the containing page. I have it working fine but only by using a bunch of if statements that strike me as ugly. Can't figure out how to use a switch statement which, I think, would be a bit less cumbersome. I'd welcome on how to clean up this code (obviously I'm new to delegates).

Here's the code:

User Control:
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="DelegateUserControl.ascx.cs"
Inherits="Foobar.UserControls.DelegateUserControl" %>
<asp:Button ID="Button1" runat="server" Text="Button 1" onclick="Button_Click" />
<asp:Button ID="Button2" runat="server" Text="Button 2" onclick="Button_Click" />
<asp:Button ID="Button3" runat="server" Text="Button 3" onclick="Button_Click" />

User Control code behind:

using System;
namespace Foobar.UserControls
{
public delegate void SendButtonValueToPage(int buttonValue);
public partial class DelegateUserControl : System.Web.UI.UserControl
{
public static event SendButtonValueToPage SendButtonIdToPage;

[Code]....

View 6 Replies

Pass A Delegate In Server Control Parameter?

Jan 14, 2011

I have a server control that performs some logic. I'd love to provide a default implementation of this logic in the code of the control, but allow a developer to pass an alternate implementation of this logic in as a delegate, if they wish.

So...

<prefix:MyControl FooLogicMethod="MyUtilityClass.MyFooLogicMethod" runat="server"/>

If they don't specify this, I'll use my default method. If they do specify it, I'll use the method they passed in.

Can I do this as a delegate, or do I need to reflect it?

View 1 Replies

C# - Delegate Threading Overhead In Wepage Lookup?

Dec 1, 2010

I have a web app where a user will visit a page with a QueryString parameter passing the ID of the object I should retrieve.

What I then need to do is run a number of checks to ensure the user can access that data, and also find out if another user has a lock (recorded in the DB) on that object.

Currently these searches are all performed sequentially, however I'm thinking the best option might be to use delegates to be able to fire off the three or four searches required at once then use the results as they are returned.

My implementation for this would be using a delegate(s) and calling BeginInvoke, however I'm worried the overhead of threading this may lead to no speed increases.

My research has indicated it will use the ThreadPool, so there shouldn't be too much overhead, but I'd like to know if anyone has implemented this kind of solution to a similar scenario on a high traffic site and seen good resutls from it?

The reason I'm looking to do this is we are reengineering our application from the ground up, and need to make sure we are building something that will scale considerably.

View 2 Replies

Web Forms :: How To Use Delegate In User Control To Trigger Events

Mar 2, 2011

I have got a query regarding the usage of delegate in usercontrols. The scenario is I have got a user control which acts as a footer

on all the pages, It has the following place holders : Email, Print, Logout.

What I want to acheive here is when the customer logged in he/she has certain feauture's on the website for instance his/her personal diary,

dieting charts, birthday calender etc. I have figured out a way to create pdf's of each summary , what I am looking for is how to use the usercontrol

for instance when the customer clicks on the email place holder on certain page which is in the footer usercontrol, the following place holder should send

an email with the pdf file of that particular page attached to the customer. I came to know that delegate is the best way of doing it, but I cant find any specific tutorial on it.

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved