Avatar of mcrmg
 asked on

The name does not exist in the current context


I installed VS2017 and am moving webpages from website into a new webapplication. I am getting

Error      CS0103      The name 'msg' does not exist in the current context      

any ideas?  thanks

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;

public partial class CremacLogin : System.Web.UI.Page
    protected void Page_Load(object sender, EventArgs e)

        Session["level"] = null;
        Session["user"] = null;

        msg.Text = Request.QueryString["msg"];


Open in new window


Avatar of undefined
Last Comment
Miguel Oz

8/22/2022 - Mon
Miguel Oz

It seems that you are missing msg in your aspx file. Please check.
If more help needed, please add your aspx file.

thanks for the quick reply. There is msg in the aspx file.  thanks

 <center><asp:Label id="msg" runat="server" style="font-weight:bold"></asp:Label>

Open in new window

Miguel Oz

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Your help has saved me hundreds of hours of internet surfing.