Question fail to display javascrip.

kinki_2046

Member
Joined
Jun 8, 2011
Messages
23
Programming Experience
Beginner
Dear all,

The code below is part of my code.
I need to prompt alert message when the viewstate is empty, but I fail to do it. It was nothing happen.
Who can help me to make the correction?




Protected Sub btnAdd_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles imgbtnAddtoCart.Click
If viewState("Size") = "0" then
displayMessage("Please select Size")
endif

end sub

Private Sub DisplayMessage(ByVal vsiMessage As String)
clientScript.RegisterStartupScript(Me, Me.GetType, "alert", "alert('" & vsiMessage & "');", True)
End Sub

Thanks.
 
Back
Top