Skip to content

Commit 24e5701

Browse files
docs(switch): Fix code formatting
1 parent 4f02258 commit 24e5701

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

controls/switch/getting-started.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -67,27 +67,28 @@ The following tutorial demonstrates how to set up a page with a **RadSwitch** co
6767
<telerik:RadLabel ID="Label1" runat="server"></telerik:RadLabel>
6868

6969
1. Use the **CheckedChanged** event handler to write information about the switch properties:
70-
71-
**C#**
7270

73-
protected void RadSwitch1_CheckedChanged(object sender, EventArgs e)
74-
{
75-
var switchObj = sender as RadSwitch;
76-
var currentText = (bool)switchObj.Checked ? switchObj.ToggleStates.ToggleStateOn.Text : switchObj.ToggleStates.ToggleStateOff.Text;
77-
string data = string.Format("current text: {0}, current value {1}, current command argument: {2}, checked: {3}",
71+
**C#**
7872

73+
protected void RadSwitch1_CheckedChanged(object sender, EventArgs e)
74+
{
75+
var switchObj = sender as RadSwitch;
76+
var currentText = (bool)switchObj.Checked ? switchObj.ToggleStates.ToggleStateOn.Text : switchObj.ToggleStates.ToggleStateOff.Text;
77+
string data = string.Format("current text: {0}, current value {1}, current command argument: {2}, checked: {3}",
78+
7979
currentText, switchObj.Value, switchObj.CommandArgument, switchObj.Checked);
80-
Label1.Text = data;
81-
}
80+
Label1.Text = data;
81+
}
82+
8283

8384
**VB**
8485

85-
Protected Sub RadSwitch1_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs)
86-
Dim switchObj = TryCast(sender, RadSwitch)
87-
Dim currentText = If(CBool(switchObj.Checked), switchObj.ToggleStates.ToggleStateOn.Text, switchObj.ToggleStates.ToggleStateOff.Text)
88-
Dim data As String = String.Format("current text: {0}, current value {1}, current command argument: {2}, checked: {3}", currentText, switchObj.Value, switchObj.CommandArgument, switchObj.Checked)
89-
Label1.Text = data
90-
End Sub
86+
Protected Sub RadSwitch1_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs)
87+
Dim switchObj = TryCast(sender, RadSwitch)
88+
Dim currentText = If(CBool(switchObj.Checked), switchObj.ToggleStates.ToggleStateOn.Text, switchObj.ToggleStates.ToggleStateOff.Text)
89+
Dim data As String = String.Format("current text: {0}, current value {1}, current command argument: {2}, checked: {3}", currentText, switchObj.Value, switchObj.CommandArgument, switchObj.Checked)
90+
Label1.Text = data
91+
End Sub
9192

9293

9394
## See Also

0 commit comments

Comments
 (0)