Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Hasan Khan 7 posts 97 karma points
    Oct 30, 2017 @ 14:38
    Hasan Khan
    0

    View file error

    Hi, we are trying to integrate umbraco with our membership software iMIS. for event booking. We created a view file for view the details of the events

    Here is the view file code

    @model Events.Models.EventRegistrationModel
    

    @using ClientDependency.Core.Mvc @{ Html.RequiresJs("~/scripts/events.js"); }

    @using (Html.BeginUmbracoForm

    @Model.EventDetails.EventTitle
    @Model.EventDetails.EventDates

    if (Model.EventDetails.EventFull)
    {
        <p class="error">This event is now full, please contact the administration office if you have any queries.</p>
    }
    else if (Model.EventDetails.EventClosed)
    {
        <p class="error">@Model.EventDetails.CutOffMessage</p>
    }
    else if (!Model.EventDetails.CanRegister)
    {
        <p class="error" style="text-align: center;"><strong>Please <a href="#" onclick="HighlightLogin(); return false;">log in</a> to register for this event.</strong></p>
        <p class="error" style="text-align: center;"><strong>Non-members please <a href="/new-account">create a new account</a> if you do not have a login.</strong></p>
    }
    
    if (Model.EventDetails.EventPhoto.Length > 0)
    {
        <img class="EventLogo" src="data:image;base64,@System.Convert.ToBase64String(Model.EventDetails.EventPhoto)" />
    }
    <p class="EventDescription">@Html.Raw(Model.EventDetails.EventDescription)</p>
    
    <p class="EventAddress">@Html.Raw(Model.EventDetails.EventAddress)</p>
    <p class="EventDirections">@Html.Raw(Model.EventDetails.EventDirections)</p>
    <p>&nbsp;</p>
    <div class="buttons">
        @if (Model.EventDetails.CanRegister && (!Model.EventDetails.EventFull) && (!Model.EventDetails.EventClosed))
        {
            if (Model.EventDetails.IsCompanyAdministrator)
            {
                <input class="EventButton NextButton pure-button pure-button-primary" type="submit" name="btnRegisterMe" value="Register Me">            
                <input class="EventButton NextButton pure-button pure-button-primary" type="submit" name="btnRegisterGroup" value="Register Colleagues">
            }
            else
            {
                <input class="EventButton NextButton pure-button pure-button-primary" type="submit" name="btnRegister" value="Register">
            }
        }
        else
        {
            <input class="EventButton NextButton pure-button pure-button-primary" type="submit" name="btnRegister" value="Register" disabled="disabled">
        }
    </div>
    
    @Html.Hidden("ser_model", new Microsoft.Web.Mvc.MvcSerializer().Serialize(Model))
    

    }

    And a screenshot of the error:

    enter image description here

    Am I missing something in the view file? or is it something in the surface controller?

    Please help, I would really appreciate that

  • Alex Skrypnyk 6163 posts 24143 karma points MVP 8x admin c-trib
    Oct 30, 2017 @ 15:23
    Alex Skrypnyk
    0

    Hi Hasan

    It looks like you have Events doctype and Events class in your solution.

    Try to specify what Events class are you going to use in 42 line.

    Something like:

    CustomNamespace.Events
    

    Thanks,

    Alex

  • Alex Skrypnyk 6163 posts 24143 karma points MVP 8x admin c-trib
    Nov 01, 2017 @ 13:00
    Alex Skrypnyk
    0

    Hi Hasan

    Did you solve the issue? Share with our community, please )

    Thanks,

    Alex

  • Hasan Khan 7 posts 97 karma points
    Nov 01, 2017 @ 17:02
    Hasan Khan
    100

    Yes after working through it a whole day we figured the word Events was reserved and we were using Events.dll so we had to force the view file to use the dll saying @using Events = Events

    Thanks a lot for your input Alex appreciate it :)

Please Sign in or register to post replies

Write your reply to:

Draft