Javascript not work in partial view mvc.ext.net

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Javascript not work in partial view mvc.ext.net

    Hi,
    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

Similar Threads

  1. Replies: 8
    Last Post: Jul 16, 2012, 10:57 PM
  2. [CLOSED] Partial View Error
    By peter.campbell in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Feb 10, 2012, 10:32 AM
  3. [CLOSED] RegisterOnReadyScript in MVC partial view
    By SandorD in forum 1.x Legacy Premium Help
    Replies: 22
    Last Post: Aug 10, 2011, 4:17 PM
  4. Can't add record to store from partial view
    By craig2005 in forum 1.x Help
    Replies: 14
    Last Post: Jan 05, 2011, 11:59 PM
  5. Replies: 6
    Last Post: Feb 15, 2010, 9:15 AM

Posting Permissions