C# - Events Through Application Scope To Multiple Clients?

Feb 15, 2011

First of all, I am creating a something like a client/server solution using a standard ASP.NET website - I do know this method is not adviced, and most people would love to scream "COMET!" or "HTML5 Sockets!" - but please don't ;-) !

What I am doing...

I am creating an MMORPG on a website.

I have several clients whom need to be in contact at the same time. This is done by a global object in the Application scope.

My problem

I need to invoke an event to several clients. For instance, when an attack has been performed, I need to update some graphics. The attack logic is resolved in the global object, but each of the clients has to respond to this.

Right now I do the following:

fightTrace.Reciever.InvokeMoveEnded(this);
fightTrace.FiredBy.InvokeMoveEnded(this);

(This is a kind of observer pattern)

What now happends is a race condition. The one who loads the page_load event will get both of these events, and the one who is not running them, will experience no changes in the UI.

So what is it I really want?

What I really need is some genuine and nice way to create an observer pattern through the application state. I need to send an event out to every "listener" which is in this case is a client, and then do some update.

View 1 Replies


Similar Messages:

Is Context.Items User Scope Or Application Scope

Apr 6, 2010

I want to use Context.Items to store some info of a User Control like:

Context.Items["Data"] = 5;

I want to know, Is Context.Items is for each request or it is global for the application?

View 1 Replies

To Allow Multiple/ Different Clients To Access The Same Application?

Nov 4, 2010

i have an Asp.net application 3.5. I want to be able to allow multiple/ different clients to access the same application but using different url's. I have already managed to configure the database to allow this. So hia's the main part i want to host my application in a domain say... wwww.myapplication.com

then allow different client to access the same application using

1.www.clientOne.myapplication.com

2.www.clientTwo.myapplication.com

also the client subdomains i.e(clientone.myapplication.com and clienttwo.myapplication.com)should be autocreated by the client upon registration

View 5 Replies

C# - Multiple Asp Requests From Multiple Clients Share Information?

Dec 9, 2010

Imagine a website where individual clients can see each-other's presence - like a social network or a chatroom.

For example:

Client1 connects to my website.The back-end C# code updates a static field to indicate Client1's presence.
Client2 connects to my website.Will the back-end C# code for the second request see the information stored in the static field from the first request? Is there anything I need to do to guarantee that these seperate instances of my ASP application are sharing static data?

View 4 Replies

Multiple Applications On A Single Site - Session And Forms Authentication Scope?

Mar 7, 2011

We're using ASP.NET and IIS 6.0. I realise that the definitions of applications, websites and virtual directories are ill-defined in IIS 6, and changed a lot in IIS 7. However, I'm stuck with IIS 6.0 for now.

We have a single web site defined in IIS, and a number of separate sub-sites in Virtual Directories.

The scheme looks like this:-

[URL]

[URL]

site1, site2, ... are virtual directories in IIS 6.0, under the "Default Web Site".

I need to use ASP.NET sessions and forms authentication in most of these sites, and I don't want them to share authentication data or session information at all.

Both the mechanisms currently depend on cookies. However, the cookies created by default use the same name, and have a path of "/" in the browser, meaning the sites' cookies will clash with each other.

Without changing the default name for each cookie, how can I enforce separation between my sub-sites? Do I need to change the virtual directories for IIS 6 "Applications"? Or is there some way in code to enforce a more limited scope for the cookies?

View 1 Replies

C# - Declaring Global Variable/class In Application Scope 3 Ways - Which One Is Best

Mar 3, 2010

I am looking for differences between those 3 ways of using static class in asp.net application scope.
Will all of these point to the same class?

Which one is preferable >object< defined declaratively inside global.asax or static class ?

examples:

<object runat="server" scope="application" class="classname" ID="objID"></object>

VS

public static class classname {}

VS

Application("a") = new classname();

View 1 Replies

C# - When Implementing The Singleton Pattern In A Web Application The Static Variable Scope?

Jan 25, 2010

want to make sure I am not assuming something foolish here, when implementing the singleton pattern in an ASP .Net web application the static variable scope is only for the current user session, right? If a second user is accessing the site it is a different memory scope...?

View 4 Replies

MVC :: Make Multiple Clients (desktop And IPhone)

Feb 4, 2010

How can I make multiple Index pages (contains a list of data), one to be used for a regular client, and one special view for the iPhone. Based on the article found on http://dotnetslackers.com/articles/aspnet/DevelopingForTheiPhone.aspx , I know that I can distinguish using

[Code]....

View 1 Replies

C# - Remotely Execute A Program On Multiple Clients From A Web App?

Dec 21, 2010

So I have the following requirement for a project I'm working on, and I can't figure out the best (or any, for that matter) way to do this.

I have an asp.net web app sitting on IIS at HQ. When a particular event occurs, I need to then show a message on a dynamically selected subset of PC's throughout the company. The message must be shown due to the time restraints of this process (4 hours reaction time) and we legally can't afford to not show the message.

