[CLOSED] How can Xscript code call code behind method..need syntax

  1. #1

    [CLOSED] How can Xscript code call code behind method..need syntax

    Hi,
    Can control be passed on from client side script within XScript tag to a method in .cs page?
    Like i have a popup that opens from a function in Xscript

    open : function () {
               
                    rec = this.getRecord();
                
                    if (rec != null) {
                        win = #{winInvite};
                    
                        win.show();
    //                    win.setTitle(Ext.String.format("Employee Details : {0}, {1}", rec.data.LastName, rec.data.FirstName));
    //                
                        #{idInviteEmail}.getForm().loadRecord(rec);
                        #{idPasscodeEmail}.getForm().loadRecord(rec);
                    }


    Now I want to call a code behind function like the following
    public void btnSendEmail_Click(object sender, EventArgs e)
        {
            
    
            string strFrom="",strTo="",strCC="",strSubInv="",strMsgInv="" ,strSubPasscode="",strMsgPasscode="", strPojs="";
            int flagEmailInv,flagEmailPasscode;
            int idTab = this.TabPanel1.ActiveTabIndex;
            strPojs = this.idProjects.Value.ToString();
            Session["Projects"] = strPojs;
    
            
                //From, To and CC fields are common to both tabs of the popup
                strFrom = this.idFromInvite.Value.ToString();
                strTo = this.idToInvite.Value.ToString();
                strCC = this.idCCInvite.Value.ToString();
    
                strSubInv = this.idSubjectInvite.Value.ToString();
                strMsgInv = this.idMsgInvite.Value.ToString();
    
                strSubPasscode = this.idSubjectPasscode.Value.ToString();
                strMsgPasscode = this.idMsgPasscode.Value.ToString();
            
                //Email sending for Invitation
                flagEmailInv = SendEmail(strFrom, strTo, strCC, strSubInv, strMsgInv);
                Session["flagEmailInv"] = flagEmailInv;
                //Return codes saved in hidden field of grid
                if (flagEmailInv == 1)
    
                    this.idInvFlag.Text = "1";
                else
                    this.idInvFlag.Text = "0";
    
                
    
                //Email sending for Passcode
                flagEmailPasscode = SendEmail(strFrom, strTo, strCC, strSubPasscode, strMsgPasscode);
                Session["flagEmailPasscode"] = flagEmailPasscode;
                if (flagEmailPasscode == 1)
                    this.idPasscodeFlag.Text = "1";
                else
                    this.idPasscodeFlag.Text = "0";
       
        }
    Thanks for all the help.
    Last edited by Daniil; May 20, 2014 at 7:55 AM. Reason: [CLOSED]
  2. #2
    It would be great if you could put these pieces together into a simplified .aspx code sample demonstrating as much of the scenario as possible.

    Please ensure you remove all code that is not directly related to the scenario.
    Geoffrey McGill
    Founder
  3. #3
    [QUOTE]HI Geoffrey...there is really not much in the code.just could you tell me how i can call a method from within Xscript tag..i just need the synatx.The functionality has been implemented more or less.Not much problem with that. Thanks again[/QUOTE
  4. #4
    The best approach would be to review the samples in the Examples Explorer. There are several samples for calling DirectMethods.
    Geoffrey McGill
    Founder

Similar Threads

  1. Replies: 1
    Last Post: Jun 05, 2013, 11:01 AM
  2. Replies: 0
    Last Post: May 28, 2013, 2:51 PM
  3. Replies: 4
    Last Post: Sep 26, 2011, 2:59 PM
  4. [CLOSED] How to call a code behind method when a PanelForm gets valid
    By flormariafr in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Jun 22, 2010, 5:17 AM
  5. Code block in XScript
    By wazige in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 23, 2010, 8:37 AM

Posting Permissions