Click here to Skip to main content
12,077,911 members (49,774 online)
   

ASP.NET

 
AnswerRe: registration form Pin
_Amy31-Dec-12 18:45
member_Amy31-Dec-12 18:45 
AnswerRe: registration form Pin
@AmitGajjar1-Jan-13 7:55
member@AmitGajjar1-Jan-13 7:55 
AnswerRe: registration form Pin
Rahul Rajat Singh3-Jan-13 22:53
memberRahul Rajat Singh3-Jan-13 22:53 
QuestionSlider control in SSRS Pin
Sanjeewan9929-Dec-12 19:28
memberSanjeewan9929-Dec-12 19:28 
Questionadvertising platform...? Pin
Jassim Rahma29-Dec-12 10:24
memberJassim Rahma29-Dec-12 10:24 
GeneralRe: advertising platform...? Pin
jkirkerx30-Dec-12 14:38
memberjkirkerx30-Dec-12 14:38 
QuestionFile Upload Component...? Pin
Jassim Rahma28-Dec-12 10:44
memberJassim Rahma28-Dec-12 10:44 
AnswerRe: File Upload Component...? Pin
Sandeep Mewara28-Dec-12 22:14
mvpSandeep Mewara28-Dec-12 22:14 
QuestionCan we make a application to update FB status? Pin
anubhaw.gupta28-Dec-12 7:18
memberanubhaw.gupta28-Dec-12 7:18 
AnswerRe: Can we make a application to update FB status? Pin
Sandeep Mewara28-Dec-12 22:10
mvpSandeep Mewara28-Dec-12 22:10 
QuestionLive Streaming Broadcasting Pin
AhmedYehiaK28-Dec-12 4:19
memberAhmedYehiaK28-Dec-12 4:19 
AnswerRe: Live Streaming Broadcasting Pin
Sandeep Mewara28-Dec-12 22:05
mvpSandeep Mewara28-Dec-12 22:05 
GeneralRe: Live Streaming Broadcasting Pin
AhmedYehiaK29-Dec-12 1:03
memberAhmedYehiaK29-Dec-12 1:03 
QuestionHow to show the previous selected checked box in previous page in asp.net Pin
Arun kumar Gautam28-Dec-12 1:18
memberArun kumar Gautam28-Dec-12 1:18 
I m making an online examination page on this page i created a gridview with paging when i go on next page thn aftr selecting options of answer of any question i m going on to another page. but when i come back on this previous page i cant see the previously selected answers the gridview page is refreshed thn, Please help me in it.
<body>
    <div id="timer" style="float:right;">
    <label id="tim" style="font-size:15px;"></label>
    </div>
    <div>
    </body>
    <asp:ScriptManager ID="scrpt1" runat="server"></asp:ScriptManager>
    <asp:UpdatePanel ID="updt" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
    <asp:GridView ID="examgrid" runat="server" AllowPaging="true" 
            AutoGenerateColumns="false" onrowdatabound="examgrid_RowDataBound" 
            PageSize="2" onpageindexchanging="examgrid_PageIndexChanging" 
            PageIndex="10" Width="528px" EnableViewState="false" 
            onrowcommand="examgrid_RowCommand" 
            onpageindexchanged="examgrid_PageIndexChanged" onload="examgrid_Load">
    <Columns>
    <asp:TemplateField HeaderText="Question">
    <ItemTemplate>
    <asp:Label ID="ques" runat="server" Text='<%#Eval("Ques_Name") %>'></asp:Label>
    <asp:HiddenField ID="Question_Id" runat="server" Value='<%#Eval("Ques_Id") %>' />
and here is my c# code in gridview paging

protected void examgrid_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        DBClass db = new DBClass();
      
        //hidvalue.Value = Convert.ToString(x);
        for (int i = 0; i < examgrid.Rows.Count; i++)
        {
            Label question = (Label)examgrid.Rows[i].Cells[0].FindControl("ques");
            HiddenField quesid = (HiddenField)examgrid.Rows[i].Cells[0].FindControl("Question_Id");
            RadioButton rd1 = (RadioButton)examgrid.Rows[i].Cells[0].FindControl("opt1");
            RadioButton rd2 = (RadioButton)examgrid.Rows[i].Cells[0].FindControl("opt2");
            RadioButton rd3 = (RadioButton)examgrid.Rows[i].Cells[0].FindControl("opt3");
            RadioButton rd4 = (RadioButton)examgrid.Rows[i].Cells[0].FindControl("opt4");
            string user = "Arun";
            if (rd1.Checked == true || rd2.Checked == true || rd3.Checked == true || rd4.Checked == true)
            {
                if (rd1.Checked == true)
                {
                    db.InsAnswer(user, question.Text, rd1.Text);
                    Session["selectedOption_"+quesid+"_Answer"]=rd1.Text;
                }
                else
                    if (rd2.Checked == true)
                    {
                        db.InsAnswer(user, question.Text, rd2.Text);
                        Session["selectedOption_"+quesid+"_Answer"]=rd2.Text;
                    }
                    else if (rd3.Checked == true)
                    {
                        db.InsAnswer(user, question.Text, rd3.Text);
                        Session["selectedOption_"+quesid+"_Answer"]=rd3.Text;
                    }
                    else if (rd4.Checked == true)
                    {
                        db.InsAnswer(user, question.Text, rd4.Text);
                        Session["selectedOption_"+quesid+"_Answer"]=rd4.Text;
                    }
                
            }
            else
            {
                for (int j = 0; j < examgrid.Rows.Count; j++)
                {
                    Label ques = (Label)examgrid.Rows[j].Cells[0].FindControl("ques");
                    int y = db.select_QuestionId(ques.Text);
                    string selected_option = db.Select_Ansqwer(question.Text, user);
 
                    if (Session["selectedOption_"+y+"_Answer"]==selected_option )
                    {
                        if (selected_option == rd1.Text)
                        {
                            rd1.Checked = true;
                        }
                        else if (selected_option == rd2.Text)
                        {
                            rd2.Checked = true;
                        }
                        else if (selected_option == rd3.Text)
                        {
                            rd3.Checked = true;
                        }
                        else if (selected_option == rd4.Text)
                        {
                            rd4.Checked = true;
                        }
 
                    }
                }
            }
        }
    }

