C# - Get Current Sessions For Castle-Monorail Site?

Jan 28, 2011

I'm modifying a Castle-Monorail site that I've inherited and found that it would be useful to see a list of currently online users. Currently there are Filters that determine who can access which parts of the site so I can distinguish logged in sessions from non-logged in sessions. Is there an easy way of getting a list of active sessions so that I could then work out who is logged in?

View 1 Replies


Similar Messages:

C# - Get The User's IP Address In Castle MVC (Monorail)?

Apr 26, 2010

In a controller action of a CastleMVC application, how can I get the user's IP Address?

I think in asp.net mvc it would be Request.ServerVariables["REMOTE_ADDR"], but I can't find an equivalent in Castle.

(I am aware of potential proxy issue's etc, the address that is reported in the request is fine)

View 2 Replies

Use System.Web.Routing In Castle Monorail?

Jul 21, 2010

Is it possible to use the Microsoft (or Mono) supplied System.Web.Routing instead of the MonoRail routing stuff when building a Castle MonoRail app for ASP.NET?

View 1 Replies

HttpContext.Current / Cache Available To All Sessions

May 4, 2010

As per title. I want to be able to save some data in a cache object but this object must be available to all users/sessions and can expire.What is the best method to achieve this in a asp.net web app?

View 2 Replies

Keep Track Of Number Of Current Sessions On Website?

Aug 13, 2010

How would I keep track of number of current sessions on my website?

View 5 Replies

How To Find Information About All Sessions For A Web-app / Site

Jul 23, 2010

I am trying to create an admin screen that will give me details about all open sessions in an application/site. I would also like to know how many session objects are active for each of them

Session object gives me info about my current session. How do i find info about all open sessions. How many sessions are active, etc.

View 1 Replies

Site Uses Cookies - Need To Switch To Sessions

Nov 17, 2010

My site uses cookies. I need to have it use sessions instead. The reason for this is because there is a third party that needs to connect to it, and it's always requiring 3rd party cookies to be enable in the browser and that is annoying my customers. Is there any other way around this other than switching to sessions?

View 4 Replies

When A Few Users Try To Log Into Site - Their Sessions Are Merging?

Feb 16, 2011

i lunched an asp.net web-site. the main idea in the site is that:the site shows the same page, but on each next button the user clicks, the pictures in the site change randomly. im working with postback and sessions.

i noticed that when a few users try to log into my site - their sessions are merging. meaning, the first picture presented is diffrent but the second picture is the same for all the users, and so on... (moreover, pictures that appears in the begining appearing again even thow i don't allw it in my code)when i tried to debug the site locally, the random function works perfectly and there were no such problems. it haapens only when 2 users and more log into my site.

View 1 Replies

State Management :: Clear Sessions If The User Navigates Away From The Site?

Jun 17, 2010

I am wondering if it is possible to clear a session variable if the user navigates away from my site.

My example is I have a session storing the logged in user. This is checked for user access to each page.

If the user goes to another site (e.g. google) I want them to relog into the site.

This is to prevent others getting access to a users account if they use the same pc minutes.

I do have a logout that performs this and I know that it is impossible to make users use it! :)

View 2 Replies

Remove All Sessions Once The User Leaves The Application/site Or Closes The Browser?

Apr 9, 2010

Is there anyway to actually remove all the sessions once the user leaves the site/application or when he/she closes the browser?

View 11 Replies

MVC :: Set Up IoC (Castle Windsor) In Project?

Feb 8, 2010

I'm trying to set up IoC (Castle Windsor) in my MVC 2 project here, using the section in Pro Asp.net MVC Framework book.

However, I cannot compile after creating a custom controller factory as stated in the book.

This part give me error:[Code]....

Telling me that no suitable method have been found to override?

Does someone know if there's a problem with the code in the book or something changed with recent versions of things (wont suprise me..got some books on MVC here rendered completely useless with the evolution of asp.net mvc)

View 12 Replies

Converting From StructureMap To Castle Windsor?

Mar 9, 2010

Recently, I've had some problems with StructureMap. Mostly incomplete documentation, but also they have a habit of drastically changing namespacing, object names, removing methods, and generally changing how the thing works.For now, my code is written using poor man's DI so that I can keep working on it, but I don't want to leave it that way. I took a look at Castle Windsor a while back, but never really tackled it.

With StructureMap, I would derive a custom Registry class where all the mapping is done, a custom Bootstrap class which loads one or more registry classes and initializes them, and then, call Configure on the bootstrap class in Global.asax.How does one go about setting up the matching Castle code? I also need to know how the controller factory is affected. Does Castle provide a replacement, or are we left to write our own, as with StructureMap

View 11 Replies

DataSource Controls :: Use Castle ActiveRecord With C#?

Mar 23, 2010

I'm trying to use Castle ActiveRecord with c#.

I'm moving data from an old database (FF2) to spatiaLite (sqLite)

The first few tables are updated without any problems. Then every table after gives and error

when I try to save. None of these tables have composite primary IDs.

SnapFarms tbl = new SnapFarms();
.... loop
if (theField.Equals("clientid")) tbl.operationId = getString(val, "{000-000}"); else
if (theField.Equals("farmid")) tbl.farmId = getString(val,"{000-000}"); else
if (theField.Equals("farmname")) tbl.farmName = getString(val,"Missing"); else ...
... end loop
tbl.Save();

exception message::Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

There is no Index column so what is going on?

View 4 Replies

Castle Windsor IOC With Custom .NET Membership?

Feb 8, 2011

I have read about not being able to use a .NET Custom Membership with Castle Windor. Is this the case? Are there any work arounds?

View 1 Replies

C# - How To Find Object In NHibernate/castle Activerecord Session

Aug 27, 2010

I am getting the following error in an Asp.Net Castle ActiveRecord app when trying to update an object:

"a different object with the same identifier value was already associated with the session"

I've looked up and down my code to see where else the object might have been created but I'm not seeing it. This is baffling as I have the exact same code on another page that works fine on updates

Now I'm thinking of trying to see where this other object is in the Session and either kill it or find out how it got into the session. How can I find this object?

[Update]

Ok, I finally found where the object is being called. However, I would still like to know how to find objects in the session for future reference.

View 1 Replies

Web Forms :: Converted Web Site To Solution. Now Getting "The Name {0} Does Not Exist In The Current Context"?

Mar 13, 2010

The website compiled fine before as a regular website in VS 2008. However, in my attempt to convert it into a solution and separate out the business logic into its own project, I'm getting issues where it says that my codebehind references to controls cannot be found in the context. This is for every aspx or ascx file. All my references are there. Is there a correct way to convert a website into a solution? I simply drag-and-dropped the web files into a project in the solution essentially.

View 1 Replies

Flush Separate Castle ActiveRecord Transaction And Refresh Object In Another Transaction

Jun 15, 2010

I've got all of my ASP.NET requests wrapped in a Session and a Transaction that gets commited only at the very end of the request. At some point during execution of the request, I would like to insert an object and make it visible to other potential threads - i.e. split the insertion into a new transaction, commit that transaction, and move on. The reason is that the request in question hits an API that then chain hits another one of my pages (near-synchronously) to let me know that it processed, and thus double submits a transaction record, because the original request had not yet finished, and thus not committed the transaction record.

So I've tried wrapping the insertion code with a new SessionScope, TransactionScope(TransactionMode.New), combination of both, flushing everything manually, etc. However, when I call Refresh on the object I'm still getting the old object state. Here's some code sample for what I'm seeing:

Post outsidePost = Post.Find(id); // status of this post is Status.Old
using (TransactionScope transaction = new TransactionScope(TransactionMode.New))
{
Post p = Post.Find(id);
p.Status = Status.New; // new status set here
p.Update();
SessionScope.Current.Flush();
transaction.Flush();
transaction.VoteCommit();
}
outsidePost.Refresh();
// refresh doesn't get the new status, status is still Status.Old

View 1 Replies

RenderAction Not Finding Action Method In Current Controller In Current Area?

Mar 15, 2010

I'm creating an ASP.NET MVC 2 (RTM) project that uses areas. The Index action of the Home controller of one area needs to use RenderAction to generate a sub-section of the page. The action called is also defined in the same Home controller. So the call should just be:

<% Html.RenderAction("List") %>

However, I get an exception:A public action method 'List' was not found on controller 'RareBridge.Web.Areas.Events.Controllers.HomeController'.

Note that I'm not in the "Events" area! I'm in a completely different area. If I remove the "Events" home controller, then the exception still occurs but names a different controller (still not the one I want it to call).

I've also tried providing the controller name and area to the RenderAction method, but the same exception occurs. What is going on here?

BTW: I am using Autofac as my IoC container

View 2 Replies

Web Forms :: Find Current URL Of Page During Code Behind Submission (NOT Current Web App URL)

Aug 18, 2010

I am looking for a way to figure out the current URL that the page is currently on (NOT what the asp.net page currently is, but where the CODE is at). ie. My web app is located at: [URL] my code is: String page = [URL]

String response = GetResponse(page); //basically the above code goes to the website [URL] and parses the HTML within it and brings it back and populates the variable string "response". But, sometimes the [URL] throws me a curve ball and redirects me to: [URL] I want to be able to use a try/catch to be able to "catch" the error of a different page: ie validateUser.aspx. So, I need to do to this: try

{
String page = [URL];
String response = GetResponse(page);
}
catch
{
//code to check the behind URL to see if [URL] is the URL OR IF [URL] is the current URL
}

understand I know how to find the URL of the current page the web app is on. I need to find the current page that threw the exception during the execution of the code behind.

View 1 Replies

Access The Current Thread's Context Using HttpContext.Current?

Mar 11, 2010

I have a static class with serveral static methods. In these methods, I'm trying to access the current thread's context using HttpContext.Current. For example:

var userName = HttpContext.Current.User.Identity.Name;

However, when I do that, I receive a NullReferenceException, the infamous "Object reference not set to an instance of an object."

View 3 Replies

Web Forms :: Get Name Of Current Page And Current Subroutine

Oct 17, 2010

I am building in error-logging into my site, and want to be able to get hold of the current page name that the error occurred in, as well as the specific subroutine or function, to then pass to a VB.NET function. Is there anyway to get hold of this information without hard-coding the names manually? For example,

Dim strCurrentPageName = ???
Dim strCurrentRoutine = ???

View 6 Replies

C# - Using Sessions In Classes?

Jan 31, 2011

have code that's using session variables; it's both in the master page code behind and in the code behind of some aspx files. I wanted to put this code in a function that's in a different file but when I did that, the statement Session["VariableName"] became underlined in red on the word session. What am I missing?

View 1 Replies

How Does IIS Recognize Different Sessions In .NET

Aug 19, 2010

Suppose I have logged into an application which is running from IIS. Now I haven't logged out, but closed the browser. And when I'm accessing the application again, it defaults to the login page. How does IIS recognize that it is a new request and redirects the user to the login page?

I have another doubt. Suppose if I'm not closing the browser, which I used when I logged in. I'm opening the new browser to request a page from same application. IIS recognizes that it's a new request to the application and redirects the user to login page. Why does it not use the existing session or cookies which the first browser uses?

We say http is a stateless protocol. Once the page is requested i have logged in.And http protocol connection will be terminated between IIS and browser right? Then iam navigating to other pages in that logged in application. Now iis recognises user has logged in this browser. But when i open a new browser and request that application how does iis recognises it is a new request. Since the http protocol is disconnected, how it works in the first case

View 3 Replies

MVC :: Really Need Help With Sessions And Lists

Dec 13, 2010

I have tried everything for weeks with this now but can't get it to work. What I'm trying to do is to store an array in a session and add numbers when a user guesses. I also have to know how to loop through the array.

Please help

[Code]....


View 1 Replies

C# - How To Share Sessions Between PHP And ASP.net Application

Mar 30, 2010

My company took some old php application over. Due to our preference to ASP.net and to the lack of any documentation from the previous developer, we do not want to spend much resources on developing in PHP. For implementing new features, we will create an Asp.net application that has the same look to the user. We want to develop a kind of 'coexisting' web application. Therefore we must share sessions between an PHP and an Asp.net webapplication project, because there is a usermanagement involved with an existing MySQL database.

(e.g. link 'A' directs to the PHP website, and link 'B' directs to the asp.net application)

How can we share the session between and PHP and an asp.net application?

And does anyone have a hint for this 'coexisting' thing, that might be useful in development?

View 5 Replies







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