Aug 05, 2011, 8:17 AM
Javascript not work in partial view mvc.ext.net
Hi,
I have a problem with ext.net MVC
My controllers:
I need some advice.
Thanks.
I have a problem with ext.net MVC
My controllers:
//User control Insert Chapter
public ActionResult uc_InsertChapter(string containerId)
{
Ext.Net.MVC.PartialViewResult pr = new Ext.Net.MVC.PartialViewResult();
pr.SingleControl = true;
pr.WrapByScriptTag = false;
return pr;
}
and user control: <script language="javascript" type="text/javascript">
function btn_CancelChapterClick() {
window.InsertChapter_UC_wdow_InsertChapter.hide();
clear();
}
var success = function (form, action) {
eval(action.result.script);
};
//clear value in form
function clear() {
window.InsertChapter_UC_txt_ChapterTitle.setValue('');
window.InsertChapter_UC_txt_ChapterDescription.setValue('');
window.InsertChapter_UC_cbx_ChapterPublished.setValue(false);
}
//when hide window
function wdow_InsertChapterHide() {
window.InsertChapter_UC_wdow_InsertChapter.hide();
clear();
}
</script>
<ext:Window runat="server" ID="wdow_InsertChapter" Width="500" Height="250"
Frame="true" Resizable="false" Title="Thêm Chapter" Modal="true">
<Items>
<ext:FormPanel ID="fpnel_InsertChapter" runat="server" Layout="Form" Width="486"
Height="220" MonitorValid="true" Frame="true" MonitorResize="true" LabelAlign="Left"
ButtonAlign="Right" LabelSeparator=" " Url="/ICDManagement/Insert_ICDChapter">
<Items>
<ext:TextArea ID="txt_ChapterTitle" runat="server" FieldLabel="<%$Resources:Resource,ICDInsertICDCodetxtCodeTitle %>"
AnchorHorizontal="90%" MaxLength="500" EmptyText="<%$Resources:Resource,ICDWindowCodeTitle %>"
AllowBlank="false" MsgTarget="Side" BlankText="<%$Resources:Resource,ICDWindowCodeTitle %>">
</ext:TextArea>
<ext:TextArea ID="txt_ChapterDescription" runat="server" FieldLabel="<%$Resources:Resource,ICDGridDescription %>"
MaxLength="4000" AnchorHorizontal="90%">
</ext:TextArea>
<ext:Checkbox ID="cbx_ChapterPublished" runat="server" FieldLabel="<%$Resources:Resource,ICDGridPublished %>"
AnchorHorizontal="90%">
</ext:Checkbox>
</Items>
<Listeners>
<ClientValidation Handler="#{btn_SubmitChapter}.setDisabled(!valid);" />
</Listeners>
</ext:FormPanel>
</Items>
<Buttons>
<ext:Button ID="btn_CancelChapter" runat="server" Text="<%$Resources:Resource,ICDInsertICDCodebtnCancel %>"
Icon="Cancel">
<Listeners>
<Click Handler="btn_CancelChapterClick()" />
</Listeners>
</ext:Button>
<ext:Button ID="btn_SubmitChapter" runat="server" Text="<%$Resources:Resource,ICDInsertICDCodebtnSubmit %>"
Icon="Accept">
<Listeners>
<Click Handler="#{InsertChapter_UC_fpnel_InsertChapter}.form.submit({ waitMsg : 'Sending...', success : success });" />
</Listeners>
</ext:Button>
</Buttons>
<Listeners>
<Hide Handler="wdow_InsertChapterHide();" />
</Listeners>
</ext:Window>
when I click button cancel to call btn_CancelChapterClick function. It is not work.I need some advice.
Thanks.
Last edited by Daniil; Aug 08, 2011 at 6:07 PM.
Reason: Please use [CODE] tags