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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:31:35+00:00 2026-06-10T00:31:35+00:00

I have a model inside a strongly typed view but I would like there

  • 0

I have a model inside a strongly typed view but I would like there to be a select button which brings up a modal for each item, the problem is how do I use razor inside my modal definition so each modal is called myModal1, myModal2 etc each for the customer name:

<a class="btn" data-toggle="modal" href="#myModal">Select</a>
            <div class="modal hide" id="myModal">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal">×</button>
                    <h3>Customer Options</h3>
                </div>
                <div class="modal-body">
                    <p>
                        @Html.ActionLink("Edit", "Edit", New With {.id = currentItem.CustomerId}) |
                        @Html.ActionLink("Details", "Details", New With {.id = currentItem.CustomerId})
                        |
                        @Html.ActionLink("Delete", "Delete", New With {.id = currentItem.CustomerId}) |
                        @Html.ActionLink("Book Job", "Create", "Job", New With {.id = currentItem.CustomerId}, Nothing)
                        |
                        @Html.ActionLink("Jobs", "ShowCustomerJobs", "Job", New With {.id = currentItem.CustomerId}, Nothing)
                        |
                        @Html.ActionLink("Bills", "BillsForCustomer", "Bill", New With {.id = currentItem.CustomerId}, Nothing)
                        |
                        @Html.ActionLink("Send Message", "SendCustomerMessage", "SendMessage", New With {.id = currentItem.CustomerId}, Nothing)
                        |
                        @Html.ActionLink("Record Payment", "RecordPayment", "Payment", New With {.id = currentItem.CustomerId}, Nothing)
                    </p>
                </div>
                <div class="modal-footer">
                    <a href="#" class="btn" data-dismiss="modal">Close</a>
                </div>
            </div>

Basically something along the lines of this (which does not work):

 <a class="btn" data-toggle="modal" href="#myModal@currentItem.CustomerId">Select</a>
            <div class="modal hide" id="myModal@currentItem.CustomerId">

I am not sure what the correct definition is in Razor to call Razor inside id and href definitions

  • 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-10T00:31:37+00:00Added an answer on June 10, 2026 at 12:31 am

    Just add brackets ( ) @(currentItem.CustomerId)

    <a class="btn" data-toggle="modal" href="#myModal@(currentItem.CustomerId)">Select</a>
            <div class="modal hide" id="myModal@(currentItem.CustomerId)">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a view that is strongly typed. Inside this view i have jqueryui
I have a view model like this: public class EditVM { public Media.Domain.Entities.Movie Movie
I have a section of a view that I would like to submit to
I have a strongly typed partial view #1, and i have another partial view
I have Linq to sql model inside a project on which .tt also added.
I have a backbone view with a model inside it. When I call the
I have installed rapache and I am trying to fit a linear model inside
I have a problem with calling a property() inside a dynamic model in Django.
I've been trying to use a List<> of a Model.Person that I have inside
I have a modal popup with several links inside that have the :confirm and

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.