本文整理汇总了VB.NET中System.Web.HttpParseException类的典型用法代码示例。如果您正苦于以下问题:VB.NET HttpParseException类的具体用法?VB.NET HttpParseException怎么用?VB.NET HttpParseException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了HttpParseException类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的VB.NET代码示例。
示例1: AddParsedSubObject
' 导入命名空间
Imports System.Security.Permissions
Imports System.Collections
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.HtmlControls
Namespace Samples.AspNet.VB
' Define a child control for the custom HtmlSelect.
Public Class MyCustomOption
Private _id As String
Private _value As String
Public Property optionid() As String
Get
Return _id
End Get
Set(ByVal value As String)
_id = value
End Set
End Property
Public Property value() As String
Get
Return _value
End Get
Set(ByVal value As String)
_value = value
End Set
End Property
End Class
' Define a custom HtmlSelectBuilder.
Public Class MyHtmlSelectBuilderWithparseException
Inherits HtmlSelectBuilder
<AspNetHostingPermission(SecurityAction.Demand, Level:=AspNetHostingPermissionLevel.Minimal)> _
Public Overrides Function GetChildControlType(ByVal tagName As String, ByVal attribs As IDictionary) As Type
' Distinguish between two possible types of child controls.
If tagName.ToLower().EndsWith("mycustomoption") Then
Return GetType(MyCustomOption)
Else
Throw New HttpParseException("This custom HtmlSelect control" & _
"requires child elements of the form ""MyCustomOption""")
End If
End Function
End Class
<ControlBuilderAttribute(GetType(MyHtmlSelectBuilderWithparseException))> _
Public Class CustomHtmlSelectWithHttpParseException
Inherits HtmlSelect
' Override the AddParsedSubObject method.
Protected Overrides Sub AddParsedSubObject(ByVal obj As Object)
Dim _outputtext As String
If TypeOf obj Is MyCustomOption Then
_outputtext = "custom select option : " + CType(obj, MyCustomOption).value
Dim li As New ListItem(_outputtext, CType(obj, MyCustomOption).value)
MyBase.Items.Add(li)
End If
End Sub
End Class
End Namespace
开发者ID:VB.NET开发者,项目名称:System.Web,代码行数:76,代码来源:HttpParseException
注:本文中的System.Web.HttpParseException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论