Access C# variable from javascript function or vice versa in asp.net -


i have function checks if there numbers in textbox. if doesn't pass, program won't execute sql insert. i, however, need show popup message. popup function in javascript code, , variable, alertstring in server side code. how can call popup function in button click code? page postback don't know do. if needs clearer, can post more code. i'm using visual studios 2005. page seems refresh. if return false onclientclick, works, executeinsert method won't work

buttonclick function

protected void button3_click(object sender, eventargs e)     {          if (checkstrings()) //checkstrings funciton         {             button3.attributes.add("onclick", "return false;");//fails             string script = "delayer(5000);";             clientscript.registerstartupscript(typeof(page), "buttonalert", script, true);  //doesn't work if onclientlick returns true.          }         else         { ...               executeinsert(dttime, intshift, intoperator, line1, cancode1, intcanvac1, intcantemp1, intimage1, intseam1, strcomments1, null, null, null,                 false, null, null, false, intsku, line2, cancode2, intcanvac2, intcantemp2, intseam2, strcomments2, null, intsku2, intcoredia1, intcoredia2);  //fails if return false client click         }     } 


Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -