Hi mohal92,
Use goto Statement.
It can jump to anywhere in the same action scope. You can use goto to customize your logic flow, even use it to simulate recursion, iteration, and selection.
Refer below sample code.
Code
C#
protected void OnValidate(object sender, EventArgs e)
{
validate("1");
}
public string validate(string descr)
{
string detail = "";
switch (descr)
{
case "1":
detail = descr;
goto case "3";
case "2":
break;
case "3":
return detail;
}
return descr;
}
VB.Net
Protected Sub OnValidate(ByVal sender As Object, ByVal e As EventArgs)
validate("1")
End Sub
Public Function validate(ByVal descr As String) As String
Dim detail As String = ""
Select Case descr
Case "1"
Case1:
detail = descr
GoTo Case3
Case "2"
Case2:
Case "3"
Case3:
Return detail
End Select
Return descr
End Function