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 8842475
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:58:04+00:00 2026-06-14T10:58:04+00:00

Sorry for asking such a simple question but I lost really long time trying

  • 0

Sorry for asking such a simple question but I lost really long time trying to solve this. At the end, I decide to ask you.

Let’s start with the code base :

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace Navigation.Helpers
{
    public static class NavigationBarSE
    {
        public static MvcHtmlString RenderNavigationBarSE(this HtmlHelper helper, String[] includes)
        {
            return new MvcHtmlString("Y U no Work??");
            //NavTypeSE res = new NavTypeSE(includes);
            //String ress = res.toString();
            //return new MvcHtmlString(ress);

        }    
    }
}

In the original form, this helper needs to return a String that produced by the NavTypeSE class. But in the end, to get a result, I only want it to return a String for me… But it didn’t do that…

Before you ask, I can say that,

<add namespace="Navigation.Helpers"/>

exists in my Web.config file in Views folder.

For detailed information, my NavTypeSE class as below :

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Navigation.Helpers
{
    //Creates a Navigation Menu Type which includes Previous, Next and Validate Buttons
        public class NavTypeSE
        {
        Boolean pr, nt, vld;
        Boolean Previous { get; set; }
        Boolean Next { get; set; }
        Boolean Validate { get; set; }
        public NavTypeSE(Boolean Previous, Boolean Next, Boolean Validate)
        {
            this.pr = Previous;
            this.nt = Next;
            this.vld = Validate;
        }
        public NavTypeSE() { }

        public NavTypeSE(String[] inc)
        {
            for(int i=0; i<inc.Length; i++)//foreach (String s in inc)
            {
                String s = inc[i]; // Don't need for foreach method.
                if (s.Equals("previous")||s.Equals("Previous"))
                {
                    this.pr = true;
                }
                else if (s.Equals("next") || s.Equals("Next"))
                {
                    this.nt = true;
                }
                else if (s.Equals("validate") || s.Equals("Validate"))
                {
                    this.vld = true;
                }
                else
                {
                    this.pr = false; this.nt = false; this.vld = false;
                }
            }

        public String toString()
        {
            return "Previous: " + this.pr + ", Next: " + this.nt + ", Validate: " + this.vld;
        }
    }
}

Also, in my View, I call this Helper like below :

@{
    String[] str = new String[] { "Previous", "next", "Validate" };
    Html.RenderNavigationBarSE(str);
}

This is just a base for a project. And I’m starter level in both C# and ASP.NET MVC Platform. Sorry for spending your time.

  • 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-06-14T10:58:05+00:00Added an answer on June 14, 2026 at 10:58 am

    Your RenderNavigationBarSE writes nothing into the Response just returns a MvcHtmlString.

    So you need to put an @ before the method call to tell Razor engine that you want to write the returned MvcHtmlString into the response (otherwise inside a code block it just executes your method and throws away the returned value)

    @{
        String[] str = new String[] { "Previous", "next", "Validate" };
    }
    
    @Html.RenderNavigationBarSE(str);
    

    You can read more about the Razor syntax:

    • Introduction to ASP.NET Web Programming Using the Razor Syntax (C#)

    • There is also a C# Razor Syntax Quick Reference

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

Sidebar

Related Questions

Sorry for asking such a beginner question but I can't figure this out. I
Im really sorry for asking such a newby question but I dont know what
Sorry for asking such a general question but this has been bugging me for
First off, I'm sorry for asking such a simple question in such a sophisticated
Sorry for asking a basic question like this but I've been reading on this
Sorry to be asking such similar question again, I am trying to read the
Sorry for asking such an easy question, but im a beginner I was following
Sorry for asking another time help on this matter, but all others posts didn't
sorry for asking this question but i didn't found the right solution for this
Sorry for asking such a basic question but so far all the examples that

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.