This is a migrated thread and some comments may be shown as answers.

[Solved] cant get Html.BeginForm to work with TabStrip

1 Answer 116 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
william
Top achievements
Rank 1
william asked on 11 Jul 2011, 02:06 PM
Hi all,

Please find below my code. if I remove the @using (Html.BeginForm()) { and corresponding } I obtain no errors. However I receive 2 errors in the IDE ; expected and Invalid expression term ; both set to line 1

Can anybody tell me where I've gone wrong please.

@model GRID.ViewModels.ComputerBreakDownSectionViewModel
@{
    ViewBag.Title = "Edit";
}
@Html.Hidden("policyZoneID", ViewData["policyZoneID"])
@Html.Hidden("sectionID", ViewData["sectionID"])
@Html.Hidden("tabIndex", ViewData["tabIndex"])
@{Html.RenderPartial("PolicyHeader", ViewData["policy"]);}
<div class="frame details">
<h2>
        Edit Computer Breakdown Section</h2>
@using (Html.BeginForm())
{
    <div>
        @Html.ValidationSummary()
    </div>
    @{Html.Telerik().TabStrip()
          .Name("ComputerBreakdownTabStrip")
          .Effects(fx => fx.Expand()
            .Opacity()
            .OpenDuration(150)
            .CloseDuration(150))
            .Items(tabstrip =>
                {
                    tabstrip.Add()
                        .Text("Section")
                        .Content(Html.Partial("CreateEditPartial", ViewData["ComputerBreakdownSection"]).ToHtmlString());
                    tabstrip.Add()
                        .Text("Risks");
                       // .Content(Html.Partial("RiskIndex"), Model.ComputerBreakdownRisks, new ViewDataDictionary { { "policyZoneID", ViewData["policyZoneID"] }, { "sectionID", ViewData["sectionID"] } }).ToHtmlString();
                })
            .SelectedIndex(ViewData["tabIndex"] != null ? Convert.ToInt32(ViewData["tabIndex"].ToString()) : 0)
            .Render();           
    }
      <script type="text/javascript">
          $("#saveButton").button({ icons: { primary: "ui-icon-check"} });
          $("#cancelLink").button({ icons: { primary: "ui-icon-close"} });
          $("#risksLink").button({ icons: { primary: "ui-icon-zoomin"} });
          $(".editLink").button({ icons: { primary: "ui-icon-zoomin"} });
          $(".deleteLink").button({ icons: { primary: "ui-icon-close"} });
          $(".addRisk").button({ icons: { primary: "ui-icon-plus"} });
    </script>  
 }
 </div>

1 Answer, 1 is accepted

Sort by
0
william
Top achievements
Rank 1
answered on 12 Jul 2011, 12:09 PM
ok once I place the content of the form inside <div> tags it worked
Tags
TabStrip
Asked by
william
Top achievements
Rank 1
Answers by
william
Top achievements
Rank 1
Share this question
or