Link to home
Start Free TrialLog in
Avatar of meetpd
meetpdFlag for India

asked on

Passing value from Javascript function to CS file

Hi,

I am setting a value of a radio button in a javascript function.

Now, to save this value of radio button in database, I have code which is in the aspx.cs file.

How do I pass this value of radio button to aspx.cs file?

Thanks!
ASKER CERTIFIED SOLUTION
Avatar of Amandeep Singh Bhullar
Amandeep Singh Bhullar
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Radio button is server control or HTML controls?
If it is codebehind, then you can directly access from id, in case of HTML control:

(1) Edit the HTML code to include the attribute runat="server" in the
opening tag of the HTML control. For example for a table it might be:
<TABLE id="Table1" ...(other attributes) ... runat="server">

(2) Then you need to include the namespace "System.Web.UI.HtmlControls"
in the code behind (e.g. in VB the directive Imports
System.Web.UI.HtmlControls).
use hidden controls.