JQuery UI Dialog Box and Ajax.BeginForm

I have a JQuery UI dialog box. The app allows people to create lists and this dialog lets them specify the listname. Here it is:

<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Klera.Models.CList>" %>

    <%= Html.ValidationSummary("Create was unsuccessful. Please correct the errors and try again.") %>

    <% using (Ajax.BeginForm("CreateList", new AjaxOptions {UpdateTargetId="mylists"})) %>

                <label for="listname">List Name:</label>
                <%= Html.TextBox("listname") %>
                <%= Html.ValidationMessage("listname", "*") %>

            <%=Ajax.ActionLink("Create", "CreateList", new AjaxOptions{}) %>

    <% } %>

I tried making this a regular HTML form and calling the method from JQuery. I'm not sure if I was doing something wrong but the object that was sent back to the controller was null. I'm assuming this is because Jquery doesn't serialize and that I have to specify properties such as name="some form field", etc. in the post action. Is this a correct assumption?

In any event, given the difficulties with starting a post action from JQuery, I tried using the Ajax.ActionLink and Ajax.BeginForm.

When I click for the dialog to show up, nothing comes up now. I'm wondering if this is a timing issue? On $(document).ready(), I am initializing a dialog before loading the partial view:

                autoOpen: false,
                buttons: {
                    Create: function() {
                    Cancel: function() {


I then add an event handler for a click event:

$("#newlist").click(function() {


Not sure exactly why a partial view doesn't show up in this case.


First, cache the dialog, then update its HTML

var dialog=$('#newlist').dialog({
  //dialog options

  url: 'Record/CreateList',
  success: function(html){
    console.log(html);//look good?

Need Your Help

Regular Expression for password validation

javascript regex

can any one help me in creating a regular expression for password validation.

Resize Infragistics UltraGrid to fit its content perfectly

c# winforms grid infragistics ultragrid

How do I resize the entire ultragrid control in code to only show its contents?