Hi All,
I am adding comments to the database by opening the modal pop up extender. User can type the comment in the modal pop up text box and as soon as the user clicks Ok button, the comments go to the database, and i pull those saved comments from database and display them in the grid.
Everything works fine except when I put the ajax panel around the Ok button, the display of the saved comments stopped right away. I am not sure what am I doing wrong. Below is my code
and the code behind is
radGrid_cComments_Bind , refreshes the gris and shows the user comments right away.
Any help will be appreciated.
I am adding comments to the database by opening the modal pop up extender. User can type the comment in the modal pop up text box and as soon as the user clicks Ok button, the comments go to the database, and i pull those saved comments from database and display them in the grid.
Everything works fine except when I put the ajax panel around the Ok button, the display of the saved comments stopped right away. I am not sure what am I doing wrong. Below is my code
<
asp:LinkButton
ID
=
"lnkComments"
runat
=
"server"
Text
=
"Add Comments"
></
asp:LinkButton
>
<
div
>
<
asp:Panel
ID
=
"panel1"
runat
=
"server"
CssClass
=
"modalPopup"
Style
=
"display: none"
Width
=
"500px"
BackColor
=
"#E6E6E6"
>
<
p
>
Please add the comments</
p
>
<
asp:TextBox
ID
=
"txt_comments"
runat
=
"server"
TextMode
=
"MultiLine"
Width
=
"480px"
></
asp:TextBox
>
<
div
>
<
telerik:RadAjaxPanel
runat
=
"server"
ID
=
"RadAjaxPanel_Ok"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
>
<
asp:Button
ID
=
"OkButton"
runat
=
"server"
Text
=
"OK"
OnClick
=
"OkButton_Click"
CommandName
=
"Ok"
/>
<
asp:Button
ID
=
"CancelButton"
runat
=
"server"
Text
=
"Cancel"
/>
</
telerik:RadAjaxPanel
>
</
div
>
</
asp:Panel
>
</
div
>
<
div
>
<
asp:ModalPopupExtender
ID
=
"ModalPopUp_Comments"
runat
=
"server"
TargetControlID
=
"lnkComments"
PopupControlID
=
"panel1"
BackgroundCssClass
=
"modalBackground"
CancelControlID
=
"cancelButton"
DropShadow
=
"true"
>
</
asp:ModalPopupExtender
>
</
div
>
and the code behind is
protected void OkButton_Click(object sender, System.EventArgs e)
{
ModalPopupExtender ModalPopUp_Comments = (ModalPopupExtender)RadGrid_cDetailsView.MasterTableView.Items[0].FindControl("ModalPopUp_Comments");
TextBox txt_comments = (TextBox)RadGrid_cDetailsView.MasterTableView.Items[0].FindControl("txt_comments");
RadGrid RadGrid_cComments =(RadGrid) RadGrid_cDetailsView.MasterTableView.Items[0].FindControl("RadGrid_cComments");
ModalPopUp_Comments.Hide();
cComments comments = new cComments();
CiscHeader cHeader = new CiscHeader();
cHeader.cId = Request.QueryString["ID"];
if(txt_comments.Text != "")
{
//comments.UserId = HttpContext.Current.User.Identity.Name;
// for testing purposes only
comments.UserId = "Anjali";
comments.UserComment = txt_comments.Text;
}
cHeader.AddcComments(comments);
cScoringCtrl cscoringCtrl = new cScoringCtrl();
cscoringCtrl.savecComments(cHeader);
txt_comments.Text = string.Empty;
cHeader.cComment.Clear();
cscoringCtrl.getcComments(cHeader);
RadGrid_cComments_Bind(cHeader, RadGrid_cComments);
}
Any help will be appreciated.