0

フォーム送信ボタンでセールスフォースに値を保存しようとしています。ビューかみそりで検証を使用してフォームアクションメソッドを使用する方法がわかりません....

これは、セールスフォースにエントリを作成するために、フォームの送信ボタンに実装する必要があるセールスフォースのコードです。

<form action="https://www.salesforce.com/servlet/..." method="POST" >
<input type=hidden name="oid" value="111">
<input type=hidden name="retURL" value = "http://test" />

ここに私のビューページがあります:

@model nd.Models.PopupDemoModel 
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>


@using (Html.BeginForm()){
    @Html.ValidationSummary(true)
    <fieldset>   
    <div class="editor-label grid_2">
        @Html.LabelFor(model => model.first_name )
    </div>
    <div class="editor-field grid_3">
        @Html.TextBoxFor(model => model.first_name , new { @class = "demo-field-longer" })
    </div>
    <div class="grid_3 error long" style="margin-left:250px">
    @Html.ValidationMessageFor(model => model.first_name )
    </div>
    <div class="clear"></div>
    <div class="editor-label grid_2">
        @Html.LabelFor(model => model.email )
    </div>
    <div class="editor-field grid_3">
        @Html.TextBoxFor(model => model.email , new { @class = "demo-field-longer" })
    </div>
    <div class="grid_3 error long" style="margin-left:250px">
    @Html.ValidationMessageFor(model => model.email )
    </div>
    <div class="clear"></div>
    <div class="editor-label grid_2">
        @Html.LabelFor(model => model.phone )
    </div>
    <div class="editor-field grid_3">
        @Html.TextBoxFor(model => model.phone , new {@class="demo-field-longer"})
    </div>
    <div class="grid_3 error long" style="margin-left:250px">
    @Html.ValidationMessageFor(model => model.phone )
    </div>
    <div class="clear"></div>
    <div class="editor-label grid_2">
        @Html.LabelFor(model => model.company )
    </div>
    <div class="editor-field grid_3">
        @Html.TextBoxFor(model => model.company , new { @class = "demo-field-longer" })
    </div>
    <div class="grid_3 error long" style="margin-left:250px">
    @Html.ValidationMessageFor(model => model.company)
    </div>
    <div class="clear"></div>

    <div class="clear"></div>
    <div class="grid_2 sub-spacer">&nbsp;</div>
    <div class="editor-field grid_2 submit">
        <input type="submit" value="Submit" id="demo-submit-button"/><br />
        @ViewData["DemoMessage"]
    </div>
    </fieldset>
} 

どんな助けでも大歓迎です....

4

1 に答える 1

0

これは次のように実行できます。

@using (Html.BeginForm("Action", "Controller", FormMethod.Post, new { id = "cssClassorId" }))  {

 }
于 2013-02-07T19:11:07.943 に答える