Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to call jquery function from controller and from jquery to controller
    text
    copied!<p>hi guyz how can i call the jquery function in my <code>registernewacct.cshtml</code> from my <code>homecontroller.cs</code>. and back and fort....</p> <p>my code in <code>homecontroller.cs</code></p> <pre><code> [AcceptVerbs(HttpVerbs.Get)] private bool IsValidRegisterNewAcct(string acctname, string dispname, string email, string password) { var crypto = new SimpleCrypto.PBKDF2(); bool IsValid = false; IsValidErrorMessage = ""; IsValidErrorMessageInt = 0; string NewAcctNameHash = MD5(acctname); string NewEmailHash = MD5(email); try { using (var db = new MainDbContext()) { var NewAcctName = db.user.FirstOrDefault(u =&gt; u.AcctNameSalt == NewAcctNameHash); if (NewAcctName != null) { IsValid = false; IsValidErrorMessage = "Account Name already Exist!"; } else { var NewEmail = db.user.FirstOrDefault(u =&gt; u.EmailSalt == NewEmailHash); if (NewEmail != null) { IsValid = false; IsValidErrorMessage = "Email Address already Exist!"; } else { //THIS AREA &lt;-- I wan to call my jquery function in my registernewacct.cshtml which is the dialog confirmation will ask if save or not. now if the answer is yes then it will return value yes. if not then it will return not. var InsertNewAcctName = db.user.CreateObject(); InsertNewAcctName.UserId = Convert.ToString(Guid.NewGuid()); InsertNewAcctName.AcctName = acctname; InsertNewAcctName.AcctNameSalt = NewAcctNameHash; InsertNewAcctName.DisplayName = dispname; InsertNewAcctName.Email = email; InsertNewAcctName.EmailSalt = MD5(email); InsertNewAcctName.Password = crypto.Compute(password); InsertNewAcctName.PasswordSalt = crypto.Salt; InsertNewAcctName.UserLevel = 2; db.osoa_user.AddObject(InsertNewAcctName); db.SaveChanges(); IsValid = true; } } } } </code></pre> <p>this is the code in my <code>registernewacct.cshtml</code></p> <pre><code> @section Scripts{ &lt;script&gt; $(document).ready(function(){ //THIS IS FOR THE CANCEL ACCOUNT DIALOG function OpenDialogConfirmation(){ $( "#SaveDialogPage" ).dialog( "open" ); } $("#yessavedialog").click(function(e) { $( "#SaveDialogPage" ).dialog( "close" ); //then the code here that will pass my value back to homecontroller.cs.... }); $("#cancelsavedialog").click(function(e) { $( "#SaveDialogPage" ).dialog( "close" ); //then the code here that will pass my value back to homecontroller.cs.... }); }); &lt;/script&gt; } </code></pre> <p>can you give me some advice? thanks a lot</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload