We help IT Professionals succeed at work.

The name does not exist in the current context

mcrmg
mcrmg asked
on
133 Views
Last Modified: 2017-05-31
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

Comment
Watch Question

Miguel OzSenior Software Engineer
CERTIFIED EXPERT
Top Expert 2009

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

Author

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

Senior Software Engineer
CERTIFIED EXPERT
Top Expert 2009
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION