martie_11
asked on
Convert to VB.NET
Not sure if this should be in the C# area or here, but nonetheless here's what I'd like to convert to VB.NET:
public void btnCloseTask_Click(object sender, System.EventArgs e)
{
Button myButton = sender as Button;
Response.Write("<script>al ert(" + myButton.CommandArgument + ")</script>");
//Redirect code goes here
}
Here's how far I've gotten:
Public Sub btnCloseTask_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim myButton As Button ' here I want to set myButton equal to sender. However, sender is of type Object; I need to cast
' sender to a Button and set it to myButton
Response.Write("<script>al ert(" + myButton.CommandArgument + ")</script>")
End Sub
Thanks...
public void btnCloseTask_Click(object sender, System.EventArgs e)
{
Button myButton = sender as Button;
Response.Write("<script>al
//Redirect code goes here
}
Here's how far I've gotten:
Public Sub btnCloseTask_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim myButton As Button ' here I want to set myButton equal to sender. However, sender is of type Object; I need to cast
' sender to a Button and set it to myButton
Response.Write("<script>al
End Sub
Thanks...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Public Sub btnCloseTask_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim myButton As Button = CType(ConversionHelpers.As Workaround (sender, GetType(Button)), Button)
Response.Write("<script>al ert(" + myButton.CommandArgument + ")</script>")
End Sub
ran through a converter, basically what timcottee stated... figure I would post it though
Dim myButton As Button = CType(ConversionHelpers.As
Response.Write("<script>al
End Sub
ran through a converter, basically what timcottee stated... figure I would post it though
ASKER
Thanks for the post bman9111.
I didn't test Tim's code, but if it doesn't work and yours does, I'll open another Q and give some points to you.
BTW, what converter are you using?
I didn't test Tim's code, but if it doesn't work and yours does, I'll open another Q and give some points to you.
BTW, what converter are you using?
ASKER
Thanks!