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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T22:46:45+00:00 2026-06-02T22:46:45+00:00

I’m just starting out with MVC, and I’m trying to build a sample, proof

  • 0

I’m just starting out with MVC, and I’m trying to build a sample, proof of concept page for mvc interaction with jquery-mobile. I’ve searched for an answer on this, but I don’t think I know enough yet to formulate proper queries.

On my view, I am trying to generate output that functions like this (sampled from the jqm demo site) :

        <ul data-role="listview" data-inset="true">
        <li><a href="index.html">
            <h3>Stephen Weber</h3>
            <p><strong>You've been invited to a meeting at Filament Group in Boston, MA</strong></p>
            <p>Hey Stephen, if you're available at 10am tomorrow, we've got a meeting with the jQuery team.</p>
            <p class="ui-li-aside"><strong>6:24</strong>PM</p>
        </a></li>
        <li><a href="index.html">
            <h3>jQuery Team</h3>
            <p><strong>Boston Conference Planning</strong></p>
            <p>In preparation for the upcoming conference in Boston, we need to start gathering a list of sponsors and speakers.</p>
            <p class="ui-li-aside"><strong>9:18</strong>AM</p>
        </a></li>
    </ul>

So, I’m working it like this :

@foreach (var item in Model) {
    <li>
          @Html.ActionLink( LargeExpandedMultiContentText, "Edit", new { id = item.SysID })
        </li>
}

My question, which I don’t know a simple way of asking, is, how, in MVC terms, do I fill the variable, so that the href generated by ActionLink() matches the style I’ve sampled from the jqm website?

I’ve tried this, and while it almost works, I’m sure its not the ‘right’ way, especially when I get to a spot of pulling “Steven Weber” and other strings out the the item/Model…plus it encodes the text, but I’m sure there’s a way to deal with that easy enough.

@foreach (var item in Model) {
    <li>
        @{ String txt =  "<h3>Stephen Weber</h3><p><strong>You've been invited to a meeting at Filament Group in Boston, MA</strong></p><p>Hey Stephen, if you're available at 10am tomorrow, we've got a meeting with the jQuery team.</p>         <p class=\"ui-li-aside\"><strong>6:24</strong>PM</p>";
        }
        @Html.ActionLink( txt, "Edit", new { id = item.SysID })
    </li>
}

Thanks, I appreciate your help

Brian

  • 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-02T22:46:47+00:00Added an answer on June 2, 2026 at 10:46 pm

    I’m not sure it’s possible to use Html.ActionLink to build such a complex action link. That said, the Html Helpers are just supposed to be helper functions to make your life easier by giving you shortcuts to render HTML in ways commonly required. You don’t need to use them. In this case, I think instead you should use a normal html tag, and Url.Action to create the correct URL.

    If you wanted to include this information within an enumerable model I’d probably do something like:

    @foreach (var item in Model) {
        <li><a href="@Url.Action(item.Action)">
            <h3>@item.Name</h3>
            <p><strong>@item.Title</strong></p>
            <p>@item.Message</p>
            <p class="ui-li-aside"><strong>@item.Time</strong>@item.TimePeriod</p>
        </a></li>
    }
    

    Note: the function you were looking for to display contents without encoding them is @Html.Raw

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

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have just tried to save a simple *.rtf file with some websites and
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am trying to understand how to use SyndicationItem to display feed which is
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I am trying to render a haml file in a javascript response like so:

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.