8

私はasp.net Webアプリに取り組んでおり、app_codeにいくつかのクラスがありますが、何らかの理由でコードでそれらを使用できません. 同じ名前空間を使用してみましたが、両方のファイルで名前空間を使用せずに試しましたが、何も役に立ちません。

これは私のページコードです:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using LinkedIn;
using LinkedIn.ServiceEntities;


namespace Authentication
{
    public partial class LinkedinMoreInfo : LinkedinBasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
    }
}

そして、クラス内の私のコード:

using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Xml.Linq;

using LinkedIn;

namespace Authorisation
{
    public class LinkedInBasePage : System.Web.UI.Page
    {
        private string AccessToken
        {
            get { return (string)Session["AccessToken"]; }
            set { Session["AccessToken"] = value; }
        }

        private InMemoryTokenManager TokenManager
        {
            get
            {
                var tokenManager = (InMemoryTokenManager)Application["TokenManager"];
                if (tokenManager == null)
                {
                    string consumerKey = ConfigurationManager.AppSettings["LinkedInConsumerKey"];
                    string consumerSecret = ConfigurationManager.AppSettings["LinkedInConsumerSecret"];
                    if (string.IsNullOrEmpty(consumerKey) == false)
                    {
                        tokenManager = new InMemoryTokenManager(consumerKey, consumerSecret);
                        Application["TokenManager"] = tokenManager;
                    }
                }

                return tokenManager;
            }
        }

        protected WebOAuthAuthorization Authorization
        {
            get;
            private set;
        }

        protected override void OnLoad(EventArgs e)
        {
            this.Authorization = new WebOAuthAuthorization(this.TokenManager, this.AccessToken);

            if (!IsPostBack)
            {
                string accessToken = this.Authorization.CompleteAuthorize();
                if (accessToken != null)
                {
                    this.AccessToken = accessToken;

                    Response.Redirect(Request.Path);
                }

                if (AccessToken == null)
                {
                    this.Authorization.BeginAuthorize();
                }
            }

            base.OnLoad(e);
        }
    }
}

何が問題になる可能性がありますか?前もって感謝します

4

2 に答える 2

10

ファイルのプロパティに移動し、に変更しBuild ActionますCompile

于 2011-10-10T20:49:04.483 に答える
0

ベースページが name の場合、の代わりにLinkedInBasePage継承する必要がありますLinkedInBasePageLinkedinBasePage

public partial class LinkedinMoreInfo : Authorisation.LinkedInBasePage {

于 2011-10-10T20:47:59.123 に答える