[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Are Anonymous Methods Allowed Cross-Classes?

Posted on 2007-12-05
11
Medium Priority
?
185 Views
Last Modified: 2013-12-16
Hello All

I have on my website many processes that require a transfer page. For example, I have a login page, the customer has to supply his credentials, then he clicks Submit, then the website takes him to a transfer page (that invokes some methods) and finally redirects him to to the target page.

I have many transfer pages on my website, and I wanna use Anonymous Methods (.Net 2.0) to have one Transfer page that a will allow to assign a Anonymous Method to it.

Is this even doable? and if yes could anyone show an example please? This will be greatly appreciated!

Thanks In Advance.
0
Comment
Question by:isaacab
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
11 Comments
 
LVL 21

Expert Comment

by:surajguptha
ID: 20415512
I dont see how anonymous methods would help you? Just curious....
0
 
LVL 18

Expert Comment

by:Joel Coehoorn
ID: 20415608
I think maybe he means delegates?
0
 
LVL 21

Expert Comment

by:surajguptha
ID: 20415766
yeah but why would delegates be needed for a simple redirect?
0
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 

Author Comment

by:isaacab
ID: 20415769
Yes, I mean delegates. I cannot get it work.
Is possible to assign a delegate to an instance of a class? if yes - could you show me some example please?

Thanks in advance.
0
 

Author Comment

by:isaacab
ID: 20415786
I don't need the delegates for a simple redirect, I need them to implement for each instance different lines of code.
The redirection will happen after those code lines will be executed.

I hope I'm clear enough.
0
 
LVL 21

Expert Comment

by:surajguptha
ID: 20415822
Basically you need some function to run before the redirect isnt it?
0
 

Author Comment

by:isaacab
ID: 20415851
surajguptha,
Correct.
0
 
LVL 21

Expert Comment

by:surajguptha
ID: 20415922
Create a common function which will take a few parameters and then redirect it... replace all instances of redirect with this function.
0
 

Author Comment

by:isaacab
ID: 20557428
OK. Here is my solution:
In my transfer page I have this code snippet:
private EventHandler executeDelegate = null;

This is how the client control looks like:
ASP Page
<%@ Register TagPrefix="uc1" TagName="ctlTran" Src="~/Components/CustomerInteraction/TransferCustomer.ascx" %>
<uc1:ctlTran ID="ctlTran1" runat="server" />

C# Code:
this.ctlTran1.ExecuteDelegate = delegate
{
PUT HERE THE CODE TO EXECUTE
};


This works fine to me. I'm sorry if I wasn't clear enough when writing the question.

Thanks Guys for trying to help. I really appreciate it!

Happy New Year to you all
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 20591210
PAQed with points refunded (500)

Computer101
EE Admin
0

Featured Post

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question