Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
327 lines (306 sloc) 20.8 KB
<Type Name="DataBoundLiteralControl" FullName="System.Web.UI.DataBoundLiteralControl">
<TypeSignature Language="C#" Value="public sealed class DataBoundLiteralControl : System.Web.UI.Control, System.Web.UI.ITextControl" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit DataBoundLiteralControl extends System.Web.UI.Control implements class System.Web.UI.ITextControl" />
<TypeSignature Language="DocId" Value="T:System.Web.UI.DataBoundLiteralControl" />
<TypeSignature Language="VB.NET" Value="Public NotInheritable Class DataBoundLiteralControl&#xA;Inherits Control&#xA;Implements ITextControl" />
<TypeSignature Language="C++ CLI" Value="public ref class DataBoundLiteralControl sealed : System::Web::UI::Control, System::Web::UI::ITextControl" />
<TypeSignature Language="F#" Value="type DataBoundLiteralControl = class&#xA; inherit Control&#xA; interface ITextControl" />
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Web.UI.Control</BaseTypeName>
</Base>
<Interfaces>
<Interface>
<InterfaceName>System.Web.UI.ITextControl</InterfaceName>
</Interface>
</Interfaces>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.ToolboxItem(false)</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Retains data-binding expressions and static literal text. This class cannot be inherited.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.UI.DataBoundLiteralControl> class persists the value of its <xref:System.Web.UI.DataBoundLiteralControl.Text%2A> property to view state.
## Examples
The following code example creates a class that obtains a <xref:System.Web.UI.DataBoundLiteralControl> object and displays the <xref:System.Web.UI.DataBoundLiteralControl.Text%2A> property of the object.
[!code-csharp[SystemWebUI_DataBoundLiteralControl#1](~/samples/snippets/csharp/VS_Snippets_WebNet/SystemWebUI_DataBoundLiteralControl/CS/mydataboundliteralcontrol.cs#1)]
[!code-vb[SystemWebUI_DataBoundLiteralControl#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/SystemWebUI_DataBoundLiteralControl/VB/mydataboundliteralcontrol.vb#1)]
]]></format>
</remarks>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public DataBoundLiteralControl (int staticLiteralsCount, int dataBoundLiteralCount);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(int32 staticLiteralsCount, int32 dataBoundLiteralCount) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.DataBoundLiteralControl.#ctor(System.Int32,System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (staticLiteralsCount As Integer, dataBoundLiteralCount As Integer)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; DataBoundLiteralControl(int staticLiteralsCount, int dataBoundLiteralCount);" />
<MemberSignature Language="F#" Value="new System.Web.UI.DataBoundLiteralControl : int * int -&gt; System.Web.UI.DataBoundLiteralControl" Usage="new System.Web.UI.DataBoundLiteralControl (staticLiteralsCount, dataBoundLiteralCount)" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="staticLiteralsCount" Type="System.Int32" />
<Parameter Name="dataBoundLiteralCount" Type="System.Int32" />
</Parameters>
<Docs>
<param name="staticLiteralsCount">Defines the size of the array to create for storing static literal strings.</param>
<param name="dataBoundLiteralCount">Defines the size of the array to create for storing data-bound literal strings.</param>
<summary>Initializes a new instance of the <see cref="T:System.Web.UI.DataBoundLiteralControl" /> class.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="CreateControlCollection">
<MemberSignature Language="C#" Value="protected override System.Web.UI.ControlCollection CreateControlCollection ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance class System.Web.UI.ControlCollection CreateControlCollection() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.DataBoundLiteralControl.CreateControlCollection" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Function CreateControlCollection () As ControlCollection" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override System::Web::UI::ControlCollection ^ CreateControlCollection();" />
<MemberSignature Language="F#" Value="override this.CreateControlCollection : unit -&gt; System.Web.UI.ControlCollection" Usage="dataBoundLiteralControl.CreateControlCollection " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Web.UI.ControlCollection</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>To be added.</summary>
<returns>To be added.</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="LoadViewState">
<MemberSignature Language="C#" Value="protected override void LoadViewState (object savedState);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void LoadViewState(object savedState) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.DataBoundLiteralControl.LoadViewState(System.Object)" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Sub LoadViewState (savedState As Object)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override void LoadViewState(System::Object ^ savedState);" />
<MemberSignature Language="F#" Value="override this.LoadViewState : obj -&gt; unit" Usage="dataBoundLiteralControl.LoadViewState savedState" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="savedState" Type="System.Object" />
</Parameters>
<Docs>
<param name="savedState">To be added.</param>
<summary>To be added.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="Render">
<MemberSignature Language="C#" Value="protected override void Render (System.Web.UI.HtmlTextWriter output);" FrameworkAlternate="netframework-1.1" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void Render(class System.Web.UI.HtmlTextWriter output) cil managed" FrameworkAlternate="netframework-1.1" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.DataBoundLiteralControl.Render(System.Web.UI.HtmlTextWriter)" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Sub Render (output As HtmlTextWriter)" FrameworkAlternate="netframework-1.1" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override void Render(System::Web::UI::HtmlTextWriter ^ output);" FrameworkAlternate="netframework-1.1" />
<MemberSignature Language="F#" Value="override this.Render : System.Web.UI.HtmlTextWriter -&gt; unit" Usage="dataBoundLiteralControl.Render output" />
<MemberSignature Language="C#" Value="protected internal override void Render (System.Web.UI.HtmlTextWriter output);" FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
<MemberSignature Language="ILAsm" Value=".method familyorassemblyhidebysig virtual instance void Render(class System.Web.UI.HtmlTextWriter output) cil managed" FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
<MemberSignature Language="VB.NET" Value="Protected Friend Overrides Sub Render (output As HtmlTextWriter)" FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
<MemberSignature Language="C++ CLI" Value="protected public:&#xA; override void Render(System::Web::UI::HtmlTextWriter ^ output);" FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="output" Type="System.Web.UI.HtmlTextWriter" />
</Parameters>
<Docs>
<param name="output">To be added.</param>
<summary>To be added.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="SaveViewState">
<MemberSignature Language="C#" Value="protected override object SaveViewState ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance object SaveViewState() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.DataBoundLiteralControl.SaveViewState" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Function SaveViewState () As Object" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override System::Object ^ SaveViewState();" />
<MemberSignature Language="F#" Value="override this.SaveViewState : unit -&gt; obj" Usage="dataBoundLiteralControl.SaveViewState " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Object</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>To be added.</summary>
<returns>To be added.</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="SetDataBoundString">
<MemberSignature Language="C#" Value="public void SetDataBoundString (int index, string s);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void SetDataBoundString(int32 index, string s) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.DataBoundLiteralControl.SetDataBoundString(System.Int32,System.String)" />
<MemberSignature Language="VB.NET" Value="Public Sub SetDataBoundString (index As Integer, s As String)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void SetDataBoundString(int index, System::String ^ s);" />
<MemberSignature Language="F#" Value="member this.SetDataBoundString : int * string -&gt; unit" Usage="dataBoundLiteralControl.SetDataBoundString (index, s)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="index" Type="System.Int32" />
<Parameter Name="s" Type="System.String" />
</Parameters>
<Docs>
<param name="index">The position in an array at which to retain the <paramref name="s" /> parameter value.</param>
<param name="s">A <see cref="T:System.String" /> containing the value for the data-bound expression.</param>
<summary>Assigns a string value to an array containing data-bound values.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="SetStaticString">
<MemberSignature Language="C#" Value="public void SetStaticString (int index, string s);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void SetStaticString(int32 index, string s) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.DataBoundLiteralControl.SetStaticString(System.Int32,System.String)" />
<MemberSignature Language="VB.NET" Value="Public Sub SetStaticString (index As Integer, s As String)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void SetStaticString(int index, System::String ^ s);" />
<MemberSignature Language="F#" Value="member this.SetStaticString : int * string -&gt; unit" Usage="dataBoundLiteralControl.SetStaticString (index, s)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="index" Type="System.Int32" />
<Parameter Name="s" Type="System.String" />
</Parameters>
<Docs>
<param name="index">The position in an array at which to retain the <paramref name="s" /> parameter value.</param>
<param name="s">A <see cref="T:System.String" /> containing the value for the data-bound expression.</param>
<summary>Assigns a string value to an array containing static values.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="System.Web.UI.ITextControl.Text">
<MemberSignature Language="C#" Value="string System.Web.UI.ITextControl.Text { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string System.Web.UI.ITextControl.Text" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.DataBoundLiteralControl.System#Web#UI#ITextControl#Text" />
<MemberSignature Language="VB.NET" Value=" Property Text As String Implements ITextControl.Text" />
<MemberSignature Language="C++ CLI" Value="property System::String ^ System::Web::UI::ITextControl::Text { System::String ^ get(); void set(System::String ^ value); };" />
<MemberSignature Language="F#" Usage="System.Web.UI.ITextControl.Text" />
<MemberType>Property</MemberType>
<Implements>
<InterfaceMember>P:System.Web.UI.ITextControl.Text</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the text content of the <see cref="T:System.Web.UI.DataBoundLiteralControl" /> object.</summary>
<value>A <see cref="T:System.String" /> that represents the text content of the <see cref="T:System.Web.UI.DataBoundLiteralControl" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This implementation of the <xref:System.Web.UI.ITextControl> interface returns the value of the <xref:System.Web.UI.DataBoundLiteralControl.Text%2A> property. The value of the <xref:System.Web.UI.DataBoundLiteralControl.Text%2A> property is persisted in the view state.
The <xref:System.Web.UI.DataBoundLiteralControl> object implements <xref:System.Web.UI.ITextControl> but does not support the `set` method on the <xref:System.Web.UI.ITextControl.Text%2A> property. All attempts to use this method will return a <xref:System.NotSupportedException> exception.
]]></format>
</remarks>
<exception cref="T:System.NotSupportedException">An attempt to set the value is made.</exception>
</Docs>
</Member>
<Member MemberName="Text">
<MemberSignature Language="C#" Value="public string Text { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance string Text" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.DataBoundLiteralControl.Text" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Text As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::String ^ Text { System::String ^ get(); };" />
<MemberSignature Language="F#" Value="member this.Text : string" Usage="System.Web.UI.DataBoundLiteralControl.Text" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the text content of the <see cref="T:System.Web.UI.DataBoundLiteralControl" /> object.</summary>
<value>A <see cref="T:System.String" /> that represents the text content of the <see cref="T:System.Web.UI.DataBoundLiteralControl" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.UI.DataBoundLiteralControl> class persists the value of its <xref:System.Web.UI.DataBoundLiteralControl.Text%2A> property to view state.
## Examples
The following code example creates a custom control and uses that control from within an .aspx file to display the text of a <xref:System.Web.UI.DataBoundLiteralControl> object. The custom control obtains a <xref:System.Web.UI.DataBoundLiteralControl> object and outputs the text property in its `Render` method.
[!code-csharp[SystemWebUI_DataBoundLiteralControl#1](~/samples/snippets/csharp/VS_Snippets_WebNet/SystemWebUI_DataBoundLiteralControl/CS/mydataboundliteralcontrol.cs#1)]
[!code-vb[SystemWebUI_DataBoundLiteralControl#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/SystemWebUI_DataBoundLiteralControl/VB/mydataboundliteralcontrol.vb#1)]
You can compile the control with the Visual Basic Compiler (vbc.exe) or C# Compiler (csc.exe). You must place the resulting .dll file in the Bin directory of the Web project, as shown in the following code example.
```vb
vbc /r:System.dll /r:System.Web.dll /t:library /out:myWebAppPath/bin/vb_myDataBoundLiteralControl.dll myDataBoundLiteralControl.vb
```
```csharp
csc /t:library /out:myWebAppPath/bin/cs_myDataBoundLiteralControl.dll myDataBoundLiteralControl.cs
```
The following code example demonstrates how the custom control is registered and used within an .aspx file.
[!code-aspx-csharp[SystemWebUI_DataBoundLiteralControl#2](~/samples/snippets/csharp/VS_Snippets_WebNet/SystemWebUI_DataBoundLiteralControl/CS/databoundform.aspx#2)]
[!code-aspx-vb[SystemWebUI_DataBoundLiteralControl#2](~/samples/snippets/visualbasic/VS_Snippets_WebNet/SystemWebUI_DataBoundLiteralControl/VB/databoundform.aspx#2)]
]]></format>
</remarks>
</Docs>
</Member>
</Members>
</Type>
You can’t perform that action at this time.