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

The Archive Base Latest Questions

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

Say you have a page like the question page of Stackoverflow, where the user

  • 0

Say you have a page like the question page of Stackoverflow, where the user can either vote up or down, insert new input, edit messages, delete comments or whatever. Given that the page should work both w/ and w/o javascript, how would you organize the controller page in an asp.net mvc web site?

  • 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-23T17:25:29+00:00Added an answer on May 23, 2026 at 5:25 pm

    All action would be posts, and they would redirect back to the action that called them.

    public ActionResult Index(int pageID){
       return View();//the question page
    }
    
    [HttpPost]
    public ActionResult Upvote(int pageID, int messageID){
       //update message votes
       return RedirectToAction("Index", new { @pageID = pageID } );
    }
    
    [HttpPost]
    public ActionResult Downvote(int pageID, int messageID){
       //update message votes
       return RedirectToAction("Index", new { @pageID = pageID } );
    }
    
    [HttpPost]
    public ActionResult PostComment(int pageID, int parentMessageID){
       //add comment to parent message
       return RedirectToAction("Index", new { @pageID = pageID } );
    }
    

    All my button in my page would be actionlinks that call these post actions. Then I would add javascript to intercept the button clicks and handle via AJAX (so page doesn’t need a reload) that way, without javascript the buttons will still work and just cause a page reload

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

Sidebar

Related Questions

Say I have a web page like this on an Ubuntu 12.04 web server
Is there a way to have lightbox on page load?? Say like when the
Ok, say I have a page with the url: URL.com/checkout/completed , how can I
Let's say you have a profile page that can only be accessed by the
Let's say I have some content classes like Page, TabGroup, Tab, etc. Certain of
I have a question. Let say brand A have FB page and a blog.
Say I have a page in my web application that lets a user update
Let's say I have four tables: PAGE , USER , TAG , and PAGE-TAG
My question is this, if I have a page say index.HTML that has some
let say i have a page , and i want to allow 3rd party

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.