I get object reference not set or nullreference exception unhandled. on the lblMessage.Text = strMessage
1. potentially at a later stage. not at the current time.
2. how should I declare it? dim lblMessage as Label won't make it work. dim lblMessage as Label = new Label won't make it work
3. Sry forgot to change that. I got those matching in my code
I have another asp.net app where this works perfectly (non dotnetnuke).
This is my button:
<asp:Button ID="btnVerzenden" runat="server" Text="Verzenden" OnClick="btnVerzenden_Click" />
This is the onClick event of the button:
Protected Sub btnVerzenden_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim btnVerzenden As Button = sender
If controleReg() Then
If controleDeelname() Then
verwerkgegevens()
btnVerzenden.Text = "Test1"
setMessage("Test1b...")
Else
setMessage("Test2...")
btnVerzenden.Text = "Test2"
End If
Else
setMessage("Test3")
btnVerzenden.Text = "Test3..."
End If
End Sub
If I add Handles btnVerzenden.Click like jispen suggested it says: Handles clause requires a withevents variable defined in the containing type or one of its base types.