Results 1 to 2 of 2

Thread: [RESOLVED] Actionlink not working.

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Dunmow,Essex,England
    Posts
    898

    Resolved [RESOLVED] Actionlink not working.

    Hi All,

    I'm using MVC3 with Razor.

    In one of my views I have:
    Code:
     <div style="width: 100em; float: left">
                <button id="saveButton" name="submitButton" value="save" type="submit">
                    Save</button>
                    @Html.ActionLink("Cancel", "Edit", "ComputerBreakDownSection", new { sectionID = Model.SectionID, policyZoneId = Model.PolicyZoneID, fred = 1}, new { id = "cancelLink" })
           </div>
    and in my controller I have:

    Code:
           public ActionResult Edit(int sectionID, int policyZoneId)
            {
                ComputerBreakDownSectionViewModel viewModel = _gridService.GetComputerBreakDownSectionViewModel(policyZoneId, sectionID);
                return View(viewModel);
            }        
    
            [HttpPost]
            public ActionResult Edit(int sectionID, int policyZoneId, int fred)
            { ........
    when I press my save button on the form I am expecting the controller to enter my HttpPost Edit ActionResult. However neither of the Edit actions in my controller are triggered on the press of the button. Am I missing something from the ActionLink

  2. #2
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: [RESOLVED] Actionlink not working.

    Hi,

    This isn't exactly the same code however, it does use razor for that version of the project. I used that project to help me with a non-razor version for school.
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width