Skip to content

Commit 589eafd

Browse files
committed
docs(chat): Add content to Server-side programming article
1 parent b1bed96 commit 589eafd

File tree

1 file changed

+80
-1
lines changed

1 file changed

+80
-1
lines changed

controls/chat/server-side-programming/overview.md

Lines changed: 80 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,89 @@ published: True
88
position: 0
99
---
1010

11-
# Server-side Programming Overview
11+
# Server-side Programming
1212

13+
You can configure the settings of **RadChat** and create its elements on the code-behind via the Server-Side API of this customizable ASP.NET Chat control.
1314

15+
## Configuring a Chat From the Code-Behind
1416

17+
**Example 1** shows a possible application of the Server-Side API of the chat. The code in the example configures some settings of the chat, of its User and Messages settings, then assigns the event handlers of the client-side events.
18+
19+
>caption **Figure 1**: A chat that is configured from the code-behind.
20+
21+
![diagram-programmatic-creation](images/diagram-programmatic-creation.png)
22+
23+
>caption **Example 1**: Configuring a diagram on the server-side.
24+
25+
````C#
26+
protected void Page_Load(object sender, EventArgs e)
27+
{
28+
RadChat chat = new RadChat();
29+
chat.ID = "RadChat1";
30+
chat.CssClass = "my-chat";
31+
32+
chat.MessagesSettings.Placeholder = "Hey ya, write here";
33+
34+
chat.UserSettings.Name = "John";
35+
chat.UserSettings.IconUrl = "John";
36+
37+
chat.ClientEvents.OnActionClick = "оnActionClick";
38+
chat.ClientEvents.OnInitialize = "onInitialize";
39+
chat.ClientEvents.OnLoad = "onLoad";
40+
chat.ClientEvents.OnPost = "onPost";
41+
chat.ClientEvents.OnSendMessage = "onSendMessage";
42+
chat.ClientEvents.OnTypingEnd = "onTypingEnd";
43+
chat.ClientEvents.OnTypingStart = "onTypingStart";
44+
45+
Form.Controls.Add(chat);
46+
}
47+
````
48+
````VB
49+
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
50+
Dim chat As RadChat = New RadChat()
51+
chat.ID = "RadChat1"
52+
chat.CssClass = "my-chat"
53+
54+
chat.MessagesSettings.Placeholder = "Hey ya, write here"
55+
56+
chat.UserSettings.Name = "John"
57+
chat.UserSettings.IconUrl = "John"
58+
59+
chat.ClientEvents.OnActionClick = "оnActionClick"
60+
chat.ClientEvents.OnInitialize = "onInitialize"
61+
chat.ClientEvents.OnLoad = "onLoad"
62+
chat.ClientEvents.OnPost = "onPost"
63+
chat.ClientEvents.OnSendMessage = "onSendMessage"
64+
chat.ClientEvents.OnTypingEnd = "onTypingEnd"
65+
chat.ClientEvents.OnTypingStart = "onTypingStart"
66+
67+
Form.Controls.Add(chat)
68+
End Sub
69+
````
70+
71+
````JavaScript
72+
function onTypingStart(sender, args) {
73+
74+
}
75+
function onTypingEnd(sender, args) {
76+
77+
}
78+
function onSendMessage(sender, args) {
79+
80+
}
81+
function onPost(sender, args) {
82+
83+
}
84+
function onLoad(sender) {
85+
86+
}
87+
function оnActionClick(sender, args) {
88+
89+
}
90+
function onInitialize(sender) {
91+
92+
}
93+
````
1594

1695
# See Also
1796

0 commit comments

Comments
 (0)