The name does not exist in the current context

hi,

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

mcrmgAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Miguel OzSoftware EngineerCommented:
It seems that you are missing msg in your aspx file. Please check.
If more help needed, please add your aspx file.
0
mcrmgAuthor Commented:
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

0
Miguel OzSoftware EngineerCommented:
Check that you aspx url contains the msg as part of the query string. Your calling code may not be adding this query parameter to your URL.
Note: The label is not used as parameter in the page. If more help needed please post page URL.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.