Click here to Skip to main content
11,484,752 members (66,276 online)
   

ASP.NET

 
AnswerRe: why should I care about ExecuteScalar Pin
CommDev25-Dec-12 20:33
memberCommDev25-Dec-12 20:33 
AnswerRe: why should I care about ExecuteScalar Pin
CommDev25-Dec-12 20:40
memberCommDev25-Dec-12 20:40 
GeneralRe: why should I care about ExecuteScalar Pin
Jassim Rahma28-Dec-12 10:40
memberJassim Rahma28-Dec-12 10:40 
GeneralRe: why should I care about ExecuteScalar Pin
Naveen Katta26-Dec-12 1:10
memberNaveen Katta26-Dec-12 1:10 
Questiona control that should contain html elements [modified] Pin
Ali Al Omairi(Abu AlHassan)24-Dec-12 0:01
memberAli Al Omairi(Abu AlHassan)24-Dec-12 0:01 
QuestionRe: a control that should contain html elements Pin
jkirkerx24-Dec-12 14:09
memberjkirkerx24-Dec-12 14:09 
AnswerRe: a control that should contain html elements Pin
Ali Al Omairi(Abu AlHassan)25-Dec-12 20:51
memberAli Al Omairi(Abu AlHassan)25-Dec-12 20:51 
Questioncheckedchange event of gridview in javascript Pin
Ravi_kant23-Dec-12 20:29
memberRavi_kant23-Dec-12 20:29 
Hi All
i have a gridview

