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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:20:15+00:00 2026-06-12T07:20:15+00:00

I have the following partial view that I am trying to get to call

  • 0

I have the following partial view that I am trying to get to call the action(“Search”) of a controller(“Message”) that is inside a View (“Message/Create”).

I cannot seem to get the controller’s action to fire at all. I have tried so many combinations but can not seem to get anywhere with it.

The partial view is meant to have a textbox and button for filtering a HTML table.

Partial (“_ProfileList.cshtml”)

@model MyApp.Models.MessagingModels.ViewModels.CreateMessageViewModel
@{
    var altLine = false;
}

<div>
    @using (Ajax.BeginForm("Search", "Messages", new AjaxOptions { UpdateTargetId = "dvProducts", HttpMethod = "Post" }))
    {
        <label for="Searchbox">Find Profile :</label>
        @Html.TextBox("SearchString", ViewBag.CurrentFilter as string)
        <input class="ui-state-default ui-corner-all" type="submit" value="Search" />
    }
    <br />
    <br />
</div>
<div id="dvProducts" class="datagrid">
    <table>
        <thead>
            <tr>
                <th>&nbsp;</th>
                <th>Profile Name</th>
                <th>Description</th>
            </tr>
        </thead>
        <tbody>
            @foreach (var item in Model.ListOfProfiles)
            {
                <tr class='@(altLine ? "alt" : "norm")'>
                    <td>
                        <input type="radio" name="SelectedProfile" value="@item.ID" id="SelectedProfile_@item.ID" /></td>
                    <td>
                        @if (item.Favourite)
                        {
                            <img src="@Url.Content("~/Images/favourite-star.png")" alt="Favourite" />
                        }

                        @Html.DisplayFor(modelItem => item.Name)</td>
                    <td>@Html.DisplayFor(modelItem => item.Description)</td>
                </tr>
            }
        </tbody>
        <tfoot>
        </tfoot>
    </table>
</div>

CreateMessageViewModel

public class CreateMessageViewModel
{
        private List<ProfileModels.DataModels.Profile> _listOfProfiles; 


        public List<ProfileModels.DataModels.Profile> ListOfProfiles 
        {
            get
            {
                using(var ctx = new EFDataContext())
                {
                    var tmp = ctx.Profiles.OrderBy(p => p.Name).ToList();
                    //_listOfProfiles = ctx.Profiles.OrderBy(p => p.Name).ToList().ToPagedList(1, 10);
                    return _listOfProfiles;
                }
            }
            set { _listOfProfiles = value; }
        }


       //..removed for brevity


}

Message View

@model MyApp.Models.MessagingModels.ViewModels.CreateMessageViewModel
@{
    ViewBag.Title = "Create";
}
<div class="grid_12">

    @using (Html.BeginForm())
    {
        <div id="SignupForm">
            <fieldset>
                <legend>Profile</legend>
                <strong>What profile would you like to target?</strong>
                 @{ Html.RenderPartial("_ProfilesList", Model); }
            </fieldset>
            <fieldset>
                <legend>Region</legend>
            </fieldset>
            <fieldset>
                <legend>Message</legend>
                <strong>What type of message do you want to send?</strong><br />
                <div id="message-type-selector">
                    <input type="radio" name="messagetype" value="SMS" id="message-type-sms" checked="checked" />
                    <label for="message-type-sms">SMS</label><br />
                    <input type="radio" name="messagetype" value="Email" id="message-type-email" />
                    <label for="message-type-email">Email</label><br />
                </div>
                <br />
                <div id="Message-Options-SMS">
                    @Html.LabelFor(model => model.SMSMessageText)
                    <br />
                    @Html.EditorFor(model => model.SMSMessageText)
                    <div id="smscharactersremaining">100 characters remaining</div>

                    <button id="check-textarea">
                        Check Spelling
                    </button>
                    &nbsp;
                    <span class="loading">loading..</span>



                </div>
                <div id="Message-Options-Email">
                    @Html.LabelFor(model => model.EmailMessageText)
                    <br />
                    <textarea id="EmailMessageText" name="EmailMessageText" cols="50" rows="15"></textarea>
                    <link href="@Url.Content("~/content/jHtmlArea.css")" rel="stylesheet" type="text/css" />
                    <script src="@Url.Content("~/Scripts/jHtmlArea-0.7.5.min.js")" type="text/javascript" ></script>
                    <link href="@Url.Content("~/content/jHtmlArea.css")" rel="stylesheet" type="text/css" />
                    <link href="@Url.Content("~/Content/jHtmlArea.ColorPickerMenu.css")" rel="stylesheet" />
                    <script src="@Url.Content("~/Scripts/jHtmlArea.ColorPickerMenu-0.7.0.min.js")" type="text/javascript" ></script>




                </div>

            </fieldset>
            <fieldset>
                <legend>Tracking</legend>

            </fieldset>
            <fieldset>
                <legend>Confirmation</legend>

            </fieldset>
            <p>@Html.ValidationSummary(false)
                <input id="SaveAccount" type="button" value="Submit form" />
            </p>
        </div>
    }
</div>
<div class="clear"></div>

MessagesController

public class MessagesController : Controller
    {
        private readonly EFDataContext db = new EFDataContext();

        public ActionResult Search(string CurrentFilter)
        {
            var model = from p in db.Profiles
                        where p.Name.Contains(CurrentFilter) || p.Description.Contains(CurrentFilter)
                        select p;


            var vmm = new CreateMessageViewModel
                          {
                              ListOfProfiles = model.ToList()
                          };

            return PartialView("_ProfilesList", vmm);
        }
}
  • 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-12T07:20:16+00:00Added an answer on June 12, 2026 at 7:20 am

    You have several problems, but I think the biggest is that you have nested forms. Your Ajax.BeginForm is rendered within another Html.BeginForm.

    Nested tables are not legal HTML and browsers may or may not honor them.

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

Sidebar

Related Questions

In my rails view(index.html.erb), i have following structure <div> <%= render :partial => create
I am trying to create a partial view I call ImageViewer. It will be
I'm trying to make a partial view that acts as the following: When user
in a partial view I have the following: <%Html.RenderAction(MVC.User.GetComments(Model.UserGroupName)); %> can I render a
I have the following code in a partial view (using Spark): <span id=selectCount>0</span> video(s)
I have a partial view that sometimes needs to collect data and sometimes just
Okay I am trying to make a partial view and controller whose job it
I have an MVC3 application with Razor and I created a View that inside
I am trying to include a partial view in a view that is located
I have a strongly typed partial view that should show the name of an

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.