webmatrixでは、多くの公開静的関数を使用してApp_DataにDAL.cshtmlを作成しました。1つのcshtmlが別のcshtmlの関数をどのように呼び出すのですか?
別の.cshtmlページから別のフォルダに呼び出す必要があります。現在
私は コンパイラエラーメッセージが表示されます:CS0103を:名前DALは
(私は、単一の場所へのデータアクセスを移動についてのブログ、以下の初心者です注意してください)現在のコンテキスト内に存在しない私DAL.cshtmlで
例は次のとおりです。私の '呼び出し' で
public static void AddProfile (dynamic Profile)
{
var sql = "INSERT INTO profile (ProfileDescription, ProfileType) " +
"VALUES (@0, @1)";
PinwheelDB.Execute(sql, Profile.ProfileDescription, Profile.ProfileType);
var Profile.ProfileID = PinwheelDB.GetLastInsertId();
}
私が持っている.cshtml:
dynamic Profile = new ExpandoObject();
Profile.ProfileDescription = Request.Form["txtChildFirstName"];
Profile.ProfileType = 1;
functions.DAL.AddProfile(Profile);
var vProfileID = Profile.ProfileID;
自分の答えを受け入れることができます。 –