Click here to Skip to main content
15,901,035 members
Home / Discussions / C#
   

C#

 
AnswerRe: Problem with process.startinfo Pin
BobJanova20-Mar-14 8:07
BobJanova20-Mar-14 8:07 
GeneralRe: Problem with process.startinfo Pin
turbosupramk320-Mar-14 10:30
turbosupramk320-Mar-14 10:30 
QuestionWPF how I can divide in pages the data of a datagrid Pin
Federico Barbieri19-Mar-14 6:05
Federico Barbieri19-Mar-14 6:05 
AnswerRe: WPF how I can divide in pages the data of a datagrid Pin
Simon_Whale19-Mar-14 6:36
Simon_Whale19-Mar-14 6:36 
QuestionRe: WPF how I can divide in pages the data of a datagrid Pin
Richard MacCutchan19-Mar-14 7:22
mveRichard MacCutchan19-Mar-14 7:22 
AnswerRe: WPF how I can divide in pages the data of a datagrid Pin
Pete O'Hanlon19-Mar-14 7:25
mvePete O'Hanlon19-Mar-14 7:25 
GeneralRe: WPF how I can divide in pages the data of a datagrid Pin
Federico Barbieri19-Mar-14 22:11
Federico Barbieri19-Mar-14 22:11 
GeneralRe: WPF how I can divide in pages the data of a datagrid Pin
Pete O'Hanlon19-Mar-14 22:41
mvePete O'Hanlon19-Mar-14 22:41 
AnswerRe: WPF how I can divide in pages the data of a datagrid Pin
Kenneth Haugland19-Mar-14 23:16
mvaKenneth Haugland19-Mar-14 23:16 
QuestionMessage Removed Pin
19-Mar-14 3:39
professionalN_tro_P19-Mar-14 3:39 
QuestionRe: Xsd2Code Bug Pin
Richard MacCutchan19-Mar-14 3:50
mveRichard MacCutchan19-Mar-14 3:50 
AnswerMessage Removed Pin
19-Mar-14 4:09
professionalN_tro_P19-Mar-14 4:09 
GeneralRe: Xsd2Code Bug Pin
OriginalGriff19-Mar-14 6:02
mveOriginalGriff19-Mar-14 6:02 
GeneralRe: Xsd2Code Bug Pin
Richard MacCutchan19-Mar-14 7:17
mveRichard MacCutchan19-Mar-14 7:17 
Questionconver speech to the text Pin
mohammad_mgh99118-Mar-14 22:16
mohammad_mgh99118-Mar-14 22:16 
AnswerRe: conver speech to the text Pin
Richard MacCutchan18-Mar-14 22:29
mveRichard MacCutchan18-Mar-14 22:29 
GeneralRe: conver speech to the text Pin
mohammad_mgh99118-Mar-14 23:12
mohammad_mgh99118-Mar-14 23:12 
AnswerRe: conver speech to the text Pin
Bernhard Hiller19-Mar-14 0:37
Bernhard Hiller19-Mar-14 0:37 
QuestionHow many dynamic check boxes are checked Pin
NYCABR18-Mar-14 7:42
NYCABR18-Mar-14 7:42 
Hello,
We have a web page dynamically loaded check boxes (depends on how many records in database).
What i need is to make sure the user checks only 5 check boxes. And if he checks the 6th one, give him a message that he can only check 5.
ASP:
Please select up to five:
<asp:Repeater runat="server" ID="rptCandidats" >
        <ItemTemplate>
             <div>
 <asp:checkbox id="chResponse" runat="server"  AutoPostBack="True" OnCheckedChanged="Check_Clicked"></asp:checkbox>
<%# Eval("ResText")%> <a href="<%#Eval("ResLink")%>" class="moreinfo">   More Info</a>
<asp:HiddenField ID="ResId" runat="server" Value ='<%#Eval("ResponId")%>' />                           </div>
</ItemTemplate>
</asp:Repeater>

I tried to use OnCheckedChanged event, but it doesn't work.
Below is a C# code:
protected void Check_Clicked(Object sender, EventArgs e)
       {
           int checkedCount = 0;
           foreach (RepeaterItem r in rptCandidats.Items)
           {
              CheckBox cb = (CheckBox)r.FindControl("chResponse");
               if (cb.Checked)
               {
                   checkedCount += (sender as CheckBox).Checked ? 1 : -1;
               }
           }
           if (checkedCount > 5)
           {
               System.Web.HttpContext.Current.Response.Write("<SCRIPT LANGUAGE="JavaScript">alert(\"Only Up to five candidates can be selected.\")</SCRIPT>");
           }

       }

Any ideas how can i achieve it?
AnswerRe: How many dynamic check boxes are checked Pin
BillWoodruff18-Mar-14 22:08
professionalBillWoodruff18-Mar-14 22:08 
GeneralRe: How many dynamic check boxes are checked Pin
NYCABR19-Mar-14 3:10
NYCABR19-Mar-14 3:10 
Questionc# - accessing a web service using Soap XML request client through tls authentication Pin
Member 1067924618-Mar-14 2:00
Member 1067924618-Mar-14 2:00 
QuestionHow to create Textbox with ellipse button Pin
ahmed_one18-Mar-14 1:31
ahmed_one18-Mar-14 1:31 
AnswerMessage Closed Pin
18-Mar-14 3:09
professionalBillWoodruff18-Mar-14 3:09 
GeneralRe: How to create Textbox with ellipse button Pin
Wayne Gaylard18-Mar-14 3:49
professionalWayne Gaylard18-Mar-14 3:49 

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.