I have created a ASP.net application,where i change the language base on its query string. I have two servers both are https ,but one is redirected by netscaler

https://testMyLiveCode.com
https://myNetscalerServer.com/testapply-aU4uC6Q9dU94nHzVZA6zdtaQE433Xa2a/?

For eg

https://testMyLiveCode.com/?ln=en

This is my asp.net code

string strNewLanguage = Request.QueryString["ln"].ToLower();
SessionHelper.Language = strNewLanguage ;
string strNewURL = Request.RawUrl.ToLower().Replace("ln=" + Request.QueryString["ln"], "");
 Response.Redirect(strNewURL);

What i actually do is that change the language depending on querystring and change the querystring and redirects

THis works perfectly with my https Server

https://testMyLiveCode.com/?ln=en

But this doesnt work with my netscaler url

https://myNetscalerServer.com/testapply-aU4uC6Q9dU94nHzVZA6zdtaQE433Xa2a/? 

This is my url

And after i added the querystring to it,it does not work https://myNetscalerServer.com/testapply-aU4uC6Q9dU94nHzVZA6zdtaQE433Xa2a/??ln=en

Can anyone help why this is not working as the url already has a ? in it??? Thanks for any help

This is my Payment controller and from this controller I want to change the value of a Status column from available to booked in property table

