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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T19:41:21+00:00 2026-05-12T19:41:21+00:00

i have a strongly typed asp.net-mvc view and the Model has a . Links

  • 0

i have a strongly typed asp.net-mvc view and the Model has a .Links property.

Links is an array of link, which has a URL, a Description and an ID.

i have a bunch of links. Every links has a list of tags and those tags are layed out like this:

<a id="98" href="www.ibm.com>IBM</a><b class='dblclick'>Tags: Software</b>
<a id="99" href="www.microsoft.com>MIcrosoft</a><b class='dblclick'>Tags: Software</b>
<a id="100" href="www.apple.com>Apple</a><b class='dblclick'>Tags: Software, Fruit</b>

(www.ibm.com being the URL, IBM being the Description, and “98” being the ID)

i have the following jquery code:

<script type="text/javascript">
    $(document).ready(function() {

        $(".dblclick").editable('<%=Url.Action("UpdateSettings","Links", new { site = Model.Links[0].ID }) %>', {
            tooltip: "Doubleclick to edit...",
            event: "dblclick",
            style: 'display: inline; width:400px;'
        });

    });

the issue that i dont want to have: Model.Links[0].ID hard coded, i want to pass in the index into the method (98 in this case). Since every link has the “dblclick” class, how do i pass in the exact link or index into this array so i can stick in the ID field into this editable method?

  • 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-12T19:41:22+00:00Added an answer on May 12, 2026 at 7:41 pm

    You should get away with replacing:

    Model.Links[0].ID  
    

    With

    $(this).prev("a").attr("id")
    

    Although it would be better if you didn’t have to traverse sideways as it is destined to cause problems. If you could put the ID on the “b” element, it would be as easy as

    <a id="98" href="www.ibm.com>IBM</a><b class="dblclick" id="98">Tags: Software</b>
    

    …

    $(this).attr("id")
    

    Also, you may need to think about those IDs as HTML id attributes aren’t supposed to start with a number!

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

Sidebar

Related Questions

I have a asp.net mvc view which is strongly typed view and i have
Hi, I have a Strongly typed view in ASP.NET MVC. To keep track on
In ASP.NET MVC there is Model, View and Controller. MODEL represents entities which are
Keywords: asp.net mvc 3, checkbox list, strongly typed view. So, please don't suggest me
I am using asp.net mvc 3 and have strongly typed models to pass to.
i wish to create a reusable ASP.NET MVC ViewUserControl which is strongly typed to
i see that asp.net mvc 2 has strongly typed helped and looking initially at
Using Asp.net MVC, I have one view that's strongly bind to List , and
Given a strongly typed view in ASP.Net MVC, is it possible to refer to
I have a System.Web.Mvc.RazorView object which is strongly typed when in cshtml. Can I

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.