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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:22:37+00:00 2026-05-25T06:22:37+00:00

I am designing a webapp using ASP.NET and jQuery and I could use some

  • 0

I am designing a webapp using ASP.NET and jQuery and I could use some advice.

Currently, the ASP.NET page renders an unknown number of elements that perform an action when clicked. Javascript on the front-end handles the click event based on which specific element was selected.

Each element is embedded with information that the javascript function requires. This informaion is added as extra attributes. So for example, a given element might look like

<a href="#" id="123" extrainformation="something important">Link 123</a>

jQuery then attaches a click event and uses the extrainformation attribute as a parameter for an internal function. Each element has 3-5 parameters.

This works great, but I have heard recently that it might not be best practice since it is not WC3 compliant. One possible solution would be for each element to directly call the internal javascript function with the necessary parameters. However this makes me uncomfortable because I lose the separation of concerns between rendering the page and executing the client-side logic.

Is there a better way to do this? Or maybe I’m just overthinking it?

  • 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-25T06:22:38+00:00Added an answer on May 25, 2026 at 6:22 am

    Yes there is a better way, its called HTML5 Data Attributes you can access them from jQuery using the $.data() interface.

    For Example:

    //instead of
    <a href="#" id="123" extrainformation="something important">Link 123</a>
    //use
    <a href="#" id="123" data-info="something important">Link 123</a>
    
    //then access it like
    var info = $('#123').data('info');
    alert(info); //alerts: 'something important'
    

    Basically anything starting with data- is stored as data about that element in the DOM, jQuery can access this data via the $.data() function.

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

Sidebar

Related Questions

I'm trying to create a ASP.NET MVC 2 webapp using the Northwind database following
Designing a web application with ASP.NET MVC I asked myself how can I also
Designing a new system from scratch. I'll be using the STL to store lists
When designing LINQ classes using the LINQ to SQL designer I've sometimes needed to
When designing a database to use MVCC (Multi-Version Concurrency Control), you create tables with
To learn ASP.net I started building a todo web app(web forms not MVC), this
I'm designing a webapp for my uni and I need to be able to
I am designing a web app that use Amazon product apis to retrieve books
I am designing a web app that has some information that needs to be
I'm having some trouble getting routes to match. I am using base-32 encoded int's

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.