Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6013009
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:29:11+00:00 2026-05-23T02:29:11+00:00

lately have i had this idea in my head about using events in a

  • 0

lately have i had this idea in my head about using events in a ASP.NET MVC application.
For an example When a user created a comment, will this on the server side trigger an event, that for an example the account controller can be hooked on to, and thus triggering account specified code on a event.
Have any 1 tried this or is it even possible, to use events as such on a web application?

Here is an example.
enter image description here
A uses created a comment on my website, though the comments controller, this will make the Comments controller trigger an event in my static event manager. This will execute all the methods that have been tied to this event. In this example is “OnCommentCreate()” in the AccountController attached.
Now all this should happen on another thread then the users, so the page for the user will continues as there were no events, while the events are handling behind.
My thought where to use this with a persistent connection on a timeline, or it can be used to decentralize code. I could for an example have an event that would be called when a username changes, there will go through the log files and change the name of the user to the new username.

I hope this clarifies better

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T02:29:11+00:00Added an answer on May 23, 2026 at 2:29 am

    You can absolutely do this if you want to, DoomStone. ASP.NET MVC itself doesn’t do events using the .NET event model, but what you’re describing isn’t really .NET events either; it’s more of a publish & subscribe bus in your app.

    One thought is that depending on how many events you start doing, and what you have them do, you might look into using purpose-built eventing frameworks or WF, or possibly a message queue.

    That said, I would also encourage considering other options of accomplishing your goal. The examples you have given don’t really strike me as the sweet spot for event-based programming, unless I’m misunderstanding something.

    ** Update **
    I had another thought after your comment. So, short answer is that ‘yes’ this is a well-known pattern, especially for decoupling services that maybe exist on other servers and maybe (in some cases) aren’t even owned by you. There are available frameworks out there, but what you’re describing could be completely home-grown. You can either make a method on your WKO for each event (like your example shows), or if you want more flexibility you can define a generic action (.e.g. Publish or Send) which takes in a custom Message class, and then folks calling the WKO can send a message which is typed to the event (in other words, rather than calling OnCommentCreated(), they might call Publish(new CommentCreatedMessage({data})); Doing it that way tends to make the solution more able to grow.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

we've been getting this error lately and have no idea why, we are not
We have an ASP.NET application that uses Forms Auth. When users log in, a
I've been learning the new ASP.NET MVC framwork lately and I've developed a test
Lately I have been reading a lot of blog topics about big sites(facebook, twitter,
Lately I have been watching Pluralsight intro videos on MVC 3. I have never
I've been using Mercurial for some development lately and have been loving it. I'm
Lately I have been playing around with intents and bundles. I thought I had
I have done a few projects lately using a Database Object super class which
As some background I prefer the flexibility and benefits that ASP.NET MVC gives me,
I've built a ASP.NET webforms site for a customer, and lately the customer has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.