Click here to Skip to main content
15,889,116 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a this view in asp.net mvc 4:
C#
public class BPLModel
    {
        public BPLModel()
        {
            LLIST = new List<SelectListItem>();
         }
         public int BookId { get; set; }

        [Remote("IsCodeExist", "BPL", ErrorMessage = "code is not exist")]
        public string BookCode { get; set; }

        public string Bookname { get; set; }

        public string AuthorName { get; set; }

        public string TranslatorName { get; set; }

        public string LevelName { get; set; }
        public IEnumerable<SelectListItem> LLIST { get; set; }
    }


and this model:
HTML
model BookPublication.Models.BPLModel

@{
    ViewBag.Title = "create";
}


@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>BPLModel</legend>
      
<!--bookcode, bookname from table book.
    AuthorName, TranslatorName form table author.
    LevelName form table bpl -->

        <div class="editor-label">
            @Html.LabelFor(model => model.BookCode)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.BookCode)
            @Html.ValidationMessageFor(model => model.BookCode)
        </div>
            <div class="editor-label">
                @Html.LabelFor(model => model.Bookname)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.Bookname)
                @Html.ValidationMessageFor(model => model.Bookname)
            </div>

            <div class="editor-label">
                @Html.LabelFor(model => model.AuthorName)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.AuthorName)
                @Html.ValidationMessageFor(model => model.AuthorName)
            </div>

            <div class="editor-label">
                @Html.LabelFor(model => model.TranslatorName)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.TranslatorName)
                @Html.ValidationMessageFor(model => model.TranslatorName)
            </div>
        }

        <p>
<input type="submit" name="submit1" value="fill">
        </p>
        <div class="editor-label">
            @Html.LabelFor(model => model.LevelName)
        </div>
        <div class="editor-field">
            <div class="editor-field">
                @Html.DropDownListFor(model => model.LevelId, Model.LLIST)
            </div>
        </div>

        <p>
            <input type="submit" value="create" />

        </p>
    </fieldset>
}


i want, when the user fill the bookcode editorfor, and click submit1, fills bookname editorfor, AuthorName editorfor, TranslatorName editorfor

how can i do?
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900