|
Your best bet is to put the requests for a registration email into a database or other table and then have a non-ASP.NET service respond to those pending requests. (You could also use MSMQ instead of a db for this).
|
|
|
|
|
Thanks.
Nice solution but Windows service will need to query database server every now and then(polling) to see if any new email is inserted. Maybe inserting an item into database and a notification message in MSMQ lead to better performance.
Thanks anyway.
"I hope you live a life you're proud of. If you find that you're not, I hope you have the strength to start all over again." - I wish I knew who is this quote from
|
|
|
|
|
This approach works very well. I recommend it on grounds of reliability.
I'd blame it on the Brain farts.. But let's be honest, it really is more like a Methane factory between my ears some days then it is anything else...
|
|
|
|
|
How many simultaneous registrations are you expecting? Unless you are expecting more than 100 per second, I don't think you need to worry about threading.
Or rather than worry about threading in your ASP.Net app, make a web service that handles sending the e-mail and make asynchronous calls to the web service from your ASP.Net site.
|
|
|
|
|
T M Gray wrote: more than 100 per second
Wow! That's too much. I expected much less. I don't think it ever happens! Being new to asp.net I hardly can estimate resource usages per user.
Well I'm far less concerned now. Thank you.
"I hope you live a life you're proud of. If you find that you're not, I hope you have the strength to start all over again." - I wish I knew who is this quote from
|
|
|
|
|
Create yourself a Windows Service that handles these "background" type requests, it makes life so much easier for debugging and troubleshooting.
My basic design is to use a directory where the service "listens" (FileSystemWatcher) for an XML file to be dropped. It then picks up the file and performs the necessary request. Once the request is complete, it moves the XML file to either an "Archive" or "Error" folder. I use the Event Log to track basic message status, but you can devise any type of logging system you want.
In my system, I know that there aren't going to be lots of requests, so this is a single threaded job, very simple, yet robust.
I'm all for keeping things simple and reliable.
|
|
|
|
|
We have had a lot of luck with this approach, and it has the salient benefit that the service can be administered simply from the administrative tools on the server, and restarted as needed. Further, it can have a very simple console monitoring capability that lets you see what it is up to in real time.
Also, the very same service can interact with any sort of application, not just a web submittal app...
|
|
|
|
|
Hi,
I believe that the answer is by using the singleton pattern. Just create a singleton class for the process queue (with the put method and a permanently alive thread or threads that block when the queue is empty and resumes execution when the queue receives a put) and use it in your ASP application.
|
|
|
|
|
si24803 wrote: using the singleton pattern
Honestly, I prefer to avoid any static thing as much as I can. Singleton in my opinion is just the same static functions + a constructor. The constructor adds benefits but using static functions in a multi-threaded world is tricky. Keeping track of all shared resources during application lifetime is hard indeed. Don’t get me wrong. I don’t say I totally avoid them but I will as much as I can.
si24803 wrote: a permanently alive thread or threads that block when the queue is empty
That was my first question. Answers were great. While that fits very well in desktop applications, I’ve learned that it's not the best possible solution in a web application.
I think best possible solution was given by T M Gray; first ensure if it’s really needed. If so, then have a separate Win/Web Service to do background probably time-intensive jobs. Use an IPC mechanism (WCF netpipes maybe) or RPC or SOAP messages, in case of a WebService, to inform the Win/Web Service asynchronously that a new email is to be processed.
"I hope you live a life you're proud of. If you find that you're not, I hope you have the strength to start all over again." - I wish I knew who is this quote from
modified on Monday, August 23, 2010 7:29 AM
|
|
|
|
|
I do have one i frame like on my .aspx page
<iframe height="500px" width="500px" src="http://www.codeproject.com" id="Iframe1" runat="server"></iframe>
but when i run this page.
the webpage inside page taking control of whole the form and just redirects to given src of Iframe.
Can anybody say reason behind this ?
|
|
|
|
|
You should delete the question in the other forum before posting here. In any case, you already have the answer.
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
That is not answer of my question. so 0/5
|
|
|
|
|
|
Sorry, for that by mistake i put question there but i got very good response then core group.
Thats why i haven't deleted question.
Will Keep it mind and try to make chris maunder proud.
|
|
|
|
|
Anyway, all question-related instructions aside, I think it's because of the runat="server" that your iframe isn't doing what it's supposed to do.
Hope this helps.
"My personality is not represented by my hometown."
|
|
|
|
|
Hi, Could you please tell me what is the usage of Interface? when we should use them. Could you please give me an example.
thx a lot
|
|
|
|
|
See, in real life, when you interact with some objects, you don't really care about the internal implementation or complexity of that object. For example, when you use your computer, all you care about is how to power on or off by switching the button, how to input data (Using keyboard or mouse) and as a user, you really don't care about how the computer is internally operating,taking your inputs and processing it to show output.
So, the computer has not exposed the internal complexities to you, or, to the outside world. All it provides is an "Interface" to the outside world with the information that the outside world needs to know to use and operate the computer. As a user, you are happy to know about the "Interface" only, rather then the Internal implementation and complexity (The "Class").
In the programming world also, when you need to develop a class (Which may do many complex things), you need to expose the capabilities and operation of the class to other applications or class libraries (That may use this class) so that they can understand and use your class accordingly. So, what you do is, you create an Interface that contains the method signatures and you implement those methods in your class. So, the client applications and libraries can develop their codes based upon the Interface you defined. While at runtime, the method invocation on the interface actually will turn out to method invocation in the implementation class.
Use of interface gives you extreme flexibility. For example, suppose you have an interface (IComputer) that exposes the functionality to the outside world and you have a class (WindowsPC) that implements the Interface method. Now, based upon some requirement, you can develop another class (MacPC) that implements the interface methods in a different way (Because, a MAC pc has the same kind of features, but, internally operates diffrently). Now, if the client application codes are developed based upon the Interface (And, not based upon the implementation classes), there is very little chance that, they would need to change their code. Why? Because, both of your implementation classes actually implements the same interface.
For example, WindowsPC and MacPC both implements the IComputer interface. So, if your client codes are developed using the IComputer interface and they accept the IComputer interface as parameters in their methods, you can send them an MacPC object, instead of the WindowsPC object any time and the client code will run perfectly without any problem (As long as your implementation classes are implemented correctly).
So, use of Interface gives you flexibility to your code that you can manage easily and you can extend it without much change.
Basically, use if interface is part of the basic Object Oriented Principles. You may take a look at this article How I explained OOD to my wife[^] to learn these principles.
Best of luck.
|
|
|
|
|
I marked it as a good answer but I think people asking these questions should do a Search for the same. These things are already explained at so many places. So if you do a search and read some articles/posts you will have a complete understanding of the topic. Just my opinion.
..Go Green..
|
|
|
|
|
Could you please do a Google search to find the answer for your homework/interview question?
..Go Green..
|
|
|
|
|
You are correct. Actually, it takes less amount of time to do a Google search rather than to post a question. The newbies often underestimate Google
|
|
|
|
|
Al-Farooque Shubho wrote: The newbies often underestimate Google
Even better than Google, something passed the trial of time, BOOKS
|
|
|
|
|
Watch some clips from Mehran Sahami (Stanford). He explains in this[^] video what an interface is (could also be lesson 9 or 11).
hope this helps
"My personality is not represented by my hometown."
|
|
|
|
|
Hello friends
i am conecting mysql in asp.net 2010 on vista but it junrate
error:-Unable to connect to any of the specified MySQL hosts.
Please help
Thanks
Piyush Vardhan Singh
p_vardhan14@rediffmail.com
Eventure Technology
http://holyschoolofvaranasi.blogspot.com
http://holytravelsofvaranasi.blogspot.com
|
|
|
|
|
That simply is not helpful.
1. check your mysql is in fact running
2. Check your connection string is correct
and check with this guy[^]
|
|
|
|
|
Hey,
i tried to save and show the image using asp.net. To save the image, i did
fleUpload.SaveAs(Server.MapPath("hint\\" + fleUpload.FileName));
and it worked perfectly fine.
But I am trying to show the image from that server and for that i did
Image1.ImageUrl = (Server.MapPath("hint\\" + fleUpload.FileName));
The problem is it is not throwing any error but it is not showing the image in the Image1 either. What can be the reason for this and how to get the image ?
suchita
|
|
|
|