CreateUserWizardDesigner.GetErrorDesignTimeHtml(Exception) Methode

Definition

Ruft den HTML-Code ab, der Informationen über die angegebene Ausnahme bereitstellt. Diese Methode wird üblicherweise aufgerufen, nachdem ein Fehler zur Entwurfszeit aufgetreten ist.

protected:
 override System::String ^ GetErrorDesignTimeHtml(Exception ^ e);
protected override string GetErrorDesignTimeHtml (Exception e);
override this.GetErrorDesignTimeHtml : Exception -> string
Protected Overrides Function GetErrorDesignTimeHtml (e As Exception) As String

Parameter

e
Exception

Die aufgetretene Ausnahme.

Gibt zurück

Der HTML-Code für die angegebene Ausnahme.

Beispiele

Im folgenden Codebeispiel wird veranschaulicht, wie die GetErrorDesignTimeHtml -Methode überschrieben wird, um Im Falle eines Fehlers Debuginformationen auf der Entwurfsoberfläche anzuzeigen.

using System;
using System.IO;
using System.ComponentModel;
using System.Web.UI.WebControls;
using System.Web.UI;
using System.Web.UI.Design;
using System.Web.UI.Design.WebControls;
//using Examples.WebNet.Design;

namespace Examples.WebNet
{
    // Create a class that extends CreateUserWizardDesigner.
    public class MyCreateUserWizardDesigner : CreateUserWizardDesigner
    {
        // This variable contains debugging information.
        private string debugInfo = "Useful information.";
        
        // Override the GetErrorDesignTimeHtml method to add some more
        // information to the error message.
        protected override string GetErrorDesignTimeHtml(Exception e)
        {
            // Get the error message from the base class.
            string html = base.GetErrorDesignTimeHtml(e);
        
            // Append the debugging information to it.
            html += "<br>" + "DebugInfo: " + debugInfo;
        
            // Return the error message.
            return html;
        }
    }
}
Imports System.IO
Imports System.ComponentModel
Imports System.Web.UI
Imports System.Web.UI.Design
Imports System.Web.UI.Design.WebControls
Imports System.Web.UI.WebControls
Imports Examples.WebNet

Namespace Examples.WebNet
    ' Create a class that extends CreateUserWizardDesigner.
    Public Class MyCreateUserWizardDesigner
        Inherits CreateUserWizardDesigner

        ' This variable contains debugging information.
        Private debugInfo As String = "Useful information."

        ' Override the GetErrorDesignTimeHtml method to add some more
        ' information to the error message.
        Protected Overrides Function GetErrorDesignTimeHtml(ByVal e As Exception) As String
            ' Get the error message from the base class.
            Dim htmlStr As String
            htmlStr = MyBase.GetErrorDesignTimeHtml(e)

            ' Append the debugging information to it.
            htmlStr &= "<br>DebugInfo: " & debugInfo

            ' Return the error message.
            Return htmlStr
        End Function
    End Class

End Namespace

Gilt für:

Weitere Informationen