I want to have a cancel button in my Master page. This button will be on every page. So found this example:
http://professionalaspnet.com/archive/2007/01/11/Handling-Master-Page-Click-Events-in-the-Content-Page.aspxNot sure why mine doesnt work;
1. In MasterPage I have:
<asp:Button ID="btnCancel" runat="server" CssClass="Button" Text="Cancel" />
2. Added this property in Design.Master.VB
Public Partial Class Design
Inherits System.Web.UI.MasterPage
Public ReadOnly Property btnCancelms() As Button
Get
Return btnCancel
End Get
End Property
....
3. In Search.aspx I have:
Dim msPage As Design = CType(Master, Design)
If Not IsNothing(msPage) Then
AddHandler msPage.btnCancelms.Click, AddressOf btnCancelms_Click
End If
...
Protected Sub btnCancelms_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
.....
End Sub
*****with that, I cant compile the code. I get this error:
Unable to copy file "XXX" to "bin\XXX.dll". The process cannot access the file 'XXX' because it is being used by another process.
What am I missing?
Start Free Trial