Click here to Skip to main content
15,892,737 members
Home / Discussions / C#
   

C#

 
SuggestionRe: c#(Invalid attempt to call HasRows when reader is closed)occurred when i was using the following query in 3tier Pin
Sascha Lefèvre18-Jun-15 1:46
professionalSascha Lefèvre18-Jun-15 1:46 
AnswerRe: c#(Invalid attempt to call HasRows when reader is closed)occurred when i was using the following query in 3tier Pin
OriginalGriff18-Jun-15 2:21
mveOriginalGriff18-Jun-15 2:21 
Questiondatavisualization - Audiometric chart Pin
Member 1061400017-Jun-15 21:52
Member 1061400017-Jun-15 21:52 
QuestionC# crystal report to generate bill/invoice Pin
shashimk8117-Jun-15 21:13
shashimk8117-Jun-15 21:13 
AnswerRe: C# crystal report to generate bill/invoice Pin
joost.versteegen22-Jun-15 1:28
joost.versteegen22-Jun-15 1:28 
QuestionHow do I access checkbox checked value in a email body built using C#? Pin
Rajesh_198017-Jun-15 10:53
Rajesh_198017-Jun-15 10:53 
AnswerRe: How do I access checkbox checked value in a email body built using C#? Pin
rajeshkasani0517-Jun-15 23:41
rajeshkasani0517-Jun-15 23:41 
GeneralRe: How do I access checkbox checked value in a email body built using C#? Pin
Rajesh_198018-Jun-15 4:40
Rajesh_198018-Jun-15 4:40 
Thanks for the response..
I also have few other hidden inputs in the same page and they work fine.
As per your suggestion:
1) Added radio buttons instead of checkboxes.
2) Added hidden input field hdn_checkBoxResult.
3) Called a function to check if the value of radio button is true, if so, then assign value to hdn_checkBoxResult.
4) Appended hdn_checkBoxResult.Value in the email.

Is there anything else I am missing?
The email still doesn't show the selected radio button value.

Here is my code:
..............................................................................................
ASP.NET
 <td colspan="4">
         <input type="radio" name="rdoCheck" id="rdoYes" value="" onclick ="theChecker(val)" />
                   <b><font size="1" face="Verdana">Yes </font></b>&nbsp;
         <input type="radio" name="rdoCheck" id="rdoNo" value="" />
                    <b><font size="1" face="Verdana">No</font></b>
</td>

Have declared this hidden input field outside the table.

<input type="hidden" runat="server" id="hdn_checkBoxResult" name="hdn_checkBoxResult" />


JavaScript
function theChecker(val)
			{			 
				if(val.Checked ==true)
				{ 
				    $('.hdn_checkBoxResult').val(true);			   
				  alert('alert msg');

				}
				else 
				{
				    $('.hdn_checkBoxResult').val(false);
			   
				}
			}


C#
emailBody +="<tr>";
emailBody +="<td align='right' width='10%'><B><FONT face='Verdana' size='1'>Question ?  </FONT></B></td>";
emailBody +="<td width='20%'><FONT face='Verdana' size='2'>&nbsp;" + hdn_checkBoxResult.Value + "</FONT></td>";				
emailBody +="</tr>";


modified 18-Jun-15 15:29pm.

GeneralRe: How do I access checkbox checked value in a email body built using C#? Pin
rajeshkasani0521-Jun-15 23:05
rajeshkasani0521-Jun-15 23:05 
GeneralRe: How do I access checkbox checked value in a email body built using C#? Pin
Rajesh_198022-Jun-15 10:41
Rajesh_198022-Jun-15 10:41 
QuestionGeneric problem of VB.NET Pin
econy17-Jun-15 9:12
econy17-Jun-15 9:12 
AnswerRe: Generic problem of VB.NET Pin
Pete O'Hanlon17-Jun-15 9:19
mvePete O'Hanlon17-Jun-15 9:19 
GeneralRe: Generic problem of VB.NET Pin
econy17-Jun-15 9:31
econy17-Jun-15 9:31 
GeneralRe: Generic problem of VB.NET Pin
econy17-Jun-15 9:37
econy17-Jun-15 9:37 
AnswerRe: Generic problem of VB.NET Pin
Kenneth Haugland17-Jun-15 10:01
mvaKenneth Haugland17-Jun-15 10:01 
AnswerRe: Generic problem of VB.NET Pin
Richard MacCutchan17-Jun-15 21:21
mveRichard MacCutchan17-Jun-15 21:21 
QuestionP/Invoce Rename Struct Field Pin
1011001017-Jun-15 4:43
1011001017-Jun-15 4:43 
AnswerRe: P/Invoce Rename Struct Field Pin
PIEBALDconsult17-Jun-15 4:53
mvePIEBALDconsult17-Jun-15 4:53 
AnswerRe: P/Invoce Rename Struct Field Pin
OriginalGriff17-Jun-15 5:13
mveOriginalGriff17-Jun-15 5:13 
SuggestionRe: P/Invoce Rename Struct Field Pin
Richard Deeming17-Jun-15 5:42
mveRichard Deeming17-Jun-15 5:42 
GeneralRe: P/Invoce Rename Struct Field Pin
1011001017-Jun-15 11:36
1011001017-Jun-15 11:36 
QuestionForms for Employee's biometric attendance system Pin
Member 1175350716-Jun-15 20:20
Member 1175350716-Jun-15 20:20 
AnswerRe: Forms for Employee's biometric attendance system Pin
JammoD8716-Jun-15 20:31
JammoD8716-Jun-15 20:31 
AnswerRe: Forms for Employee's biometric attendance system Pin
Abhinav S17-Jun-15 1:28
Abhinav S17-Jun-15 1:28 
QuestionHow to print a page of stickers in C# WinForm Pin
goldsoft16-Jun-15 19:33
goldsoft16-Jun-15 19:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.