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

  • Home
  • SEARCH
  • 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 8867221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T16:58:48+00:00 2026-06-14T16:58:48+00:00

Un Expected result while rendering @Html.ActionLink in the browser. Below are the code i

  • 0

Un Expected result while rendering @Html.ActionLink in the browser. Below are the code i written in jqGrid for displaying link column.

{ name: 'Restart',
                         formatter: function (cellvalue, options, rowObject) {
                             var x = '@Html.ActionLink( "Restart", "Dashboard", new { requestId ="myId"  }, new { onclick = "return confirm('Are you sure to Restart?');" })';
                             return x.replace("myId",rowObject[8]);
                         }, align: 'left', width: 100
                     } 

After rendering in the browser it displayed like this

<a href="/DashBoard/Dashboard?requestId=2362e13b-e4fc-4140-b7ad-1bd0e82b6bde" onclick="return confirm('Are you sure to Restart?');">Restart</a>

When I replace @Html.ActionLink( “Restart”, “Restart”) in the above code.It displays correctly like this.

 <a href="/Dashboard/Restart?requestId=2362e13b-e4fc-4140-b7ad-1bd0e82b6bde" onclick="return confirm('Are you sure to Restart?');">Restart</a>

Why ASP.NET MVC4 produce Un Expected result? Is there any fix for this issue?

  • 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-14T16:58:50+00:00Added an answer on June 14, 2026 at 4:58 pm

    You shouldn’t consider this behaviour as unexpected. You are using following overload of LinkExtensions.ActionLink method:

    public static MvcHtmlString ActionLink(
        this HtmlHelper htmlHelper,
        string linkText,
        string actionName,
        Object routeValues,
        Object htmlAttributes
    )
    

    So the second parameter is action name and controller name defaults to current controller.

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

Sidebar

Related Questions

The example code of section 10.6, the expected result is: after several iterations, the
Steps: Run the build including unit tests. Expected result: the unit tests are executed
Update: I've corrected the post, so the question is closed. Expected result: Menu width
I am using Ruby's Test::unit to compare the result of generated html with the
Why in the following code .height() returns 95 rather than 100, while .width() returns
Does someone know why the following produces the expected result - (2 4 6)
I have one doubt regarding xml reading using Stax Parser. Expected Result: hq_seq_mast {SEQ_VAL=SEQ_VAL,
Please have a look at the below SQL code. DECLARE @RET TABLE(OID BIGINT NOT
How do I fetch unique list of object arrays in below code: import java.util.*;
I wrote the most innocuous C program but I can't get the expected result.

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.