View Full Version : [CLOSED] How can Xscript code call code behind method..need syntax

May 13, 2014, 4:57 PM
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.setTitle(Ext.String.format("Employee Details : {0}, {1}", rec.data.LastName, rec.data.FirstName));

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";
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";
this.idPasscodeFlag.Text = "0";


Thanks for all the help.

May 13, 2014, 5:11 PM
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.

May 13, 2014, 5:17 PM
[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

May 13, 2014, 7:39 PM
The best approach would be to review the samples in the Examples Explorer (http://examples.ext.net). There are several samples for calling DirectMethods.