ASP.Net : Problem in Button.OnClientClick Property.
-
hi in my WebForm I have a label and textBox and button, i want when user click button,OnClientClick occure and set label.Text to "Please Wait ..." how to do that? Note : i want to use JavaScript to Execute this Action (Client Side). i wrote this code but when i click button, Nothing Occured : .... "OnClientClick"="_Wait();" function _Wait() { document.getElementById("Label13").Text = "Please Wait ..."; } thanks.
-
hi in my WebForm I have a label and textBox and button, i want when user click button,OnClientClick occure and set label.Text to "Please Wait ..." how to do that? Note : i want to use JavaScript to Execute this Action (Client Side). i wrote this code but when i click button, Nothing Occured : .... "OnClientClick"="_Wait();" function _Wait() { document.getElementById("Label13").Text = "Please Wait ..."; } thanks.
You could use serveside code to do it insteed. But this will incur a roundtrip/postback to the server. If your posting back anyway you might as well use the serverside method.
Blog Have I http:\\www.frankkerrigan.com
-
hi in my WebForm I have a label and textBox and button, i want when user click button,OnClientClick occure and set label.Text to "Please Wait ..." how to do that? Note : i want to use JavaScript to Execute this Action (Client Side). i wrote this code but when i click button, Nothing Occured : .... "OnClientClick"="_Wait();" function _Wait() { document.getElementById("Label13").Text = "Please Wait ..."; } thanks.
hdv212 wrote:
... "OnClientClick"="_Wait();"
It should be
yourbuttonname.Attributes.Add("OnClick","_Wait()");
protected void yourbuttonname_Click(object sender, EventArgs e) { Label13.Text = TextBox1.Text; }
Hope this helps
"My advice to you is to get married. If you find a good wife, you will be happy; if not, you will become a philosopher." Socrates
-
hdv212 wrote:
... "OnClientClick"="_Wait();"
It should be
yourbuttonname.Attributes.Add("OnClick","_Wait()");
protected void yourbuttonname_Click(object sender, EventArgs e) { Label13.Text = TextBox1.Text; }
Hope this helps
"My advice to you is to get married. If you find a good wife, you will be happy; if not, you will become a philosopher." Socrates
-
hi in my WebForm I have a label and textBox and button, i want when user click button,OnClientClick occure and set label.Text to "Please Wait ..." how to do that? Note : i want to use JavaScript to Execute this Action (Client Side). i wrote this code but when i click button, Nothing Occured : .... "OnClientClick"="_Wait();" function _Wait() { document.getElementById("Label13").Text = "Please Wait ..."; } thanks.
Was that _Wait() function even called? Where is that script located? In head? Do you get any javascript errors in browser? Is that label's id really "Label13"? Could be as well someControl$ctrl00$Label13 or something...
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus