site.Master(asp.net)に「lblnotify」というラベルがあります。
*<div class = "notification">
<asp:Label ID="lblnotify" runat="server" text ="0 "></asp:Label>
</div>*
コードビハインドファイルには、「lblnotify」のテキストを別のテキストに置き換えるメソッドがあります。
*public void notificationManager()
{
try
{
string i = lblnotify.Text;
i = i + "new";
lblnotify.Text = i ;
Label1.Text = (i);
}
catch (Exception er)
{
Response.Write("Exception Occured: " + er);
}
}*
notificationManager は、別のクラスの送信ボタンでトリガーされます
*protected void btnSubmit_Click(object sender, EventArgs e)
{
appSite call = new appSite();
call.notificationManager();
}*
しかし、これにより、オブジェクト参照がオブジェクトのインスタンスに設定されていないというエラーが表示され ます
*string i = lblnotify.Text;*
try ブロックで、try-catch と同じエラーをコメントすると、
*Response.Write("Exception Occured: " + er);*
try-catch をコメントしないときの catch ブロックで。できることはすべて試しましたが、それでもエラーが発生します。あなたの助けは非常に高く評価されます。