AnswerRe: How to show the previous selected checked box in previous page in asp.net Pin
Sandeep Mewara28-Dec-12 22:17
mvpSandeep Mewara28-Dec-12 22:17 
GeneralRe: How to show the previous selected checked box in previous page in asp.net Pin
Arun kumar Gautam29-Dec-12 2:16
memberArun kumar Gautam29-Dec-12 2:16 
GeneralRe: How to show the previous selected checked box in previous page in asp.net Pin
anubhaw.gupta29-Dec-12 8:04
memberanubhaw.gupta29-Dec-12 8:04 
QuestionMicrosoft Sync Framework for File (Client) and SQL Server Database (Server) synchronization Pin
Ajeet mittal27-Dec-12 18:27
memberAjeet mittal27-Dec-12 18:27 
QuestionWhat is the web.config for the <smtp> ? Pin
alihusain_7727-Dec-12 10:38
memberalihusain_7727-Dec-12 10:38 
AnswerRe: What is the web.config for the <smtp> ? Pin
Richard MacCutchan27-Dec-12 23:02
mvpRichard MacCutchan27-Dec-12 23:02 
AnswerRe: What is the web.config for the <smtp> ? Pin
CommDev28-Dec-12 22:38
memberCommDev28-Dec-12 22:38 
QuestionImage album category wise Pin
Member 776731127-Dec-12 8:30
memberMember 776731127-Dec-12 8:30 
AnswerRe: Image album category wise Pin
Sandeep Mewara28-Dec-12 22:24
mvpSandeep Mewara28-Dec-12 22:24 
QuestionCapsLock detection Pin
tpkpradeep27-Dec-12 1:04
membertpkpradeep27-Dec-12 1:04 
AnswerRe: CapsLock detection Pin
AnalogNerd27-Dec-12 4:56
memberAnalogNerd27-Dec-12 4:56 
AnswerRe: CapsLock detection Pin
CommDev28-Dec-12 22:50
memberCommDev28-Dec-12 22:50 
QuestionApplication Layering Pin
Omersayeed26-Dec-12 3:31
memberOmersayeed26-Dec-12 3:31 
QuestionSyntax error in store procedure Pin
anubhaw.gupta25-Dec-12 23:06
memberanubhaw.gupta25-Dec-12 23:06 
AnswerRe: Syntax error in store procedure Pin
Sravanthid2825-Dec-12 23:21
memberSravanthid2825-Dec-12 23:21 
GeneralRe: Syntax error in store procedure Pin
anubhaw.gupta25-Dec-12 23:40
memberanubhaw.gupta25-Dec-12 23:40 
AnswerRe: Syntax error in store procedure Pin
anubhaw.gupta25-Dec-12 23:45
memberanubhaw.gupta25-Dec-12 23:45 
GeneralRe: Syntax error in store procedure Pin
sathish s26-Dec-12 2:39
membersathish s26-Dec-12 2:39 
GeneralRe: Syntax error in store procedure Pin
Zafar Sultan26-Dec-12 4:31
memberZafar Sultan26-Dec-12 4:31 
Questionid or guid.. which one? Pin
Jassim Rahma25-Dec-12 8:22
memberJassim Rahma25-Dec-12 8:22 
AnswerRe: id or guid.. which one? Pin
Sandeep Mewara25-Dec-12 20:14
mvpSandeep Mewara25-Dec-12 20:14 
AnswerRe: id or guid.. which one? Pin
CommDev25-Dec-12 20:25
memberCommDev25-Dec-12 20:25 
Questionwhy should I care about ExecuteScalar Pin
Jassim Rahma25-Dec-12 6:57
memberJassim Rahma25-Dec-12 6:57 
AnswerRe: why should I care about ExecuteScalar Pin
Sandeep Mewara25-Dec-12 20:30
mvpSandeep Mewara25-Dec-12 20:30 
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 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 
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 

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.


Advertise | Privacy | Mobile
Web03 | 2.8.160212.1 | Last Updated 12 Feb 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid