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

  • Home
  • SEARCH
  • 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 7810481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T03:47:58+00:00 2026-06-02T03:47:58+00:00

I am developing a discussion panel in asp.net in which I am using the

  • 0

I am developing a discussion panel in asp.net in which I am using the jquery selector option with two classes

 $("#plblDisAgreeProblem", "plblDisAgreeComment").click(function(){
var str = {
            problemID: $("#problemID").val(),
            empID : $("#empID").val(),
            commentID : -1
        }
        $.ajax({

            type: "GET",
            url: "<%= Url.Action("GetStatus", "Discussion") %>",
            data: str,
            error: function(msg){
                    alert("error2" + msg);
                },
                success: function (msg) {

                  var out = msg.split("<br/>");
                  if (out[1] == "DisAgree: True")
                  {
                        alert("You are already disagree to this problem.");
                  }
                  else
                  {




                }
            });


        })

I want if the class of div is ‘plblDisAgreeProblem’ then in JSon commentID should be -1 and if the class of div is ‘plblDisAgreeComment’ then in JSon commentID should be this.id but how I can do this?

Please 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-06-02T03:48:00+00:00Added an answer on June 2, 2026 at 3:48 am

    First lets fix the missing dot in your class selector.. see below,

    $("#plblDisAgreeProblem", ".plblDisAgreeComment").click(function(){
    

    Then you can use hasClass function to check if the clicked element is from the specified class.. see below,

        var str = {
            problemID: $("#problemID").val(),
            empID : $("#empID").val(),
            commentID : -1
        }
    
       if ($(this).hasClass('plblDisAgreeComment') {
           str.commentID = this.id;
       } 
    

    We don’t need an else if of ('plblDisAgreeProblem') because it is defaulted to -1.

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

Sidebar

Related Questions

I am developing discussion panel in asp.net in which I am drawing some spans
I am developing an asp.net application in which I want to implement the discussion
I am developing an app in asp.net in which I have jquery code in
I am developing an asp.net MVC web app in which I am using Linq
We're developing an application in ASP.NET. As an example, for discussion purposes, let's say
I am developing a discussion panel in which I am going to post the
I am developing a website and I can't use jQuery (no discussion about this),
I am developing a pretty extensive system in .NET, which involves a lot of
Developing a C# .NET 2.0 WinForm Application. Need the application to close and restart
When developing a .Net web application, if a run time error is generated, it

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.