rhishi20 Posted March 16, 2015 Share Posted March 16, 2015 case1 -------- Protected Sub lnkResdept_Click(ByVal sender As Object, ByVal e As System.EventArgs) Dim resdept As String resdept = sender.text End Sub case2 -------- Protected Sub lnkResdept_Click(ByVal sender As Object, ByVal e As System.EventArgs) resdept= CType(sender, LinkButton).Text end sub I am not able to understand difference between these two cases, case1 produces the linkbutton's value for example C1500017 and case2 also produces same result. I am not able to understand why explicit type casting is done in case2. thanks, Rhishikesh Link to comment Share on other sites More sharing options...
justsomeguy Posted March 16, 2015 Share Posted March 16, 2015 It's just 2 ways to do the same thing. You can either access the text property, or you can convert the sender object to a Text type (which probably accesses the text property behind the scenes). 1 Link to comment Share on other sites More sharing options...
rhishi20 Posted March 17, 2015 Author Share Posted March 17, 2015 Thanks bro ! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now