So I need to do the following:

Show a message to the users. I have a winforms app that puts up a dialog that the only way to get rid of it is to click a big "Acknowledge" button. To ensure that the message was shown. Some kind of report back that yes, it was shown and subsequently acknowledged. A way to react if the form is not shown.

I've considered the following:

PsExec - Iterating over every node asynchronously in my web app to fire off a remote executable sitting on each PC. .NET Remoting - I'm not familiar with this at all, and it lead me to look at WCF instead. Would it work for what I'm trying to do? WCF Callbacks - These seem to require a constant connection and I'm not sure what that means for our infrastucture. I imagined a client service that would kick off an app or show the form somehow. Our scheduling software (Tidal Enterprise Scheduler) - remotely executing an executable. This would introduce more points of failure.

In SO's opinion, what would be the best way to attack this problem?

View 3 Replies

Architecture :: Very Frequent Reads To Database Multiple Clients?

Dec 5, 2010

I have a website hosted with sql 2008 database on Godaddy. Here's my problem descriptionbefore I actually begin implementing.Entries are made in a table named "XYZ" by a third party program. Now, there are multipleclients (could be asp.net ajax web based or vb.net desktop clients which I have not decided yet) who
read data from this "XYZ" table every 10-15 seconds. The connection string used by these clients would be same. If I have 10000-20000 clients making connections and querying same table, would that cause any breakdown? Since my connection string is same, connection pooling isautomatically in place.

What else do you think I need to take care of? Or is there any better way to implement this setup?Also, should I go for asp.net ajax client implementation or vb.net(c#) client implemtation ?Your inputs would be highly helpful to me. I am looking for a medium to long term solution to thissetup.

View 10 Replies

Web Forms :: How To Send Email To Multiple Clients Located In Different Domains

Sep 21, 2010

How can i send email to multiple clients located in different domains such hotmail,yahoo,and gmail

is it required to provide Smpt server name, if we have multipe domain id, what should we do?

I am using fowling code but getting exception failed.

MailMessage mailMsg = new MailMessage();
mailMsg .From = "from@fromServer.com";
mailMsg .To = "to@toServer.com";
mailMsg .Cc = "cc@ccServer.com"";
mailMsg .Bcc = "bcc@bccServer.com";
mailMsg .Subject = "SubjectOfTheMailString";
mailMsg .Body = "BodyOfTheMailString";
SmtpMail.Send(mailMsg );

View 2 Replies

Web Forms :: Transfer Voice From One Client To Multiple Clients In Live

Apr 27, 2016

I'm trying to develop a new application for multiple users. the main idea is that one user talks and the entire users (who logged in ) could hear him (1 way).

How this can be made? how can i transfer voice from one client to multiple clients in live?

Note that my clients are mobile users (Android, IOS and Windows phone) and the server is .NET.

View 1 Replies

C# - Application Page Not Working On Clients Computers

Jan 28, 2010

we developped an ASP.NET application that runs fine on our development server and in our network computers. But in production, the application works when accessing it directly from the web server but not on the clients (code behind is not executing).

View 5 Replies

Security :: Cannot Login To The Application If The Clients System Date Is Wrong

Feb 18, 2011

After deploying our web application, one of the user was not able to login to the application. After checking, we could realize that his system date was worng, It was a greater than current date. If the system data was less than the current date we can still login. We are using asp.net membership

View 2 Replies

JavaScript - Multiple Create Requests Means Multiple Button Click Events For The Same Time?

Oct 19, 2010

I have a form which inserts data in DB on Submit button click but the problem is when client click the button multiple times its sends multiple create requests means multiple button click events for the same time of same data, which must not be.

I tried to disable the button when client click the Submit button first time but after this it does not call server click event handler or not fire the server click event once it got disabled.

How to handle this multiple click problem..

I used the following code to disable the button

[code]....

View 3 Replies

Handling Multiple Events Appearing In Same Time?

Apr 19, 2010

What will happen if multiple events appear in same time ? Which will be first executed ?? Is there any some kind of "events order" ?

View 2 Replies

AJAX :: Trigger With Multiple Control Events

Jan 6, 2011

In my application i have placed one label in the update panel and in triggers one textbox and one dropdownlist.

<asp:UpdatePanel ID="TestPanel" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Label ID="lblTest" runat="server"></asp:Label>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="txtTest" EventName="TextChanged" />
<asp:AsyncPostBackTrigger ControlID="ddlTest" EventName="SelectedIndexChanged" />
</Triggers>
</asp:UpdatePanel>

In the textbox if i gave any wrong input then i am displaying the error message with label "lblTest".The error is displayed in the label sucessfully but when i am selecting the ddlTest dropdownlist the error message is disappeared.

View 1 Replies

Postback - Multiple Page_Load Events With URL Rewriting?

Feb 18, 2010

Im using intelligencia urlrewriter as my url rewrite module. I have one very strange problem which only occurs when an url is rewritten but to make it more fun, not on all rewritten pages. Edit: Forgot to tell you what's the problem boing boing. the problem is that my Page_Load event gets fired 2 times.his is how my form rewrite adapter looks like:using System;

using System.Web.UI;
using System.Web;
using System.Web.UI.WebControls;

[code]...

View 3 Replies

C# - Multiple Page_Load Events For A User Control When Using URL Routing?

Jan 6, 2011

've recently set up an ASP.net site (not using MVC.net) to use URL Routing (more on the code below) - when using user controls on the site (i.e I've created a "menu" user control to hold menu information) the page_load event for that control will fire twice when URLs have more than one variable passed over.

