I trying to reproduce this following scenario : I have 1 button(btnTest) outside an asp updatePanel, inside then i have 2 rad notifications, i have other as update panel with 2 radtextBox and 1 button(btnInsert), what i want is: i will click on the btnTest it will show 'Start Processing', and when done(after 8 seconds), appears 'Done!' (OK, this works), but lets suppose that i click on button, the Start Processing appears, and while the request running(doesnt appear 'Done!' yet), i click on the btnInsert, so i wanna the btnInsert, do what he need to do, and the request of btnTest keep running. Why my actual code doesnt work for that? Can someone point me to right direction, or help me provide a code?
thanzk
the asp code
the .cs code
In this actual scenario, if i click on the second button while the request of first button still running, apparently, the first request is canceled, because the msg of my radNotificaion will never appears.
thanzk
the asp code
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:RadScriptManager
ID
=
"Script"
runat
=
"server"
/>
<
div
id
=
"divPrincipal"
>
<
telerik:RadCodeBlock
ID
=
"RadCodeBlock1"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
function Start() {
var notification = $find('<%= RadNotification1.ClientID %>');
notification.show();
}
</
script
>
</
telerik:RadCodeBlock
>
<
telerik:RadButton
ID
=
"btnTeste"
runat
=
"server"
Text
=
"Teste"
OnClick
=
"btnTeste_Click"
OnClientClicked
=
"Start"
/>
<
asp:UpdatePanel
ID
=
"updNotificacao"
UpdateMode
=
"Conditional"
runat
=
"server"
ChildrenAsTriggers
=
"false"
>
<
ContentTemplate
>
<
telerik:RadNotification
ID
=
"RadNotification1"
runat
=
"server"
EnableRoundedCorners
=
"true"
EnableShadow
=
"true"
Text
=
"Começou a Processar"
Title
=
"Mensagem"
Width
=
"300"
Height
=
"100"
/>
<
telerik:RadNotification
ID
=
"RadNotification2"
runat
=
"server"
EnableRoundedCorners
=
"true"
EnableShadow
=
"true"
Text
=
"Execucao Concluida"
Title
=
"Mensagem"
Width
=
"300"
Height
=
"100"
/>
</
ContentTemplate
>
<
Triggers
>
<
asp:AsyncPostBackTrigger
ControlID
=
"btnTeste"
EventName
=
"Click"
/>
</
Triggers
>
</
asp:UpdatePanel
>
<
asp:UpdatePanel
runat
=
"server"
ID
=
"updForm"
UpdateMode
=
"Conditional"
ChildrenAsTriggers
=
"false"
>
<
ContentTemplate
>
<
table
>
<
tr
>
<
td
>Codigo:</
td
>
<
td
>
<
telerik:RadTextBox
ID
=
"txtNome"
runat
=
"server"
TextMode
=
"SingleLine"
/>
</
td
>
</
tr
>
<
tr
>
<
td
>Descricao:</
td
>
<
td
>
<
telerik:RadTextBox
ID
=
"txtDescricao"
runat
=
"server"
TextMode
=
"SingleLine"
/>
</
td
>
</
tr
>
<
tr
>
<
td
>
<
telerik:RadButton
ID
=
"btnInserir"
Text
=
"Inserir"
runat
=
"server"
OnClick
=
"btnInserir_Click"
/>
<
asp:Label
Text
=
""
ID
=
"lblResultado"
runat
=
"server"
/>
</
td
>
</
tr
>
</
table
>
</
ContentTemplate
>
<
Triggers
>
<
asp:AsyncPostBackTrigger
ControlID
=
"btnInserir"
EventName
=
"Click"
/>
</
Triggers
>
</
asp:UpdatePanel
>
</
div
>
</
form
>
the .cs code
protected
void
btnTeste_Click(
object
sender, EventArgs e)
{
Task task = Task.Run(() =>
{
Thread.Sleep(8000);
RadNotification2.Text =
"Execução Concluída!"
;
RadNotification2.Show();
});
task.Wait();
}
protected
void
btnInserir_Click(
object
sender, EventArgs e)
{
C001 c =
new
C001();
int
i = c.RegistrarDados(txtDescricao.Text);
if
(i != 0)
{
lblResultado.Text =
"Registro Inserido!"
;
}
else
{
lblResultado.Text =
"Registro nao pode ser Inserido!"
;
}
updForm.Update();
}
In this actual scenario, if i click on the second button while the request of first button still running, apparently, the first request is canceled, because the msg of my radNotificaion will never appears.