Click here to Skip to main content
15,913,610 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionImage album category wise Pin
Member 776731127-Dec-12 7:30
Member 776731127-Dec-12 7:30 
AnswerRe: Image album category wise Pin
Sandeep Mewara28-Dec-12 21:24
mveSandeep Mewara28-Dec-12 21:24 
QuestionCapsLock detection Pin
tpkpradeep27-Dec-12 0:04
tpkpradeep27-Dec-12 0:04 
AnswerRe: CapsLock detection Pin
AnalogNerd27-Dec-12 3:56
AnalogNerd27-Dec-12 3:56 
AnswerRe: CapsLock detection Pin
CommDev28-Dec-12 21:50
CommDev28-Dec-12 21:50 
QuestionApplication Layering Pin
Omersayeed26-Dec-12 2:31
Omersayeed26-Dec-12 2:31 
QuestionSyntax error in store procedure Pin
anubhaw.gupta25-Dec-12 22:06
anubhaw.gupta25-Dec-12 22:06 
AnswerRe: Syntax error in store procedure Pin
Sravanthid2825-Dec-12 22:21
Sravanthid2825-Dec-12 22:21 
GeneralRe: Syntax error in store procedure Pin
anubhaw.gupta25-Dec-12 22:40
anubhaw.gupta25-Dec-12 22:40 
AnswerRe: Syntax error in store procedure Pin
anubhaw.gupta25-Dec-12 22:45
anubhaw.gupta25-Dec-12 22:45 
GeneralRe: Syntax error in store procedure Pin
sathish s26-Dec-12 1:39
sathish s26-Dec-12 1:39 
GeneralRe: Syntax error in store procedure Pin
Zafar Sultan26-Dec-12 3:31
Zafar Sultan26-Dec-12 3:31 
Questionid or guid.. which one? Pin
Jassim Rahma25-Dec-12 7:22
Jassim Rahma25-Dec-12 7:22 
AnswerRe: id or guid.. which one? Pin
Sandeep Mewara25-Dec-12 19:14
mveSandeep Mewara25-Dec-12 19:14 
AnswerRe: id or guid.. which one? Pin
CommDev25-Dec-12 19:25
CommDev25-Dec-12 19:25 
Questionwhy should I care about ExecuteScalar Pin
Jassim Rahma25-Dec-12 5:57
Jassim Rahma25-Dec-12 5:57 
AnswerRe: why should I care about ExecuteScalar Pin
Sandeep Mewara25-Dec-12 19:30
mveSandeep Mewara25-Dec-12 19:30 
AnswerRe: why should I care about ExecuteScalar Pin
CommDev25-Dec-12 19:33
CommDev25-Dec-12 19:33 
AnswerRe: why should I care about ExecuteScalar Pin
CommDev25-Dec-12 19:40
CommDev25-Dec-12 19:40 
GeneralRe: why should I care about ExecuteScalar Pin
Jassim Rahma28-Dec-12 9:40
Jassim Rahma28-Dec-12 9:40 
GeneralRe: why should I care about ExecuteScalar Pin
Naveen Katta26-Dec-12 0:10
Naveen Katta26-Dec-12 0:10 
Questiona control that should contain html elements Pin
Ali Al Omairi(Abu AlHassan)23-Dec-12 23:01
professionalAli Al Omairi(Abu AlHassan)23-Dec-12 23:01 
QuestionRe: a control that should contain html elements Pin
jkirkerx24-Dec-12 13:09
professionaljkirkerx24-Dec-12 13:09 
AnswerRe: a control that should contain html elements Pin
Ali Al Omairi(Abu AlHassan)25-Dec-12 19:51
professionalAli Al Omairi(Abu AlHassan)25-Dec-12 19:51 
Questioncheckedchange event of gridview in javascript Pin
Ravi_kant23-Dec-12 19:29
Ravi_kant23-Dec-12 19:29 
Hi All
i have a gridview

XML
<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

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.