i.e.

pageName/VAR1 : will only fire the page_load event once.

while

pageName/VAR1/VAR2 : will fire the page_load event twice.

*Multiple extra VARs added on the end will still only fire the page_load event twice*.

Below are the code snippits from the files, the first is the MapPageRoute, located in the Global.asax :

[code]....

Note, that when I'm just hitting the page and it uses the default values for items, the reloads do not happen.

View 3 Replies

AJAX Binds Jquery Events Multiple Times?

Mar 29, 2010

I have a masterpage setup, with a pageLoad in the topmost masterpage, which calls pageLoad2 for nested masterpages which calls pageLoad3 for content pages.

In my content page I have a jquery click event and in my nested masterpage I have a web user control.

Whenever I use the user control in the nested masterpage, it rebinds the click event in the content page (undoubtedly because the pageLoad3 is called again), but this makes the click event fire twice on a single click. The problem gets worse the higher up masterpages you go (eg. fires 3 times if user control from topmost masterpage is called).

how to make sure it only binds the jquery events once?

View 2 Replies

State Management :: Class Object Available To Multiple Events In The Code Behind?

Sep 1, 2010

I am trying to incorporate AJAX in my web project for the first time and it isn't working. I don't know how to instantiate a class once and use AJAX to update the dataset numerous times before updating the database changes using a postback.

My project is to learn AJAX with a class object. Clicking the button is supposed to increment a count by one using a class to store the count. Here is my class:

[Code]....

Here is my HTML code:

[Code]....

And here are my button click event code snippets:

[Code]....

My problem is that as I step through the code (after clicking on the second button) it instantiates a new class object each time which returns a value of 2 every time. I have tried to fix the problem by putting my counter class instantiation in the pageload event using "If Not IsPostBack Then ..." but my probem there is that the button click event block of code would not recognize the cCount class - it put the blue lines under the cCount

My goal is to have the class object available to multiple events in the code behind: especially using AJAX to build records in one of my DataSet tables Does anyone know how to handle this?

View 6 Replies

Moving Button Events To 1 Event And Calling From Multiple Buttons

Aug 12, 2010

Since i have 5 buttons that pretty much run the same code, except for the database updates, i found some examples of how to do this.. so i created 1 button event, and put my general calc code then some if statements to determine what button was clicked.. but doing this now i get a NullReferenceException

and here is the code its complaining about, why would this work within the other button events, but not this one? Ive compared and and all the buttons on the page are the same with the except of the database entries.

Button b = (Button)sender;
Label tfive = (Label)FormView1.FindControl("five");
Label ttwo = (Label)FormView1.FindControl("two");

[Code]....

View 18 Replies

Why Web Controls Does Not Have Sufficient Events Like Windows Application

Mar 16, 2010

An asp panel contains only 6 events. if they provide a visibilechanged event it may very useful for me. if it is in windows application ,how easy it is.I dont know why thy are not providing all these.This is same as in the case of gridView, button ,etc. just think , I have an Iframe in an asp panel and two buttons. In first time it is invisible .Buttons named first and second respectively. Two another pages One.aspx,two.aspx. These two pages contains each text box. When you click on the First button . I want to set the Iframe src="One.aspx" and display "first" in the textbox on One.aspx. as same in the case , when user clicks Second button. How to do this ?

View 2 Replies

What Are The Events Triggered After Clicking On A Href Link In A .Net Application

Jan 28, 2010

My client wants to pass values through the query string, but they don't want the query string to be displayed in the browser's address bar. The values being passed are for tracking purposes. I know that postback doesn't happen after you click on href link.Is there any way I can get the value out of the query string without displaying it in the browser's address bar? I think this may be impossible, but I may be wrong; I'm hoping to see if anyone has any answers.

View 3 Replies

Visual Studio :: Control's Events Are Not Listed Out In C# Web Application?

May 19, 2010

I'm using VS 2005. My question is: If i'm selects a VB ASP.Net Web application project means, in each page it will listout the events assoiciate with that control in a Drop down.

But the same is not displayed when i'm using C# Web application.

How can i view the events in dropdown in C# web application?

View 2 Replies







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