Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6532903
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:03:37+00:00 2026-05-25T10:03:37+00:00

I have a View in which I have a code block where I am

  • 0

I have a View in which I have a code block where I am setting some variables and later on using those variables to show or hide some areas…

When I build this website. A compilation error comes up on the line @( stating Syntax Error and another one stating Expression Expected. Can anyone guide me what I am doing wrong here….

@ModelType arwedes.WebShop.Model.Gruppe1Liste
@Code

End Code
@(
    Dim lblInfoTitleText As String = String.Empty
    Dim lblInfoText As String = String.Empty
    Dim panelInfoVisibility As Boolean = False
    Select Case WebSession.Menu
        Case arwedes.WebShop.Web.Navigation.MenuEnum.Home
            lblInfoTitleText = arwedes.WebShop.Model.Text.GetText("Info.HomeTitle", AppSession.Language)
            lblInfoText = arwedes.WebShop.Model.Text.GetText("Info.Home", AppSession.Language)
            panelInfoVisibility = True
        Case arwedes.WebShop.Web.Navigation.MenuEnum.Reservieren
            lblInfoTitleText = arwedes.WebShop.Model.Text.GetText("Info.ReservierenTitle", AppSession.Language)
            lblInfoText = arwedes.WebShop.Model.Text.GetText("Info.Reservieren", AppSession.Language)
            panelInfoVisibility = True
        Case arwedes.WebShop.Web.Navigation.MenuEnum.Kaufen
            lblInfoTitleText = arwedes.WebShop.Model.Text.GetText("Info.KaufenTitle", AppSession.Language)
            lblInfoText = arwedes.WebShop.Model.Text.GetText("Info.Kaufen", AppSession.Language)
            panelInfoVisibility = True
        Case arwedes.WebShop.Web.Navigation.MenuEnum.Verkaufen
            lblInfoTitleText = arwedes.WebShop.Model.Text.GetText("Info.VerkaufenTitle", AppSession.Language)
            lblInfoText = arwedes.WebShop.Model.Text.GetText("Info.Verkaufen", AppSession.Language)
            panelInfoVisibility = True
        Case arwedes.WebShop.Web.Navigation.MenuEnum.Member
            If Request.RawUrl.Contains("login") Then
                lblInfoTitleText = arwedes.WebShop.Model.Text.GetText("Info.MemberTitle", AppSession.Language)
                lblInfoText = arwedes.WebShop.Model.Text.GetText("Info.Member", AppSession.Language)
                panelInfoVisibility = True
            End If
    End Select

    Dim bShowCatMenu As Boolean = False
    Select Case WebSession.Menu
        Case arwedes.WebShop.Web.Navigation.MenuEnum.Home
            bShowCatMenu = True
        Case arwedes.WebShop.Web.Navigation.MenuEnum.Kaufen
            bShowCatMenu = True
        Case arwedes.WebShop.Web.Navigation.MenuEnum.Reservieren
            bShowCatMenu = True
        Case arwedes.WebShop.Web.Navigation.MenuEnum.Member
            If Request.ServerVariables("SCRIPT_NAME") = "/membermenu.aspx" Or Request.ServerVariables("SCRIPT_NAME") = "/welcome.aspx" Then
                bShowCatMenu = True
            End If
    End Select
)
@If panelInfoVisibility Then
    @: <div id="panelInfo">
    @: <p style="text-align: center; font-size: 8pt"> <b> <span id="lblInfoTitle">@lblInfoTitleText</span>
    @: </b><br /> <span id="lblInfo">@lblInfoText</span> </p> </div> 
End If
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T10:03:38+00:00Added an answer on May 25, 2026 at 10:03 am

    Try like this:

    @ModelType arwedes.WebShop.Model.Gruppe1Liste
    @Code
        Dim lblInfoTitleText As String = String.Empty
        Dim lblInfoText As String = String.Empty
        Dim panelInfoVisibility As Boolean = False
        Select Case WebSession.Menu
            Case arwedes.WebShop.Web.Navigation.MenuEnum.Home
                lblInfoTitleText = arwedes.WebShop.Model.Text.GetText("Info.HomeTitle", AppSession.Language)
                lblInfoText = arwedes.WebShop.Model.Text.GetText("Info.Home", AppSession.Language)
                panelInfoVisibility = True
            Case arwedes.WebShop.Web.Navigation.MenuEnum.Reservieren
                lblInfoTitleText = arwedes.WebShop.Model.Text.GetText("Info.ReservierenTitle", AppSession.Language)
                lblInfoText = arwedes.WebShop.Model.Text.GetText("Info.Reservieren", AppSession.Language)
                panelInfoVisibility = True
            Case arwedes.WebShop.Web.Navigation.MenuEnum.Kaufen
                lblInfoTitleText = arwedes.WebShop.Model.Text.GetText("Info.KaufenTitle", AppSession.Language)
                lblInfoText = arwedes.WebShop.Model.Text.GetText("Info.Kaufen", AppSession.Language)
                panelInfoVisibility = True
            Case arwedes.WebShop.Web.Navigation.MenuEnum.Verkaufen
                lblInfoTitleText = arwedes.WebShop.Model.Text.GetText("Info.VerkaufenTitle", AppSession.Language)
                lblInfoText = arwedes.WebShop.Model.Text.GetText("Info.Verkaufen", AppSession.Language)
                panelInfoVisibility = True
            Case arwedes.WebShop.Web.Navigation.MenuEnum.Member
                If Request.RawUrl.Contains("login") Then
                    lblInfoTitleText = arwedes.WebShop.Model.Text.GetText("Info.MemberTitle", AppSession.Language)
                    lblInfoText = arwedes.WebShop.Model.Text.GetText("Info.Member", AppSession.Language)
                    panelInfoVisibility = True
                End If
        End Select
    
        Dim bShowCatMenu As Boolean = False
        Select Case WebSession.Menu
            Case arwedes.WebShop.Web.Navigation.MenuEnum.Home
                bShowCatMenu = True
            Case arwedes.WebShop.Web.Navigation.MenuEnum.Kaufen
                bShowCatMenu = True
            Case arwedes.WebShop.Web.Navigation.MenuEnum.Reservieren
                bShowCatMenu = True
            Case arwedes.WebShop.Web.Navigation.MenuEnum.Member
                If Request.ServerVariables("SCRIPT_NAME") = "/membermenu.aspx" Or Request.ServerVariables("SCRIPT_NAME") = "/welcome.aspx" Then
                    bShowCatMenu = True
                End If
        End Select
    End Code
    @If panelInfoVisibility Then
        @: <div id="panelInfo">
        @: <p style="text-align: center; font-size: 8pt"> <b> <span id="lblInfoTitle">@lblInfoTitleText</span>
        @: </b><br /> <span id="lblInfo">@lblInfoText</span> </p> </div> 
    End If
    

    This being said, code like the one you wrote doesn’t belong to a view. So the real solution to your problem would be to externalize it (helper, view model?).

    Can you ever imagine giving your views to a web designer? He will scream out in despair.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a FrameLayout view which contains one (MapView-like) control and some additional buttons
I have a Drupal view which should output a video player using flash. I
I have a block of preformatted code (<pre>) which overflows horizontally so there is
I have a grid view code below which have divided into 3 column .
I have a WPF application which uses some library code for authentication which needs
I have recently found the power of setting variables to a block in the
I have a view which contains a form, the form posts and the data
I have a view which is composed of top, left and bottom headers and
I have a view which was working fine when I was joining my main
I have a view which I built in Interface builder with a tableview and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.