<asp:GridView ID="GridView2" runat="server" Width="100%"
            AutoGenerateColumns="False">
            <Columns>
                <asp:BoundField DataField="description" HeaderText="Description" >
                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                </asp:BoundField>
                <asp:BoundField DataField="Amount" HeaderText="Amount" >
                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                </asp:BoundField>
                <asp:TemplateField HeaderText="Month">
                    <ItemTemplate>
                        <asp:CheckBox ID="CheckBoxJan" runat="server" Text="Jan" AutoPostBack="True"
                            oncheckedchanged="CheckBoxJan_CheckedChanged" />
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:CheckBox ID="CheckBoxFeb" runat="server" Text="Feb" AutoPostBack="True"
                            oncheckedchanged="CheckBoxJan_CheckedChanged" />
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:CheckBox ID="CheckBoxMar" runat="server" Text="Mar" AutoPostBack="True"
                            oncheckedchanged="CheckBoxJan_CheckedChanged" />
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:CheckBox ID="CheckBoxApr" runat="server" Text="Apr" AutoPostBack="True"
                            oncheckedchanged="CheckBoxJan_CheckedChanged" />
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:CheckBox ID="CheckBoxMay" runat="server" Text="May" AutoPostBack="True"
                            oncheckedchanged="CheckBoxJan_CheckedChanged" />
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:CheckBox ID="CheckBoxJun" runat="server" Text="Jun" AutoPostBack="True"
                            oncheckedchanged="CheckBoxJan_CheckedChanged" />
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:CheckBox ID="CheckBoxJul" runat="server" Text="Jul" AutoPostBack="True"
                            oncheckedchanged="CheckBoxJan_CheckedChanged" />
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:CheckBox ID="CheckBoxAug" runat="server" Text="Aug" AutoPostBack="True"
                            oncheckedchanged="CheckBoxJan_CheckedChanged" />
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:CheckBox ID="CheckBoxSep" runat="server" Text="Sep" AutoPostBack="True"
                            oncheckedchanged="CheckBoxJan_CheckedChanged" />
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:CheckBox ID="CheckBoxOct" runat="server" Text="Oct" AutoPostBack="True"
                            oncheckedchanged="CheckBoxJan_CheckedChanged" />
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:CheckBox ID="CheckBoxNov" runat="server" Text="Nov" AutoPostBack="True"
                            oncheckedchanged="CheckBoxJan_CheckedChanged" />
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:CheckBox ID="CheckBoxDec" runat="server" Text="Dec" AutoPostBack="True"
                            oncheckedchanged="CheckBoxJan_CheckedChanged" />
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
and i am using checked change event for checkbox as
        protected void CheckBoxJan_CheckedChanged(object sender, EventArgs e)
        {
            string desc = "";
            Double amount = 0;
            for (Int32 i = 0; i < GridView2.Rows.Count; i++)
            {
                double amt = 0;
                CheckBox checkBox1 = (CheckBox)GridView2.Rows[i].Cells[2].FindControl("CheckBoxJan");
                bool isChecked1 = checkBox1.Checked;
                CheckBox checkBox2 = (CheckBox)GridView2.Rows[i].Cells[2].FindControl("CheckBoxFeb");
                bool isChecked2 = checkBox2.Checked;
                CheckBox checkBox3 = (CheckBox)GridView2.Rows[i].Cells[2].FindControl("CheckBoxMar");
                bool isChecked3 = checkBox3.Checked;
                CheckBox checkBox4 = (CheckBox)GridView2.Rows[i].Cells[2].FindControl("CheckBoxApr");
                bool isChecked4 = checkBox4.Checked;
                CheckBox checkBox5 = (CheckBox)GridView2.Rows[i].Cells[2].FindControl("CheckBoxMay");
                bool isChecked5 = checkBox5.Checked;
                CheckBox checkBox6 = (CheckBox)GridView2.Rows[i].Cells[2].FindControl("CheckBoxJun");
                bool isChecked6 = checkBox6.Checked;
                CheckBox checkBox7 = (CheckBox)GridView2.Rows[i].Cells[2].FindControl("CheckBoxJul");
                bool isChecked7 = checkBox7.Checked;
                CheckBox checkBox8 = (CheckBox)GridView2.Rows[i].Cells[2].FindControl("CheckBoxAug");
                CheckBox checkBox9 = (CheckBox)GridView2.Rows[i].Cells[2].FindControl("CheckBoxSep");
                bool isChecked8 = checkBox8.Checked;
                CheckBox checkBox10 = (CheckBox)GridView2.Rows[i].Cells[2].FindControl("CheckBoxOct");
                bool isChecked9 = checkBox9.Checked;
                CheckBox checkBox11 = (CheckBox)GridView2.Rows[i].Cells[2].FindControl("CheckBoxNov");
                CheckBox checkBox12 = (CheckBox)GridView2.Rows[i].Cells[2].FindControl("CheckBoxDec");
                bool isChecked10 = checkBox10.Checked;
                bool isChecked11 = checkBox11.Checked;
                bool isChecked12 = checkBox12.Checked;
                if (isChecked1 && checkBox1.Enabled==true)
                {
                    amt = Convert.ToDouble(GridView2.Rows[i].Cells[1].Text);
                    amount = amount + amt;
                    desc = desc + "Jan" + ",";
                }
                if (isChecked2 && checkBox2.Enabled == true)
                {
                    amt = Convert.ToDouble(GridView2.Rows[i].Cells[1].Text);
                    amount = amount + amt;
                    desc = desc + "Feb" + ",";
                }
                if (isChecked3 && checkBox3.Enabled == true)
                {
                    amt = Convert.ToDouble(GridView2.Rows[i].Cells[1].Text);
                    amount = amount + amt;
                    desc = desc + "Mar" + ",";
                }
                if (isChecked4 && checkBox4.Enabled == true)
                {
                    amt = Convert.ToDouble(GridView2.Rows[i].Cells[1].Text);
                    amount = amount + amt;
                    desc = desc + "Apr" + ",";
                }
                if (isChecked5 && checkBox5.Enabled == true)
                {
                    amt = Convert.ToDouble(GridView2.Rows[i].Cells[1].Text);
                    amount = amount + amt;
                    desc = desc + "May" + ",";
                }
                if (isChecked6 && checkBox6.Enabled == true)
                {
                    amt = Convert.ToDouble(GridView2.Rows[i].Cells[1].Text);
                    amount = amount + amt;
                    desc = desc + "Jun" + ",";
                }
                if (isChecked7 && checkBox7.Enabled == true)
                {
                    amt = Convert.ToDouble(GridView2.Rows[i].Cells[1].Text);
                    amount = amount + amt;
                    desc = desc + "Jul" + ",";
                }
                if (isChecked8 && checkBox8.Enabled == true)
                {
                    amt = Convert.ToDouble(GridView2.Rows[i].Cells[1].Text);
                    amount = amount + amt;
                    desc = desc + "Aug" + ",";
                }
                if (isChecked9 && checkBox9.Enabled == true)
                {
                    amt = Convert.ToDouble(GridView2.Rows[i].Cells[1].Text);
                    amount = amount + amt;
                    desc = desc + "Sep" + ",";
                }
                if (isChecked10 && checkBox10.Enabled == true)
                {
                    amt = Convert.ToDouble(GridView2.Rows[i].Cells[1].Text);
                    amount = amount + amt;
                    desc = desc + "Oct" + ",";
                }
                if (isChecked11 && checkBox11.Enabled == true)
                {
                    amt = Convert.ToDouble(GridView2.Rows[i].Cells[1].Text);
                    amount = amount + amt;
                    desc = desc + "Nov" + ",";
                }
                if (isChecked12 && checkBox12.Enabled == true)
                {
                    amt = Convert.ToDouble(GridView2.Rows[i].Cells[1].Text);
                    amount = amount + amt;
                    desc = desc + "Dec" + ",";
                }
            }
            Label24.Text = amount.ToString();
            Label17.Text = (Convert.ToDouble(Label23.Text) + Convert.ToDouble(Label24.Text) + Convert.ToDouble(Label27.Text)).ToString();
            Label29.Text = desc;
        }
