Click here to Skip to main content
15,912,205 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
@model List<habg.Models.OtherServices>

@using (Html.BeginUmbracoForm<habg.pocos.OtherservicesSurfaceController>("otherservices"))
{
    @Html.AntiForgeryToken()
    if (Model!= null)
    {
        
        @if (Model != null && Model.Count > 0) 
        {
            int j=0;
            foreach(var i in Model.FindAll(i=>i.TourType == 1).ToList())
            {
                if(j==0)
                {
                    <h4>Organised Tour</h4>
                    <ul class="os_list">
                }
                <li>
                    @Html.HiddenFor(a => a[j].TourServiceId)
                    @Html.HiddenFor(a=>a[j].BookingId)
                    <div class="imgHolder"><img src="@System.Web.Configuration.WebConfigurationManager.AppSettings["AdminProductImage_VirtualPath"]@i.ImagePath" /></div><!--imgHolder-->
                    <div class="imgInfo">
                        @i.TourService_Title
                        <p>@i.TourService_Description</p>
                        Price : @i.Price
                    </div><!--imgInfo-->
                    <div class="os_form">
                        @i.StartDate to @i.EndDate
                        <span><label>No. of person</label>@Html.TextBoxFor(a => a[j].PersonCnt, new { @class = "personNo topInsideShadow numericOnly", @maxlength="2" })</span>
                        <span><label>Check to avail</label>@Html.CheckBoxFor(a=> a[j].IsSelected)</span>
                    </div><!--os-form-->
                </li>
                j = j + 1;
            }
         }
        </ul>
    <input type="submit" value="submit" class="submitBtn" />
    }
    
}

The error I am getting -
The using block is missing a closing "}" character. Make sure you have a matching "}" character for all the "{" characters within this block, and that none of the "}" characters are being interpreted as markup.
Posted
Updated 19-Feb-15 22:14pm
v3

1 solution

I tidied up your code:
HTML
@model List<habg.models.otherservices>

@using (Html.BeginUmbracoForm<habg.pocos.otherservicessurfacecontroller>("otherservices"))
{
    @Html.AntiForgeryToken()
    if (Model!= null)
    {
        if (Model.Count > 0)
        {
            int j=0;
            foreach(var i in Model.FindAll(i=>i.TourType == 1).ToList())
            {
                if(j==0)
                {
                    <h4>Organised Tour</h4>
                    <ul class="os_list">                        
                        <li>
                            @Html.HiddenFor(a => a[j].TourServiceId)
                            @Html.HiddenFor(a=>a[j].BookingId)
                            <div class="imgHolder"><img src="@System.Web.Configuration.WebConfigurationManager.AppSettings[" adminproductimage_virtualpath="]@i.ImagePath" /></div><!--imgHolder-->
                            <div class="imgInfo">
                                @i.TourService_Title
                                <p>@i.TourService_Description</p>
                                Price : @i.Price
                            </div><!--imgInfo-->
                            <div class="os_form">
                                @i.StartDate to @i.EndDate
                                <span><label>No. of person</label>@Html.TextBoxFor(a => a[j].PersonCnt, new { @class = "personNo topInsideShadow numericOnly", @maxlength="2" })</span>
                                <span><label>Check to avail</label>@Html.CheckBoxFor(a=> a[j].IsSelected)</span>
                            </div><!--os-form-->
                        </li>
                        j = j + 1;

                    </ul>
                }
                    <input type="submit" value="submit" class="submitBtn" />
            }
        }
    }
}</habg.pocos.otherservicessurfacecontroller></habg.models.otherservices>

You had too many brackets and too many "@" symbols.
 
Share this answer
 

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