I have a web application where users can upload the photo. I do have a windows service running which takes the uploaded photo and crops it to different sizes. This runs in a specified interval. Photo will be visible to the user once after it's cropped. So once user uploads the photo and photo cropper has not yet run, they wont be able to see the photo. Due to this behaviour user thinks that there was some error uploading the photo and they will upload it again and again.
where the photocropper runs immediately when the user uploads the photos which is queued.
Currently i'm developing an apllication that sends sms via the asp.net. I'm using msmq for the queuing incase of multiple sending of sms. The wcf will then check for new queue and using teh queue to send out a sms. I've a few question.How do i create a new queue for the msmq via asp.net
Originally Posted by wwb_99 grab the data sometime in the request, push to queue, process queue separately mainly because you don't want every request waiting on a CRM system that could be slow or down. This is a quote from wwb is another thread. What is the best to way to queue data and then process separately? Would you do it in the page_render event with a custom control? Would you use java script? Is there a post render event besides page_unload, or could you use page_unload?
Here is the code of my Repository class:You see, I use singleton here. Also you see, there is a data context as class variable of Repository class.The main reason to use singleton here is a wish to avoid using 'using(NorthwindEntities context = new NorthwindEntities())' in every function.
[Code]....
This Repository is used in ASP.NET application. So only instance of NorthwindEntities (context) is used everywhere and that's why I never dispose it.So my question is: Won't this code cause connections to the DB that are not closed?
I have to pass information from a desktop application to Web application and vice versa. What are the best practices that are regularly used? Currrently I'm using Asp.Net and a Winforms. To pass data to Web Site im creating a (POST) WebRequest and posting an xml to the siteTo pass data to Application im using .Net Remoting from Asp.ne(I'm using Winforms is an adminstration and monitoring application.)
I am developing an ASP.Net 2.0 project that a call center will use for their scripting and data collection. Each screen will present the call center associate with a question and depending on their answer, will move on to the next screen. My question is what is the best practice for housing that data until the end of the scripting has been completed (i.e. in a Dataset or datatable), where should the storage container be declared and what's the best way to control the back button so it doesn't lose the data and try to repost?
I m developing new shopping cart by using mvc2.and i have followed sample video store application posted in asp.net.my question is: What is the best way to keep shopping cart data.is it in db or a session.
I've been out of the ASP.Net arena since 1.1, and I'm starting to get back into it after a hiatus.
In the past, I would generally create SqlDataReaders, wire them up to pull from tables in a database via direct sql or accessing database views (mostly in MSSQL), grab the data, and display it in some datatable, or datalist.
Modifying data would usually be calling a stored procedure in the database to add/modify data, and then retrieve it afterward.
Now that I read up, I see there are alot of new things in ADO.Net world; strongly typed datasets, auto-generated adapters, etc.
My question is, does anyone have a good reference on best practices (or a book recommendation) on how to handle data access, and data manipulation and display now? I'm assuming that there are more automatic ways to show and manipulate data than before, but the new details are quite vast (which is good), but slightly overwhelming for me.
EDIT: ViewState does not change when browser is refreshed, so even if you write to viewstate it will not save the data. i am trying to store a Queue in a viewstate (to track postbacks and refreshes to stop a form from resubmitting). The Queue is only saving with a count of 1 (the first item that is added to it) no matter how many items i add.
// New Queue of strings private Queue<string> sTemp; private Queue<string> p_tempQue { set { ViewState["sTemp"] = value; } get { return (Queue<string>)ViewState["sTemp"]; } } //BasePage constructor public BasePage() { //create a Queue of string //sTemp = new Queue<string>(); this.Load += new EventHandler(this.Page_Load); this.Init += new EventHandler(this.Page_Init); } //In the 'page_Init' event we have created a simple hidden field by name 'hdnGuid' which is attached to the page on the first hit itself. protected void Page_Init(object sender, EventArgs e) { //initializing the hidden field //create a hidden field with a ID HiddenField hdnGuid = new HiddenField(); hdnGuid.ID = "hdnGuid"; //if it is the first time the page is loaded, create a new guid and assign it as the hidden field value if (!Page.IsPostBack) hdnGuid.Value = Guid.NewGuid().ToString(); //add the hidden field to the page Page.Form.Controls.Add(hdnGuid); } //In the 'page_Load' event we check if the hidden field value is same as the old value. In case the value is not same that means it's a 'postback' //and if the value is same then its 'refresh'. As per situation we set the 'httpContent.Items["Refresh"]' value. protected void Page_Load(object sender, EventArgs e) { if(p_tempQue != null) sTemp = p_tempQue; else sTemp = new Queue<string>(); //The hdnGuid will be set the first time page is loaded, else the hdnGuid //will be set after each time the form is submitted using javascript. //assign the hidden field currently on the page for manipulation HiddenField h1 = (HiddenField)(Page.Form.FindControl("hdnGuid")); //create an instance of the GuidClass GuidClass currentGuid = new GuidClass(); //set the GuidClass Guid property to the value of the hidden field currentGuid.Guid = h1.Value; //check to see if the Queue of strings contains the string which is the current Guid property of the GuidClass //if the are equal, then the page was refreshed if (sTemp.Contains<string>(currentGuid.Guid)) { //adds item as key/value pair to share data between an System.Web.IHttpModule interface and an System.Web.IHttpHandler interface during an HTTP request. System.Web.HttpContext.Current.Items.Add("IsRefresh", true); } //if they are not requal, the page is not refreshed else { //if the current Guid property in the GuidClass is not null or not an empty string //add the new Guid to the Queue if (!(currentGuid.Guid.Equals(null) || currentGuid.Guid.Equals(""))) sTemp.Enqueue(currentGuid.Guid); System.Web.HttpContext.Current.Items.Add("IsRefresh", false); } p_tempQue = sTemp; }
I want to remove all elements from Queue A that are present in Queue N And end up with Queue R: 1, 2, 8, 12, 13. How do I do this in C#. Trying to work with someones API and they offer a way to get the two queues and I need to filter based on one queue returned.
Updated Code Example: I am using a custom data type ModuleDetails
Currently we are developing an ASMX, ASP 2.0, IIS 7 web service that does some calculations (and return a dynamically generated document) and will take approx. 60 seconds to run.Since whe have a big machine with multiple cores and lots of RAM, I expected that IIS tries its best to route the requests that arrive in its requests queue to all available threads of the app pool's thread pool.But we experience quiet the opposite:When we issue requests to the ASMX web service URL from multiple different clients, the IIS seems to serially process these requests. I.e. request 1 arrives, is being processed, then request 2 is being processed, then request 3, etc
you could have a workflow which is used for the submission and tracking of tickets, with the scenario that when the support desk goes home all of the active workflows generate an e-mail to the person who submitted the ticket saying that their ticket won't be looked at today.What is the best approach to do this?Is it a custom activity or some other method of enumerating all of the active workflows and firing an event/queueing an item to the workflow queue Clearly from the workflow perspective it would be nice to have an activity within it which is fired when,in the case of the example above the office closes.
But, when my SMTP server is down I want to put all the emails in a queue and when it recovers I want to send them one a time. Is there any way how to do this programatically in C#?
module thats available for asp.net that uses a queue to send email to an smtp server? the queue being the operative word here.. we need a proper fallback mechanism for storing any messages that can't be sent so that the send can be re-attempted later
I am trying to access an item default.aspx.vb which is in the class page in the app_code folder. Why am I unable to access this through intellisense?
If Not m_qKnown.Contains(HRefs(i)) Then
here is the class page. In my vs, m_qknown is underlined in blue. How come I can't access this queue in this code behind page for the default.aspx? In my intellisense, if I try to prefix it with the name of the page (Charlotte.vb) Charlotte.Webcrawler. after this dot there is no m_qKnown. There are some queuing event handlers and that's about it.
I'm trying to avoid adding more items to a queue if the item is already in the known queue. I'm happy to email this website application to anyone who would like to test it.
To meet the needs of a colleague, I must get plian text into a MSMQ message queue. Trouble is, Sytem.Messaging results in a body wich defaults to xml content. I had thoght that this would get round the problem - but it doesn't:
[Code]....
The body content looks rather strange actually - it reads:
54 65 73 74 20 54 65 78 Test Tex
74 20 4D 65 73 73 61 67 t Messag
65 e
Any thoughts on how to get rid of all those numbers and just have a plain text body?
I'm currently trying to interface our new intranet (ASP-MVC) with the web front end of our pager system. The pager system's front end is about 10 years old, poor interface and no documentation. To do this I have the form on the intranet post to the server, our server then sends an HTTP POST to the pager server that mimics what its own form sends.
While testing this for overloading (we sent about 10 messages almost concurrently) the pager server crashed, as the system is a black box and the only difference we noticed was the concurrent POSTs the least we can do is try to prevent this happening.I want to have all messages go into a queue that sends at most once every 5-10 seconds but I'm not sure how to implement this,
I didn't specify this earlier but the process should be synchronous from the point of view of the browser, ie webserver gets the http POST request from the browser, message is put into the queue, message is sent from the queue, webserver sends http response to the browser. This is not a high volume service and I expect simultaneous requests to be rare so response will be near instantaneous, it is more of a throttle to prevent potential issues with concurrent requests.
I've got a WCF web service that runs fine at the moment but there is talk about using it very heavily soon. As part of it's normal process it writes a file out, then reads it back in again (don't ask why, I know it's stupid). I'm concerned that if we start hitting it with lots of requests then the following might happen.
1. Request 1 writes the file out.
2. Request 2 comes in and overwrites the file.
3. Request 1 reads the file back in but this is now the wrong file.
My understanding is that the requests would naturally queue up so that request 2 wouldn't start until request 1 had finished, but I'm not totally sure.
i m trying to develop a tabbed content slider. during this i am facing two problems.
first i don't know how to create the queue effects mean, i want to animate first div, after completion of first animation than second animation would be started.
for this i using the callback function here, but i want to know is there any other procedure to do this thing.
second there is jerk in the animation at second and fourth tab.
I have a web form (aspx page) where I load case data for my database and edit certain fields. I want to create a queue box where I can display new incoming cases (Case nums) that have not been edited yet, so that I do not mis any cases on a given day. I visualize my queue box to be something like an update panel which updates itself every few minutes and brings the new case nums in the queue box.
I have a music related ASP.NET web site which caches a lot of static information from the database on the first request.Sometimes, the application is reset and cache is cleared while the application is on heavy load and then all http requests go to the database to retrieve that static data and cache it for other requests.
How can I ensure that only one request go to the database and cache the results, so that other request simply read that info from cache and not needlessly retrieve the same info over and over again.Can I use thread locking? For example, can I do something like lock(this) { db access here }?
I have a custom dead letter queue service to pick up messages from DLQ. This service picks up failed message from DLQ and tries to resend to a different end point. If the new endpoint doesn't work, it rolls back transaction. This works great. Here is the code.
{ [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single, ConcurrencyMode = ConcurrencyMode.Single, AddressFilterMode = AddressFilterMode.Any)] public class FDPDLQService : IFDService { FDPManager _fdpManager = new FDPManager(); [OperationBehavior(TransactionScopeRequired = true, TransactionAutoComplete = true)] public void ProcessFDMessage(FDMessage message) { //System.Diagnostics.Debugger.Launch(); try { MsmqMessageProperty mqProp = OperationContext.Current.IncomingMessageProperties[MsmqMessageProperty.Name] as MsmqMessageProperty; // if message log required, and configured, log the incoming message try { ChannelFactory<IFDPRouter> factory = new ChannelFactory<IFDPRouter>("IFDPRouter_EP"); IFDPRouter proxy = factory.CreateChannel(); string ep = proxy.GetNextEPForGivenEP(OperationContext.Current.IncomingMessageHeaders.To.ToString()); if (ep == null || ep == string.Empty) { throw new EndpointNotFoundException(Common.Constants.FDP_NOT_FOUND_EXCEPTION_MESSAGE); } // Process message with next end point available _fdpManager.ProcessFDMessage(message, ep); } catch (EndpointNotFoundException enfe) { ExceptionManager.HandleException(enfe); Transaction.Current.Rollback(); //throw; } catch (Exception ex) { ExceptionManager.HandleException(ex); Transaction.Current.Rollback(); //throw; } } } }
But if all endpoints are not available for a long period of time, and if service rolls message back to the DLQ for a long period of time, after a certain period of time service stops picking up messages from DLQ. I am not sure which configuration is responsible for this.