so here after every checked change page is getting reloaded but i want to do this in javascript(client side)

so please help me to do this

regards
Ravi kant
AnswerRe: checkedchange event of gridview in javascript Pin
Sampath Kumar Sathiya24-Dec-12 1:20
memberSampath Kumar Sathiya24-Dec-12 1:20 
GeneralRe: checkedchange event of gridview in javascript Pin
Ravi_kant24-Dec-12 8:40
memberRavi_kant24-Dec-12 8:40 
Questionupdated data from gridview Pin
Member 970720723-Dec-12 1:30
memberMember 970720723-Dec-12 1:30 
AnswerRe: updated data from gridview Pin
Ali Al Omairi(Abu AlHassan)24-Dec-12 5:31
memberAli Al Omairi(Abu AlHassan)24-Dec-12 5:31 
AnswerRe: updated data from gridview Pin
Sandeep Mewara25-Dec-12 20:35
mvpSandeep Mewara25-Dec-12 20:35 
Question.net question Pin
Tarani Dutt Joshi22-Dec-12 0:53
memberTarani Dutt Joshi22-Dec-12 0:53 
AnswerRe: .net question Pin
Richard MacCutchan22-Dec-12 1:18
mvpRichard MacCutchan22-Dec-12 1:18 
AnswerRe: .net question Pin
MaulikDusara24-Dec-12 22:38
memberMaulikDusara24-Dec-12 22:38 
AnswerRe: .net question Pin
Sandeep Mewara25-Dec-12 20:33
mvpSandeep Mewara25-Dec-12 20:33 
QuestionWebRequest Pin
cdpsource21-Dec-12 15:16
membercdpsource21-Dec-12 15:16 
Questionwebpage has resulted in too many redirects Pin
Jassim Rahma21-Dec-12 10:46
memberJassim Rahma21-Dec-12 10:46 
AnswerRe: webpage has resulted in too many redirects Pin
jkirkerx22-Dec-12 19:50
memberjkirkerx22-Dec-12 19:50 
GeneralRe: webpage has resulted in too many redirects Pin
Jassim Rahma23-Dec-12 9:36
memberJassim Rahma23-Dec-12 9:36 
GeneralRe: webpage has resulted in too many redirects Pin
jkirkerx23-Dec-12 9:47
memberjkirkerx23-Dec-12 9:47 
GeneralRe: webpage has resulted in too many redirects Pin
Jassim Rahma24-Dec-12 10:10
memberJassim Rahma24-Dec-12 10:10 
GeneralRe: webpage has resulted in too many redirects Pin
jkirkerx24-Dec-12 14:05
memberjkirkerx24-Dec-12 14:05 
Questionpop up on mouse over on a image button Pin
Yasir88721-Dec-12 7:42
memberYasir88721-Dec-12 7:42 

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

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


Advertise | Privacy | Mobile
Web02 | 2.8.150520.1 | Last Updated 25 May 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid