ユーザーが URL を選択できる URL エディタを起動します。
この型のすべてのメンバの一覧については、UrlBuilder メンバ を参照してください。
System.Object
System.Web.UI.Design.UrlBuilder
NotInheritable Public Class UrlBuilder
[C#]
public sealed class UrlBuilder
[C++]
public __gc __sealed class UrlBuilder
[JScript]
public class UrlBuilder
スレッドセーフ
この型の public static (Visual Basicでは Shared) のすべてのメンバは、マルチスレッド操作で安全に使用できます。インスタンスのメンバの場合は、スレッドセーフであるとは限りません。
解説
BuildUrl メソッドは、URL を選択するためのユーザー インターフェイスを起動します。
使用例
' Create a parent control.
Dim c As New System.Windows.Forms.Control()
c.CreateControl()
' Launch the Url Builder using the specified control
' parent, initial URL, empty relative base URL path,
' window caption, filter string and URLBuilderOptions value.
System.Web.UI.Design.UrlBuilder.BuildUrl(Me.Component, c, "http://www.example.com", "Select a URL", "", UrlBuilderOptions.None)
[C#]
// Create a parent control.
System.Windows.Forms.Control c = new System.Windows.Forms.Control();
c.CreateControl();
// Launch the Url Builder using the specified control
// parent, initial URL, empty relative base URL path,
// window caption, filter string and URLBuilderOptions value.
System.Web.UI.Design.UrlBuilder.BuildUrl(this.Component, c, "http://www.example.com",
"Select a URL", "", UrlBuilderOptions.None);
[C++]
// Create a parent control.
System::Windows::Forms::Control* c = new System::Windows::Forms::Control();
c->CreateControl();
// Launch the Url Builder using the specified control
// parent, initial URL, empty relative base URL path,
// window caption, filter String* and URLBuilderOptions value.
UrlBuilder::BuildUrl(this->Component, c, S"http://www.example.com",
S"Select a URL", S"", UrlBuilderOptions::None);
[Visual Basic]
' Example designer provides a designer verb menu command to launch the
' BuildUrl method of the UrlBuilder.
Public Class UrlBuilderDesigner
Inherits System.Web.UI.Design.UserControlDesigner
Public Sub New()
End Sub
' Provides a designer verb menu command for invoking the BuildUrl
' method of the UrlBuilder.
Public Overrides ReadOnly Property Verbs() As System.ComponentModel.Design.DesignerVerbCollection
Get
Dim dvc As New DesignerVerbCollection()
dvc.Add(New DesignerVerb("Launch URL Builder UI", New EventHandler(AddressOf Me.launchUrlBuilder)))
Return dvc
End Get
End Property
' This method handles the "Launch Url Builder UI" menu command.
' Invokes the BuildUrl method of the System.Web.UI.Design.UrlBuilder.
Private Sub launchUrlBuilder(ByVal sender As Object, ByVal e As EventArgs)
' Create a parent control.
Dim c As New System.Windows.Forms.Control()
c.CreateControl()
' Launch the Url Builder using the specified control
' parent, initial URL, empty relative base URL path,
' window caption, filter string and URLBuilderOptions value.
System.Web.UI.Design.UrlBuilder.BuildUrl(Me.Component, c, "http://www.example.com", "Select a URL", "", UrlBuilderOptions.None)
End Sub
End Class
' Example Web control displays the value of its text property.
' This control is associated with the UrlBuilderDesigner.
<DesignerAttribute(GetType(UrlBuilderDesigner), GetType(IDesigner))> _
Public Class UrlBuilderControl
Inherits System.Web.UI.WebControls.WebControl
Private [text_] As String
<Bindable(True), Category("Appearance"), DefaultValue("")> _
Public Property [Text]() As String
Get
Return [text_]
End Get
Set(ByVal Value As String)
[text_] = Value
End Set
End Property
Protected Overrides Sub Render(ByVal output As HtmlTextWriter)
output.Write([Text])
End Sub
End Class
[C#]
// Example designer provides a designer verb menu command to launch the
// BuildUrl method of the UrlBuilder.
public class UrlBuilderDesigner : System.Web.UI.Design.UserControlDesigner
{
public UrlBuilderDesigner()
{
}
// Provides a designer verb menu command for invoking the BuildUrl
// method of the UrlBuilder.
public override System.ComponentModel.Design.DesignerVerbCollection Verbs
{
get
{
DesignerVerbCollection dvc = new DesignerVerbCollection();
dvc.Add( new DesignerVerb("Launch URL Builder UI", new EventHandler(this.launchUrlBuilder)) );
return dvc;
}
}
// This method handles the "Launch Url Builder UI" menu command.
// Invokes the BuildUrl method of the System.Web.UI.Design.UrlBuilder.
private void launchUrlBuilder(object sender, EventArgs e)
{
// Create a parent control.
System.Windows.Forms.Control c = new System.Windows.Forms.Control();
c.CreateControl();
// Launch the Url Builder using the specified control
// parent, initial URL, empty relative base URL path,
// window caption, filter string and URLBuilderOptions value.
System.Web.UI.Design.UrlBuilder.BuildUrl(this.Component, c, "http://www.example.com",
"Select a URL", "", UrlBuilderOptions.None);
}
}
// Example Web control displays the value of its text property.
// This control is associated with the UrlBuilderDesigner.
[DesignerAttribute(typeof(UrlBuilderDesigner), typeof(IDesigner))]
public class UrlBuilderControl : System.Web.UI.WebControls.WebControl
{
private string text;
[Bindable(true),
Category("Appearance"),
DefaultValue("")]
public string Text
{
get
{
return text;
}
set
{
text = value;
}
}
protected override void Render(HtmlTextWriter output)
{
output.Write(Text);
}
}
[C++]
// Example designer provides a designer verb menu command to launch the
// BuildUrl method of the UrlBuilder.
public __gc class UrlBuilderDesigner : public UserControlDesigner {
public:
UrlBuilderDesigner() {
}
// Provides a designer verb menu command for invoking the BuildUrl
// method of the UrlBuilder.
public:
__property DesignerVerbCollection* get_Verbs() {
DesignerVerbCollection* dvc = new DesignerVerbCollection();
dvc->Add(new DesignerVerb(S"Launch URL Builder UI", new EventHandler(this, &UrlBuilderDesigner::launchUrlBuilder)));
return dvc;
}
// This method handles the "Launch Url Builder UI" menu command.
// Invokes the BuildUrl method of the System::Web::UI::Design.UrlBuilder.
private:
void launchUrlBuilder(Object* /*sender*/, EventArgs* /*e*/) {
// Create a parent control.
System::Windows::Forms::Control* c = new System::Windows::Forms::Control();
c->CreateControl();
// Launch the Url Builder using the specified control
// parent, initial URL, empty relative base URL path,
// window caption, filter String* and URLBuilderOptions value.
UrlBuilder::BuildUrl(this->Component, c, S"http://www.example.com",
S"Select a URL", S"", UrlBuilderOptions::None);
}
};
// Example Web control displays the value of its text property.
// This control is associated with the UrlBuilderDesigner.
[DesignerAttribute(__typeof(UrlBuilderDesigner), __typeof(IDesigner))]
public __gc class UrlBuilderControl : public WebControl {
private:
String* text;
public:
[Bindable(true),
Category(S"Appearance"),
DefaultValue(S"")]
__property String* get_Text() {
return text;
}
__property void set_Text(String* value) {
text = value;
}
protected:
void Render(HtmlTextWriter* output) {
output->Write(Text);
}
};
[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン
をクリックします。
必要条件
名前空間: System.Web.UI.Design
プラットフォーム: Windows 2000, Windows XP Professional, Windows Server 2003 ファミリ
アセンブリ: System.Design (System.Design.dll 内)
参照
UrlBuilder メンバ | System.Web.UI.Design 名前空間 | UrlBuilderOptions