IntelliSense в Visual Studio 2017 не распознает MasterPage - PullRequest
0 голосов
/ 02 июля 2019

В моем решении для Visual Studio 2017 в C # мой IntelliSense не распознает MasterPage.

При компиляции решения или веб-сайта возникают ошибки при распознавании MasterPage.

Хотя, когда я запускаю сайт, работающий нормально.

Кто-нибудь еще может порекомендовать решение этой проблемы?

Пожалуйста, смотрите прикрепленные изображения из Visual studio 2017

enter image description here

enter image description here

Код MasterPage:

using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data.Odbc;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Mpims : MasterPage
{

    public static string Base64ForUrlDecode(string str)
    {
        byte[] decbuff = HttpServerUtility.UrlTokenDecode(str);
        return Encoding.UTF8.GetString(decbuff);
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {

        }
    }
}

Webform cs с MasterPage:

using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.Odbc;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class sDefault : Page
{
    string sql;

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {

            sql = @String.Format(" SELECT * FROM doTable WHERE sID = ?; ");

            using (OdbcConnection cn =
              new OdbcConnection(ConfigurationManager.ConnectionStrings["cn"].ConnectionString))
            {
                using (OdbcCommand cmd =
                    new OdbcCommand(sql, cn))
                {
                   try
                   {
                        command.Parameters.AddWithValue("param1", Mpims.Base64ForUrlDecode(Request.QueryString["sID"]).ToString().ToUpper());
                        command.Connection.Open();

                        using (OdbcDataReader reader = 
                           command.ExecuteReader())
                        {
                           if (reader.HasRows)
                           {
                               while (reader.Read())
                               {
                                     ...
                               }
                           }
                        }    
                   }                
                   catch (Exception ex)
                   {
                       throw new ApplicationException("operation failed!", ex);
                   }
                   finally
                   {
                      command.Connection.Close();
                   }
                }
            }
        }
    }
}

Веб-форма aspx с MasterPage:

<%@ Page Title="" Language="C#" MasterPageFile="Mpims.master" AutoEventWireup="true" CodeFile="sDefault.aspx.cs" Inherits="sDefault" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" 
runat="Server">
</asp:Content>

Пожалуйста, объясните мне, в чем проблема.

...