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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:17:23+00:00 2026-05-24T20:17:23+00:00

I have a blog app where the user can insert comments to be approved/denied

  • 0

I have a blog app where the user can insert comments to be approved/denied from the admin.

Here is the code for the View on which the administrator can give/deny approvation through Ajax:

<div id=news_comment_state_@(Model.Id)>@(Model.FlApproved?"Approved":"Denied")</div>
@Ajax.ActionLink("Approve", "ApproveDenyComment", new { IdComment = Model.Id, ApproveDeny=true }, new AjaxOptions { UpdateTargetId = "news_comment_state_"+@Model.Id})
<br />
@Ajax.ActionLink("Deny", "ApproveDenyComment", new { IdComment = Model.Id, ApproveDeny=false }, new AjaxOptions { UpdateTargetId = "news_comment_state_"+@Model.Id})

In the Controller, the ApproveDenyComment returns the "Approve"/"Denied" strings for the 2 actions.

It runs but I don’t like it too much, I think there is a better and cleaner way to do it but I don’t know it, can anyone help me?

  • 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-24T20:17:25+00:00Added an answer on May 24, 2026 at 8:17 pm

    Cris,

    I would be tempted to return a partialview via $ajax in respect to that user and repopulate the comments div. keeps everything consistent and saves error prone server/clientside logic disconnect (i.e. if the error status flag were to change in the future for whatever reason, then you’re in trouble).

    really has no peformance issues and many benefits in terms of consistency.

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

Sidebar

Related Questions

I have a simple Rails 3 blog app that needs an admin user so
If I already have a blog app done with Django and I want to
I have a parent model that has many child models, for example: App.Blog =
I'm building an app for a blog site. I have a UINavigationController with a
I have a blog that has a redirect loop, and I can't understand htaccess
Im writing a ruby application that can post comments on behalf of the user
I'm looking at things that can distinguish a blog from a normal website. These
Essentially I want to have my blog grab wall photos, status updates, etc. from
i am working on a simple web app which has a user model and
We're building a web app that customers can pay a monthly rate for. Here

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.