[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Create([Bind(Include="PaymentID,PaymentType,BookingID,TotalAmount,BankName,AccountNumber,PaymentTitle,PaymentDate")] Payment payment)
{

        db.Payments.Add(payment);
        db.SaveChanges();
        if (payment.PaymentType == PaymentType.Installment)
        {

            return RedirectToAction("Create", "Installment");
        }
        else
        {                             
            RedirectToAction("Index", "Property");

        }


    ViewBag.PaymentID = new SelectList(db.Payments, "PaymentID", "PaymentID", payment.PaymentID);
    ViewBag.BookingID = new SelectList(db.Payments, "BookingID", "BookingID", payment.BookingID);

    return View();
}

I tried this query but it's not working

var bc = db.Property.Where(a => a.Status == Status.Available);

So I'm making this webpage in ASP.NET and I'm using Telerik to add controls. Basically I've seen this error message a few times now, but they always disappear by accident. This time I want to make myself a script on how to handle these kind of error messages, because let's be honest, they are pretty vague.

I could show you the .aspx page markup, but it's 1854 lines long, including javascript and styling.

Uncaught Error: Sys.InvalidOperationException: A control is already associated with the element.
    at Function.Error$create [as create] (ScriptResource.axd?d=D9drwtSJ4hBA6O8UhT6CQhGMLGaPJPBdtRlUsVMy7uq-wvax2qZNzcGY_AK-UZZ7G_ZsBajxk46XcD…:237)
    at Function.Error$invalidOperation [as invalidOperation] (ScriptResource.axd?d=D9drwtSJ4hBA6O8UhT6CQhGMLGaPJPBdtRlUsVMy7uq-wvax2qZNzcGY_AK-UZZ7G_ZsBajxk46XcD…:387)
    at Telerik.Web.UI.RadAjaxManager.Sys$UI$Control (ScriptResource.axd?d=D9drwtSJ4hBA6O8UhT6CQhGMLGaPJPBdtRlUsVMy7uq-wvax2qZNzcGY_AK-UZZ7G_ZsBajxk46XcD…:5273)
    at Function.Type$initializeBase [as initializeBase] (ScriptResource.axd?d=D9drwtSJ4hBA6O8UhT6CQhGMLGaPJPBdtRlUsVMy7uq-wvax2qZNzcGY_AK-UZZ7G_ZsBajxk46XcD…:737)
    at Telerik.Web.UI.RadAjaxManager.Telerik.Web.UI.RadAjaxControl (ScriptResource.axd?d=sF8Y0c2qLAfpveBK9gLo7DYIWpF0kHA4q-Pt9ojt_VJ_ybOgW_Pq9RzyqLJ95IuBuRuNgHRg2lCAJn…:2)
    at Function.Type$initializeBase [as initializeBase] (ScriptResource.axd?d=D9drwtSJ4hBA6O8UhT6CQhGMLGaPJPBdtRlUsVMy7uq-wvax2qZNzcGY_AK-UZZ7G_ZsBajxk46XcD…:737)
    at new Telerik.Web.UI.RadAjaxManager (ScriptResource.axd?d=sF8Y0c2qLAfpveBK9gLo7DYIWpF0kHA4q-Pt9ojt_VJ_ybOgW_Pq9RzyqLJ95IuBuRuNgHRg2lCAJn…:740)
    at Sys$Component$create (ScriptResource.axd?d=D9drwtSJ4hBA6O8UhT6CQhGMLGaPJPBdtRlUsVMy7uq-wvax2qZNzcGY_AK-UZZ7G_ZsBajxk46XcD…:3811)
    at <anonymous>:2:5
    at Sys$_Application$add_init [as add_init] (ScriptResource.axd?d=D9drwtSJ4hBA6O8UhT6CQhGMLGaPJPBdtRlUsVMy7uq-wvax2qZNzcGY_AK-UZZ7G_ZsBajxk46XcD…:4737)

My question would rather be, how do I tackle an error message like this one? Where do I look, what could be possible problems to cause this to happen?

Also, can I perhaps debug on something to figure out what element it's complaining about?

This question already has an answer here:

I'm trying to retrieve data results that are alike with what is searched for from a database and upload it in a gridview. Ok so this is what my code looks like:

protected void Page_Load(object sender, EventArgs e)
{
    string searchVal = (string)(Session["field1"]);
    SqlConnection con = new SqlConnection("my connection string");
    con.Open();
    SqlCommand comm = new SqlCommand("SELECT * FROM LogHelp WHERE Message LIKE '%" + searchVal + "%'", con);
    SqlDataReader reader = comm.ExecuteReader();
    var errorModel = new ErrorModel();
    List<ErrorModel> errorModelList = new List<ErrorModel>();
    // Call Read before accessing data.
    while (reader.Read())
    {

        errorModel.ErrorNo = reader["ErrorNo"].ToString();
        errorModel.Error = (DateTime)reader["Error "];
        errorModel.ErrorFix = reader["ErrorFix "].ToString();
        errorModelList.Add(errorModel);

    }

    // Call Close when done reading.
    reader.Close();

    if (errorModelList.Count > 0)
    {

    }
    else
    {
        label2.Text = "No records available for your search";
    }
}

ok so what I want to do is if the errorModelList has values, it will then populate the values in a Gridview(Gridview1) but i don't know how to go about that.

Also the front-end is written in ASP.net. here's a bit of the code for more clarification:

<form id="form1" runat="server">
<div>
    <h3 style="text-align:center;"><b><u>Search Results:</u></b></h3>
    <asp:label runat="server" text="Label" ID="label2"></asp:label>
</div>
</form>

<asp:GridView ID="GridView1" runat="server"></asp:GridView>

and the errorModel used has 3 methods : ErrorNo, Error, ErrorFix which are also the names of all the columns in the database

I try to implement a loop displaying small boxes.. The following first code has for result this :

second image

(code) :

<div class="row">
    <div class="col-lg-3 col-xs-6">
    <!-- small box -->
    <!-- achtung hier soll man vielleicht die Adresse ändern -->

    @{for (int i = 0; i < Model.ListStations.Length; i++)
            {
                string urlTemp = Model.ListStations[i];
                string colorTemp = "small-box bg-" + Model.ListColors[i % Model.ListColors.Length];
                System.Diagnostics.Debug.WriteLine(colorTemp);
        <div class= "small-box bg-blue">
            <div class="inner">
                <h3>Station</h3>
                <p> Model.ListStations[i]</p>
            </div>
            <div class="icon">
                <i class="fa fa-heartbeat" aria-hidden="true"></i>
            </div>
            <a href= @urlTemp class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a>
        </div>;
            }
        }
    </div>
</div><!-- /.row -->

But when I just change the "small-box bg-blue" into @colorTemp, a list containing "small-box bg-blue", "small-box bg-black" and "small-box bg-green", I get this :

first image

I suppose there is a subtle html specificity I missed (or not), has someone an idea what's going wrong ? Edit : the generated HTML code is :

<div class="row">
    <div class="col-lg-3 col-xs-6">
        <!-- small box -->
        <!-- achtung hier soll man vielleicht die Adresse ändern -->
            <div class= &#39;small-box bg-blue&#39;>
                <div class="inner">
                    <h3>Station</h3>
                    <p> Model.ListStations[i]</p>
                </div>
                <div class="icon">
                    <i class="fa fa-heartbeat" aria-hidden="true"></i>
                </div>
                <a href= Station1 class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a>
            </div>            <div class= &#39;small-box bg-black&#39;>
                <div class="inner">
                    <h3>Station</h3>
                    <p> Model.ListStations[i]</p>
                </div>
                <div class="icon">
                    <i class="fa fa-heartbeat" aria-hidden="true"></i>
                </div>
                <a href= Station2 class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a>
            </div>            <div class= &#39;small-box bg-green&#39;>
                <div class="inner">
                    <h3>Station</h3>
                    <p> Model.ListStations[i]</p>
                </div>
                <div class="icon">
                    <i class="fa fa-heartbeat" aria-hidden="true"></i>
                </div>
                <a href= Station3 class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a>
            </div>
    </div>
</div>

I just updated my MVC Project from .Net 4.6 to .Net 4.6.1. But when I start the Application, there is an error, that System.Net.Http is missing.

enter image description here

In the add reference dialog I can see the reference:

enter image description here

But in the list, there is an icon, that is indicating a warning:

enter image description here

I tried to remove and add the reference again several times with no luck. I also tried it with a new MVC Project based on .Net 4.6.1 and here it works like a charm.

So what can I do, to get a reference to System.Net.Http in my existing Project?

I am trying to move the front-end part of my application to Angular 2. Currently I have really big ASP.NET application. i'm confused how to get data from the Default.aspx page and consume in angular 2

Default.aspx.cs

 protected void Page_Load(object sender, EventArgs e)
{
DataAccess = new DBManager();
Login_Type = (string)Session["LOGIN_TYPE"];
bool isGroupAccount = false;
if (Login_Type == "USER")
{
    Operateur = (Utilisateur)Session["LOGIN_ID"];
    nom_compte = Operateur.Login + "(Utilisateur)";
    id_compte = Operateur.Id;
    EnablePopupNotification = Operateur.EnablePopupNotification;
    EnableEmailNotification = Operateur.EnableEmailNotification;
    Email = Operateur.Email;
    Login = Operateur.Login ;
    Password = Operateur.Password; 
    HttpCookie myCookie = new HttpCookie("ID_COMPTE");
    myCookie.Value = id_compte.ToString(); 
    Response.Cookies.Add(myCookie);
}

I'm not sure how ASP.NET works since I'm still very new to it, coming from a PHP background where most things are done with POST. I'm using VB.NET behind the code. Mainly because the main program used here is written in VB.NET and I want to keep the code portable without compiling a library.

My issue is as follows. I have a DropDownList on the page. I populate it with data from the database. That seems to work fine.

I have a button that should change the CLIENTCODE to whatever has been selected in the DropDownBox. This doesn't work. Instead the Index is always -1.

Page Code

<div class="row">
    <div class="form-group">
        <div class="col-md-4">
            <asp:Label ID="Label1" runat="server" Text="Label">Change my Clientcode;</asp:Label>
            <asp:DropDownList ID="cboClientList" class="form-control" runat="server" ></asp:DropDownList>
            <asp:Button ID="cmdChangeClientCode" class="btn btn-primary" runat="server" Text="Change" />
        </div>
    </div>
</div>

Behind Code

Public Sub Load_CLIENTCODE_List()
    If IsPostBack = False Then
        Using DB As New wotcDB
            Dim r = (From t In DB.client_main Order By t.CLIENTCODE Select t.CLIENTCODE).Distinct
            For Each Client In r
                Dim input As New ListItem
                input.Text = Client
                input.Value = Client
                cboClientList.Items.Add(input)
            Next
        End Using
    End If
End Sub

Private Sub cmdChangeClientCode_Click(sender As Object, e As EventArgs) Handles cmdChangeClientCode.Click
    Dim CLIENTCODE As String = CType(Session("CLIENTCODE"), String)
    Dim UserName As String = CType(Session("UserName"), String)
    Using DB As New wotcDB
        Dim u = (From t In DB.website_users Where t.UserName = UserName).FirstOrDefault
        If u IsNot Nothing Then
            Dim TempID As Integer = cboClientList.SelectedIndex
            Dim TempValue As String = cboClientList.SelectedValue
            u.CLIENTCODE = cboClientList.SelectedValue
            DB.SaveChanges()
        End If
    End Using
End Sub

I've tried other answers here on stack, but nothing seems to work. Any Ideas?

I am using a text area which connected with a plugin, but am unable to access the value from it.

<div class="form-group">
    <label class="control-label">Type Your Message</label>
    <div class="noteWrap">
      <div class="form-group">
        <textarea class="summernote" id="message" name="message" placeholder="Write note here..."></textarea>
      </div>
    </div>
 </div>

enter image description here

I am getting an error on the code RC.MSG_Message = Request.Form["message"]; (MSG_Message is declared as string).Error message says :

{"A potentially dangerous Request.Form value was detected from the client (message=."}

How to get the data from this textarea on C# code behind page along with its style added by plugin?

For now I just need text, so how can I check the data is an image or not?

I wanna create two textareas. The first textarea should used by the user. Every time the user will change the textarea value it should be checked and given out in another textarea. I tried to add runat="server" and onChange="fTextChanged" in the bootrstrap textarea control. This is my usercontrol:

    <div class="row">
        <div class="form-group">
            <label for="ToTranslate">Text to translate:</label>
            <textarea class="form-control" runat="server" onChange="fTextChanged" rows="5" id="ToTranslate"></textarea>
        </div>
    </div>

    <div class="row">
        <div class="form-group">
            <label for="TranslatedText">Translated text:</label>
            <textarea class="form-control" runat="server" rows="5" id="TranslatedText"></textarea>
        </div> 
    </div>

And this is my CodeBehind:

 public void fTextChanged(object sender, EventArgs e)
 {
     string Content;

     Content = ToTranslate.Value;

     TranslatedText.Value = Content;
 }

I tried to debug it, but it appears that the compiler(Website?) ignore the function. My VS2017 dont stop at the breakpoint:

Content = ToTranslate.Value;

I'm new in the web programming at all, I'm just used to C#, C++, and LabView. I hope you nice guys can help me.

Kind regards!

In my Angular web project I use different two or three types of header in many pages in Angular 4 project. Is there a way to code up your HTML header code and footer code just once and have it included or injected in one or more of your pages. To give some clue I need an alternative for @Section in ASP.NET MVC Razor witch in each page we can add an extra code to it (I know this is a server side thing, but I need it in angular client side). Is there an official/recommended way to do this?

It seems whenever I call the GetPropertyValue() function, a p elements is automatically generated, meaning I can't wrap my call in my own implemented p element. I need to add a few classes to this element, but I am unable to, as the auto generated element is only created at runtime.

This is my call:

@(item.GetPropertyValue("desscription"))

When i wrap this in a p element with a class like this:

<p class="static-heigth">@(item.GetPropertyValue("desscription"))</p>

The browser adds an empty p element, as well as a p element containing a span with my property string.

How do I add classes and data-types to p elements containing my property values?

ts mvc 4.Can any one help me?!

public ActionResult InsertForm()
    {
        try
        {
            CheckSession();

            SessionWrapper.Current.CurrentRN = string.Empty;

            SessionWrapper.Current.SpBatteryID = -1;


            var serviceDoc = new ServiceDoc();
            serviceDoc.IdWsUser = SessionWrapper.Current.SecurityUser.ID;
            serviceDoc.DateIssued = System.DateTime.Now;

            SessionWrapper.Current.CurrentRN = ShoppingServices.InsertRN(serviceDoc);

            return View();
        }
        catch (WebSessionException)
        {
            return OnWebSessionException();
        }

View:

<strong> @DateTime.Now</strong>

And I'am getting the below error in the view

Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: 'Cannot perform runtime binding on a null reference'

what can be wrong!

I am working on MVC 5 ASP.net. When I am using razor syntax image is not showing on web page otherwise same hard coded value is working.

Here is the code.

    @{
       var path = "";
    }
    @foreach (Movy a in Model)
    {
            if (a.Image == null)
            {
                path = "~/Content/images/c3.jpg";
            }
            else
            {
                path = a.Image;
            }
        <img src="@path" />
    }

but when I replace @path to "~/Content/images/c3.jpg" in source of image it works.

when I sign in user I do it as following:

HttpContext.Authentication.SignInAsync("name", claimsPrincipal, authenticationProperties);

Where authenticationProperties variable is AuthenticationProperties object with parameter IsPersistent set to either true or false.

I need to later inside one of my controllers get the information if the SignInAsync was done with the IsPersistent parameter set to true or false. How can I access this parameter?

Thank you for your help!

I want to create a button line up in the page. It should be like code below in html.

<tr>
<td></td>
<td></td>
</tr>

however, currently i am using c# and aspx file. here is my aspx interface code.

<%@ Page Language="C#" Async="true" AutoEventWireup="true" CodeFile="Translator2.aspx.cs" MasterPageFile="~/Site.Master"  Inherits="Translator2" %>
<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">

    <html></html>
            <div class="form-group">
                    <asp:Label runat="server" AssociatedControlID="English" ID="enlabel" CssClass="col-md-2 control-label">English</asp:Label>
                    <div class="col-md-10">

                        <asp:TextBox  Height="79px" TextMode="MultiLine" Width="452px"  runat="server" ID="English" CssClass="form-control" />

                    </div>      </div>  

 <div class="col-md-offset-2 col-md-10">
                        <asp:Button runat="server" Height="39px" Width="100px"  OnClick="Detect" Text="Detect" CssClass="btn btn-default" />
                    </div>

I am trying to put the html tag inside the asp content but there is error: "validation(html5) element html cant be nested within element div" and if I put outside the asp content theres also error : "validation(html5) content is not supported outsidescript` or asp:content regions"

my question is, can we create the ,,,etc in aspx file? Because it seems not supported html tag.

I am still new in asp and c#, please give me some insight!

Is it a good idea to mix Razor Pages with Razor Views in the same ASP.NET Core 2.0 app?

If I understand it correctly, the benefit of using Razor Pages is that they don't need controller actions. In my app, I have some pages that simply return a React app. I feel Razor Pages are perfect for this because all I need in the page is just a link to the bundle.js file.

Having said that, I do have a few pages where I need a controller and send a view model.

So, is it a good idea to have both pages and views or should I stick to one and not mix it together?

I am using a gridview and bind data to it from a SharePoint list.

I want to know how to use search functionality for my gridview as I don't have any database. (and the solutions I see all use a database)

Is there any other solution apart from the JQuery plug-in DataTables??

Kindly Help! Thanks :)

TL; DR Are "partial Pages" possible in ASP.NET Core 2.0? If so, why am I getting the error described below?

I've been messing with the new Razor Page feature of ASP.NET 2.0 and having some trouble with partials. The documentation linked above refers to "partials" in several places, but only to the extent of saying mystical things like "The layouts, templates, and partials you're using with MVC controllers and conventional Razor views just work." Do they mean partial Views, like what we're used to, or some new kind of partial Page also? They show that files with the conventional Partial suffix in the name can be placed in the Pages/ folder, but the files that they mention (e.g., _ValidationScriptsPartial.cshtml) don't have the @page declaration. If "partial Pages" are indeed a new thing, then I would expect the following minimal scenario to work:

  • A Page file named Derp.cshtml:

    @page
    @namespace MyApp.Pages
    @model DerpModel
    
    <p>Member 1: @Model.Member1</p>
    <p>Member 2: @Model.Member2</p>
    
  • A class file named Derp.cshtml.cs in the same directory (nested under the first in VS 2017's Solution Explorer), containing the following class:

    namespace MyApp.Pages {  
        public class DerpModel : PageModel {
            public void OnGet() {
                Member1 = "Derp Member1";
                Member2 = "Derp Member2";
            }
    
            public string Member1 { get; set; }
            public string Member2 { get; set; }
        }
    }
    
  • A second Page file named DerpWrapper.cshtml in the same directory, with the following code:

    @page "{id}"
    @namespace MyApp.Pages
    @model DerpModel
    
    <p>Outer Member 1: @Model.Member1</p>
    <p>Outer Member 2: @Model.Member2</p>
    @Html.Partial("Derp", Model)
    
  • And of course a _ViewImports file that declares @namespace MyApp.Pages

Note that both Razor Pages have the same @model type, and the second Page basically wraps up the first one with a call to Html.Partial() and passes its Model. This should all be pretty standard stuff, but upon navigating to http://localhost:xxx/DerpWrapper, I get a 500 response due to a NullReferenceException with the following stack trace.

    MyApp.Pages.Derp_Page.get_Model()
    MyApp.Pages.Derp_Page+<ExecuteAsync>d__0.MoveNext() in Derp.cshtml
    +
    <p>Inner Member1: @Model.Member1</p>
    ...
    MyApp.Pages.DerpWrapper_Page+<ExecuteAsync>d__0.MoveNext() in DerpWrapper.cshtml
    +
    @Html.Partial("Derp", Model)
    ...

Why does the "wrapper" Page's Model equal null? Is there no way to define a Razor Page and display it from another Page or View with Html.Partial()?

When I submit my Login email (aka username), I want to keep it in my Login form.

When I submit my Register email (aka username), I want to keep it in my Register form.

What is happening is: when I submit my Login form, it writes the email (aka username) to the Register form. Please see image for what is happening.

enter image description here

@{
    Page.Title = "Login";
    var username = "";
    var password = "";
    var errorMessage = "";

    var confirmPassword = "";
    var regMsg = "";
    var confToken = "";
    var emailBody = "";
    var minPass = 2;
    var maxPass = 5;


    if (!IsPost) {
        if (WebSecurity.IsAuthenticated) {errorMessage = String.Format("You are already logged in. (Username: {0})", WebSecurity.CurrentUserName);}
    }

    if(WebSecurity.IsAuthenticated){
        errorMessage = String.Format("You are already logged in. (Username: {0})", WebSecurity.CurrentUserName);
    }

    if(IsPost){
        // Login Form
        if (Request.Form["loginSub"] != null){
            regMsg = "";
            username = Request["username"];
            password = Request["password"];
            if(WebSecurity.Login(username,password,true)){
                Response.Redirect("~/Profile");
            }
            else
            {
                errorMessage = "Invalid Username or Password. Please try again.";
            }
        }
        // Register Form
        if (Request.Form["registerSub"] != null){
            WebSecurity.Logout();
            errorMessage = "";  
            username = Request["username"];
            password = Request["password"];
            confirmPassword = Request["confirmPassword"];
            try {
                var mail = new System.Net.Mail.MailAddress(username);
            } catch {
                regMsg += "<br>Invalid email format.";
            }
            if (password != confirmPassword) {regMsg += "</br>Passwords don't match.";}
            if (WebSecurity.UserExists(username)) {regMsg += String.Format("</br>User '{0}' already exists.", username);}
            if (password.Length < minPass || password.Length > maxPass) {regMsg += "</br>Password doesn't meet length requirement.";}
            if (regMsg == "") {
                WebSecurity.CreateUserAndAccount(username,password,null,false); //Switch with "true" token
                regMsg = String.Format("{0} created.", username);
                Response.Write("<script>alert('Email verification sent! Please check your email to activate your account.');</script>");
                //Response.Write("<script>location.href = 'Default.cshtml';</script>");
            }
        }
    }
}
<style>header {visibility: hidden;}</style>
 <body>
    <h1>MySite</h1>
    <p>
        @if(errorMessage != ""){<span>@Html.Raw(errorMessage)</span>}
        @if(regMsg != ""){<span>@Html.Raw(regMsg)</span>}
    </p>
    <fieldset class="fs100">
        <legend>Login</legend>
        <form method="post" name="login">
            @if(WebSecurity.IsAuthenticated){
                <p>You are currently logged in as @WebSecurity.CurrentUserName.
                    <a href="@Href("~/Logout")">Log out</a>
                </p>
            }
            <p>
                <label for="username">Email Address:</label><br/>
                <input type="text" name="username" id="username" value="" />
            </p>
            <p>
                <label for="password">Password:</label><br/>
                <input type="password" name="password" id="password" value="" />
            </p>   
            <p>
                <input type="submit" name="loginSub" value="Submit" />
            </p>        
            <p><a href="@Href("~/Register")">Forgot Password?</a></p>
        </form>
    </fieldset>
    <fieldset>
        <legend>Register</legend>
        <form method="post" name="register">
            <p>
                <label for="username">Email Address:</label><br/>
                <input type="text" name="username" id="username" value='@Request["username"]' />
            </p>
            <p>
                <label for="password">Password @minPass-@maxPass Characters:</label><br/>
                <input type="password" name="password" id="password" value="" />
            </p>   
            <p>
                <label for="confirmPassword">Confirm Password:</label><br/>
                <input type="password" name="confirmPassword" id="confirmPassword" value="" />
            </p>
            <p>
                <input type="submit" name="registerSub" value="Register" />
            </p>
        </form>
    </fieldset>
</body>

I have a cshtml file that has the section of similar to below code below:

  <div id="entries" class="records-table">
      @if (Model.Entries != null)
      {
          foreach (var entry in Model.Entries)
          {
              @Html.Partia("../Partials/_PartialEntry", entry)
          }
      }
  </div>

And in my _PartialEntry file I have code similar as below:

<input asp-for="SomeModelValue" />
<div class="@(Model.SomeModelValue == "Special":"hidden":string.Empty)">...</div>

The issue that I am having is for a given entry the SomeModelValue properties between asp-for="SomeModelValue" and @Model.SomeModelValue are not the same. The @Model.SomeModelValue always returns the SomeModelValue of the previous entry. I will try and provide an example below.

Lets say me Model.Entries had the values below:

[{SomeModelValue = "Special", ....}, 
 {SomeModelValue = "SomeOtherValue", ....} 
 {SomeModelValue = "Special", ....},
 {SomeModelValue = "SomeValue", ....},
 {SomeModelValue = "Special", ....}]

Note: Just using being lazy it is C# List of objects where SomeModelValue is a string property.

And I was edit the _ParialEntry code to:

<input asp-for="SomeModelValue" />
<div>@Model.SomeModelValue</div>
<div class="@(Model.SomeModelValue == "Special":"hidden":string.Empty)">...</div>

The resulting html that gets generated is similar to:

<div id="entries" class="records-table">
    ...
    <input value="Special" />
    <div>{Special}</div>
    <div {class="hidden"}>...</div>
    ...
    <input value="SomeOtherValue" />
    <div>Special{SomeOtherValue}</div>
    <div class="hidden"{} >...</div>
    ...
    <input value="Special" />
    <div>SomeOtherValue{Expecting:Special}</div>
    <div {lass="hidden"}>...</div>
    ...
    <input value="SomeValue" />
    <div>Special{SomeValue}</div>
    <div class="hidden"{}>...</div>
    ...
    <input value="Special" />
    <div>SomeValue{Special}</div>
    <div {class="hidden"}>...</div>
    ...
</div>

The expected result I have placed in {...} inother words SomeValue{Special} means I got SomeValue displayed but I expected to see Special.
I hope this give you an idea of what I am encounter, I don't seem to understand why this is happening any pointer would be helpful thank you.