I am trying to open a window with a label set from code behind.
The window opens but the label is not set
This is how the popup is declared:
And this is the WebMethod
Not sure what I am doing wrong.
The window opens but the label is not set
<
telerik:RadCodeBlock
ID
=
"RadCodeBlock2"
runat
=
"server"
>
<
script
type
=
"text/javascript"
language
=
"javascript"
>
function aspButtonCallbackFn(sender, args) {
PageMethods.PrepareForSearchResult(args.get_text(), MyMethod_Result);
}
function MyMethod_Result(pResult) {
if (pResult == 2) {
var wnd = $find("<%=modalPopup.ClientID %>");
wnd.show();
}
}
</
script
>
</
telerik:RadCodeBlock
>
This is how the popup is declared:
<
telerik:RadWindow
ID
=
"modalPopup"
runat
=
"server"
AutoSizeBehaviors
=
"Width, Height"
AutoSize
=
"true"
VisibleStatusbar
=
"false"
Behaviors
=
"Move"
VisibleOnPageLoad
=
"false"
ReloadOnShow
=
"true"
Modal
=
"true"
EnableShadow
=
"true"
>
<
ContentTemplate
>
<
asp:UpdatePanel
ID
=
"PdtPnl_ForAddExisting"
runat
=
"server"
UpdateMode
=
"Conditional"
>
<
ContentTemplate
>
<
div
style
=
"display: table; width: 100%"
>
<
div
style
=
"display: table-row; vertical-align: middle"
>
<
div
style
=
"display: table-cell; padding-top: 10px; padding-left: 10px; padding-bottom: 5px; padding-right: 10px;"
>
<
asp:Label
ID
=
"Lbl_Pnl_ForAddExisting"
runat
=
"server"
Text
=
""
/>
</
div
>
</
div
>
</
div
>
<
div
style
=
"display: table; width: 100%"
>
<
div
style
=
"display: table-row; vertical-align: middle"
>
<
div
style
=
"display: table-cell; padding-top: 5px; padding-left: 10px; padding-bottom: 10px; padding-right: 5px;"
>
<
asp:Button
ID
=
"Bttn_Add_ForAddExisting"
Width
=
"100"
OnClick
=
"Bttn_Add_ForAddExisting_Click"
Text
=
"Add"
runat
=
"server"
class
=
"button"
/>
</
div
>
<
div
style
=
"display: table-cell; padding-top: 5px; padding-left: 5px; padding-bottom: 10px; padding-right: 10px;"
>
<
asp:Button
ID
=
"Bttn_Cancel_ForAddExisting"
Width
=
"100"
OnClick
=
"Bttn_Cancel_ForAddExisting_Click"
Text
=
"Cancel"
runat
=
"server"
class
=
"button"
/>
</
div
>
</
div
>
</
div
>
</
ContentTemplate
>
</
asp:UpdatePanel
>
</
ContentTemplate
>
</
telerik:RadWindow
>
And this is the WebMethod
[WebMethod]
public
static
int
PrepareForSearchResult(
string
pText)
{
if
(String.IsNullOrEmpty(pText) ==
true
)
{
return
-1;
}
_instance.Lbl_Pnl_ForAddExisting.Text = String.Format(
"Do you want to add '{0}'?"
, pText);
_instance.PdtPnl_ForAddExisting.Update();
return
2;
}
Not sure what I am doing wrong.