按钮布局asp.net自定义按钮
我有一个div中3个标签。我想让div可点击并通过点击div触发回发。 在essensce我想做一个自定义按钮,看起来像图片。到目前为止,我发现这样做的唯一方法是让div onclick事件触发javascript,或者做一些自定义的usercontrol魔术,我无法使用它。
用户控制
<div class="meetingContainer" >
<div class="meetingCityState">
<asp:Label ID="lblMeetingCityState" runat="server" Text='<%# Eval("City") %>'></asp:Label>
</div>
<div>
<asp:Label ID="lblMeetingDate" runat="server" Text='<%# Eval("MeetingDate") %>'></asp:Label>
</div>
<div>
<asp:Label ID="lblMeetingSite" runat='server' Text='<%# Eval("Location") %>'></asp:Label>
</div>
</div>
代码背后
<System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.Demand, Name:="FullTrust")> _
Partial Public Class MeetingButton
Inherits System.Web.UI.UserControl
Implements System.Web.UI.IPostBackEventHandler
Public Event Click As EventHandler
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub
Protected Overridable Sub OnClick(ByVal E As EventArgs)
RaiseEvent Click(Me, E)
End Sub
Public Sub RaisePostBackEvent(ByVal eventArgument As String) _
Implements IPostBackEventHandler.RaisePostBackEvent
OnClick(New EventArgs())
End Sub
End Class
Bueller?Bueller? – gh9 2011-02-08 17:28:22