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 8525901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:06:53+00:00 2026-06-11T08:06:53+00:00

I am new to RAZOR and now I need to trigger an event when

  • 0

I am new to RAZOR and now I need to trigger an event when users clicked a button, so I can run a lines of code to handle the event.

I don’t want to use it with MVC, and I don’t want to use JavaScript because I only want to explore the power of RAZOR.

I was surprised when someone told me that the way of event-drive methods has been discarded in the RAZOR, that’s alright. But my question is

what is the way to handle/response a click event (in the RAZOR syntax) which is the simplest thing in the ASP.NET Web Form applications?

The reason why I’m asking this question is I found that even the easiest thing like I want to write a fragment of code to response users’ input hard to be done(or should I say there is no way to do it) in the RAZOR.

You can take a look the discussion in my previous post.
ASP.NET RAZOR cannot capture the event

I hope there are some guys who can guide me through the first and tough step.

Thanks.

Update:
It seems that there is really no way to handle the user events in any way without the help of MVC framework. Thank you guys for your answers. I’d like to leave this post a few days longer and hopefully I could see someone post something interesting.
Thank you again.

  • 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-06-11T08:06:55+00:00Added an answer on June 11, 2026 at 8:06 am

    There is no such thing like a click event in Razor.

    Event handling is a concept that was used in WinForms. The event model in classic ASP.NET WebForms was an effort to translate the Windows programming model to the web, which, frankly, didn’t work very well. A stateful event model and web programming pretty much contradict each other.

    If you want to work with events then use classic ASP.NET WebForms. If you want to embrace the web and not work against it, learn ASP.NET MVC, Razor, etc.

    Don’t try to fit a stateful legacy paradigm on a stateless infrastructure. This is what Microsoft did with WebForms and that is where it should stay.

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

Sidebar

Related Questions

I'm a new bie with MVC3 razor. Can anyone please help me why I
I am working with razor view engine in asp.net mvc3. Now, I need an
New to ASP.NET MVC (using MVC3 with Razor now) and I'm confused on passing
I am new to RAZOR and am very interested in this new tech. Now
new to razor, I have a label and a button <form action= method=post enctype=multipart/form-data>
I am a bit new to razor. So for the below, it's showing model.CarModelName
New to MVC3 Razor - linq to sql having spent some time trying to
I am new in MS MVC3.I am using C# with razor view engine in
new to c#. I'm trying to make a simple system where I can search
I've got a running MVC 3 (Razor) application with Forms authentication. I can easily

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.