View Complete Post
This month's column is a follow-up to the December 2002 installment in which I introduced the basic concepts and programming techniques associated with delegates. I am going to assume you have already read that column and that you are familiar with the fundamentals of programming delegates.
Ted Pattison
MSDN Magazine January 2003
Hi,
In my asp.net web application i have lengthy excution process like word merge. I want to merge the word documents and send to client in a procedure. Basically i am looking for run and forget kind of asynchronous process.
In my for loop i tried to create delegate and rstrat. like this
filenames is a string array, creating in the same loop and assiging values before calling delegate.
MailSender mail = new MailSender();
TestDelegate testdele = new
I have studied lots of books and materials on internet but I can never understand what is the use of delegate in development. Actually I want to know in what particular situation a developer should use delegate in code. Please provide me some example.
Hullo Good Guys,
I am back here seeking help. Please Help me.
Here us the description of what I was ihstructed to do by the System Analyst.
Create DELEGATE Class to perform Mortgage computation and return the result back to the calling FrmMortgage.cs. Apparently my coding are not working as I am not familiar with DELEGATE Class
Here are the Erro
I have created a basic logging framework for my application that writes log messages to a local text file using an Asynchronous delegate.
My application has many threads running however, and as a result, the order of the log entries in the text file is not chronological.
So I have two competing requirements: on one hand, my WriteToLog() method has to return almost immediately so that it doesn't block in-flight code, while at the same time the log file has to be in chronological order.
Any ideas? Some of the problems I've encountered are:
1a. Trying to use a Queue (with a lock{ } around it) to maintain the order seems to result in deadlocks
1b. Even if I use a Queue, at some point the Queue must be written to disk, so it seems like I'd have to frequently have WriteToLog spin off a "WriteToDisk" like method.
2a. I've considered instantiating a new thread which polls the Queue from (1a) and writes to disk in a loop, say, every 5 seconds. I'm leaning more towards this method.
3. I've looked into log4net and some other stuff but it just seems like overkill, and I'd really like to have my own framework for this seemingly simple task.
Thanks!
Got a user control that has a Listbox on it and I want to be able to pass the selected value back to the main page.
User Control code:
using System; using System.Web.UI; public delegate void SendData(string data); public partial class _controls_Filter_Staff : UserControl{ public event SendData mSendData; protected void Page_Load(object sender, EventArgs e){ } protected void selStaffList_OnSelectedIndexChanged(object sender, EventArgs e){ if (Convert.ToInt32(selStaffList.SelectedValue) >= 0 && mSendData != null){ mSendData(selStaffList.SelectedValue); } } }
Main page that has the user control:
protected void Page_Load(object sender, EventArgs e){ ucFilterStaff.mSendData += GetSelectedStaff; /* ERROR HERE Line 11 */ } private void GetSelectedStaff(string value){ TextBox txtUserList = (TextBox) fvMain.FindControl("txtUserList"); if (txtUserList == null) return; txtUserList.Text += value + ";"; }
This is the error I get back and I've tried everything I know, but cannot sort it. Probably something stupid but I just cannot see it.
System.Web.HttpUnhandledException: Exce
Hall of Fame Twitter Terms of Service Privacy Policy Contact Us Archives Tell A Friend