Take value from javascript function in aspx's html side to aspx.cs
-
Hai friends, I hava a javascript function like this in aspx page's html side. function calculate() { alert('welcome'); document.getElementById("<%=lbl_netamount.ClientID%>").innerText = currency_show_conversion(document.getElementById("lbl_netamt").innerText,"INR","USD"); var amount= document.getElementById("<%=lbl_netamount.ClientID%>").innerText; '<%=Session["Amount"]%>'=amount; document.getElementById("lbl_netamount").value = '<%=Session["Amount"]%>'; } I need to take the value from this scipt function into aspx.cs page.what I need to do for that?I write in Pageload event that btn_checkout.Attributes.Add("OnClick", "javascript:calculate()"); But while clicking the button btn_checkout nothing is happend.What wrong with my code.Please give any solution.How can i take value from html side to aspx.cs page.and also check if any mistake in my script.....Please help. Thanks Bijesh
-
Hai friends, I hava a javascript function like this in aspx page's html side. function calculate() { alert('welcome'); document.getElementById("<%=lbl_netamount.ClientID%>").innerText = currency_show_conversion(document.getElementById("lbl_netamt").innerText,"INR","USD"); var amount= document.getElementById("<%=lbl_netamount.ClientID%>").innerText; '<%=Session["Amount"]%>'=amount; document.getElementById("lbl_netamount").value = '<%=Session["Amount"]%>'; } I need to take the value from this scipt function into aspx.cs page.what I need to do for that?I write in Pageload event that btn_checkout.Attributes.Add("OnClick", "javascript:calculate()"); But while clicking the button btn_checkout nothing is happend.What wrong with my code.Please give any solution.How can i take value from html side to aspx.cs page.and also check if any mistake in my script.....Please help. Thanks Bijesh
Use Hidden field and make it run at server access this hidden field by using its id and assign the value
Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "
-
Use Hidden field and make it run at server access this hidden field by using its id and assign the value
Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "
Hi, Thanks for ur reply. Please give some sample code .How assign to hidden field and take the values to aspx.cs part. Thanks agaain, Bijesh
-
Hai friends, I hava a javascript function like this in aspx page's html side. function calculate() { alert('welcome'); document.getElementById("<%=lbl_netamount.ClientID%>").innerText = currency_show_conversion(document.getElementById("lbl_netamt").innerText,"INR","USD"); var amount= document.getElementById("<%=lbl_netamount.ClientID%>").innerText; '<%=Session["Amount"]%>'=amount; document.getElementById("lbl_netamount").value = '<%=Session["Amount"]%>'; } I need to take the value from this scipt function into aspx.cs page.what I need to do for that?I write in Pageload event that btn_checkout.Attributes.Add("OnClick", "javascript:calculate()"); But while clicking the button btn_checkout nothing is happend.What wrong with my code.Please give any solution.How can i take value from html side to aspx.cs page.and also check if any mistake in my script.....Please help. Thanks Bijesh
Are U getting values into amount?? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ On load in .aspx onload="setThankMessage(); in .aspx.cs page function setThankMessage() { document.getElementById('relationship').value = '<%=Session["hydPatientRelatnshipPR"]%>'; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~JJ
My Blogs... .Net Interview Questions
All about my Online Trading -
Are U getting values into amount?? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ On load in .aspx onload="setThankMessage(); in .aspx.cs page function setThankMessage() { document.getElementById('relationship').value = '<%=Session["hydPatientRelatnshipPR"]%>'; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~JJ
My Blogs... .Net Interview Questions
All about my Online Tradinghello, I got the value,it is printing in form.but i need it in any label or text box controls. Thanks Bijesh