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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:36:57+00:00 2026-05-23T23:36:57+00:00

I am adding an stackoverflow-esq type of notification bar to my site. On the

  • 0

I am adding an stackoverflow-esq type of notification bar to my site.
On the server side I am adding divs for display:

for (int i = 0; i < dt.Rows.Count; i++ )
        {
            string script = "<div class='hover-notification' style='display:none;'>";
            script += dt.Rows[i]["messageText"].ToString();
            if ((bool)dt.Rows[i]["canDismiss"] == false)
                script += "<span class='dismiss'><a title='Dismiss notification'>x</a></span>";
            script += "</div>";
            ClientScript.RegisterClientScriptBlock(this.GetType(), "clientScript" + i, script);

        }

The client side code is:

$(document).ready(function () {
        $('.hover-notification').prependTo('body').slideDown('slow');
        $('.dismiss').click(function () { $(this).parent().slideUp('slow').remove(); });
    });

I have a table which holds all of the messages for all users and has a messageID primary key. Messages are added to the table on some events, and messages which are not dismiss-able are removed in other events.
What I want to do is mark the message as dismissed once the user clicks the dismiss button.

I’m not sure how to do this.
Could someone please point me in the right direction?

p.s. I’m also open to any comments on the server-side/client-side code I have so far.

  • 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-23T23:36:58+00:00Added an answer on May 23, 2026 at 11:36 pm

    If I understand your needs, you want to approve dismiss on server side.

    Try :

    $('.dismiss').click(function () {
        $(this).parent().slideUp('slow').remove();
        // ajax request to server
        $.get('dismiss.asp?id='+this.id);
    });
    

    What you have to do is create this dismiss.asp receiving an id freshly pushed on the :

    <a id='123' class='dismiss'>x</a>
    

    Am I responding to your question ?

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

Sidebar

Related Questions

I've found this question on StackOverflow Adding div below images in colorbox But it
When adding a new data connection in Server Explorer in VS 2010 (with Azure
As per how StackOverflow does it when you are adding a question or replying
This is the same question as this: https://stackoverflow.com/questions/2890620/jquery-running-a-function-in-a-context-and-adding-to-a-variable But that question was poorly posed.
I have a similar design goal to this StackOverflow question about adding a label
I created a table, on referring http://stackoverflow.com/questions/9045940/dynamically-adding-table-row , whenever i came into the last
I first had a problem with adding a Reference for Bing Maps (http://stackoverflow.com/questions/13239597/why-can-i-not-reference-bing-maps-in-my-app); but
I've seen similar questions to this on StackOverflow regarding adding highlighting to a language,
I found stackoverflow topic on adding marker add marker with Google-Maps-for-Rails , but failed
Adding HTML/any tags to either side of selection - Javascript The problem: After creating

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.