Click here to Skip to main content
15,923,789 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questionviewstate of dynamic text boxs Pin
test-0928-Mar-10 22:39
test-0928-Mar-10 22:39 
  private void Descriptiontable()
    {

        DescriptionClass dcss = new DescriptionClass();
        dcss.ProjectIDp = Convert.ToInt32(Session["ProjectId"].ToString());
        // dcss.ProjectIDp = Convert.ToInt32(ProjectIDText.Text);
        DataSet ds = new DataSet();
        dtDesc = dcss.DynamicDataSet().Tables[0];

        dtDesc.Columns.Add("DescriptionName1");
        dtDesc.Columns.Add("Date1");
        dtDesc.Columns.Add("Description1");
        int intID = 1;
        foreach (DataRow drow in dtDesc.Rows)
        {
            drow["ProjectID"] = intID++;
            drow["DescriptionName1"] = "qwe";
            drow["Date1"] = "";
            drow["Description1"] = "asdasd";
        }
        Session["dtDesc"] = dtDesc;
        if (dtDesc.Rows.Count == 0)
        {
            adddescription();
        }
        else
        {
            Bindrepeater();
        }
    }

    private void adddescription()
    {
        dtDesc = (DataTable)Session["dtDesc"];
        DataRow descRow = dtDesc.NewRow();
        //  descRow["ProjectID"] = dtDesc.Rows.Count + 1;
        descRow["DescriptionName"] = "";
        descRow["Date"] ="";
        descRow["Description"] = "";
        dtDesc.Rows.Add(descRow);
        Session["dtDesc"] = dtDesc;
        Bindrepeater();
    }

    private void Bindrepeater()
    {
        if (Session["dtDesc"] == null)
        {
            Descriptiontable();
        }
        dtDesc = (DataTable)Session["dtDesc"];
        DataView dv = dtDesc.DefaultView;
        if (dv.Count == 0)
        {
            adddescription();
        }
        Rptdescription.DataSource = dv;
        Rptdescription.DataBind();
    }
//button click event
adddescription();


This is how im creating dynamic textboxes in repeater...
But how do i store viewstate of those textboxs on btnclick event...
so that values of text boxs may not dissappear on post back....
AnswerRe: viewstate of dynamic text boxs Pin
Arun Jacob28-Mar-10 22:57
Arun Jacob28-Mar-10 22:57 
GeneralRe: viewstate of dynamic text boxs Pin
test-0928-Mar-10 23:03
test-0928-Mar-10 23:03 
GeneralRe: viewstate of dynamic text boxs Pin
Arun Jacob28-Mar-10 23:05
Arun Jacob28-Mar-10 23:05 
Questionhow to insert empty values from text boxes to database Pin
developerit28-Mar-10 22:13
developerit28-Mar-10 22:13 
AnswerRe: how to insert empty values from text boxes to database Pin
Vimalsoft(Pty) Ltd28-Mar-10 22:15
professionalVimalsoft(Pty) Ltd28-Mar-10 22:15 
AnswerRe: how to insert empty values from text boxes to database Pin
Amit Patel198528-Mar-10 22:16
Amit Patel198528-Mar-10 22:16 
AnswerRe: how to insert empty values from text boxes to database Pin
R. Giskard Reventlov28-Mar-10 22:27
R. Giskard Reventlov28-Mar-10 22:27 
AnswerRe: how to insert empty values from text boxes to database Pin
Arun Jacob28-Mar-10 23:10
Arun Jacob28-Mar-10 23:10 
GeneralRe: how to insert empty values from text boxes to database Pin
developerit29-Mar-10 1:49
developerit29-Mar-10 1:49 
GeneralRe: how to insert empty values from text boxes to database Pin
Sneha Bisht29-Mar-10 2:04
Sneha Bisht29-Mar-10 2:04 
GeneralRe: how to insert empty values from text boxes to database Pin
R. Giskard Reventlov29-Mar-10 2:32
R. Giskard Reventlov29-Mar-10 2:32 
Questionpass javascript variable to javascript function Pin
Abdul Rahman Hamidy28-Mar-10 21:43
Abdul Rahman Hamidy28-Mar-10 21:43 
AnswerRe: pass javascript variable to javascript function Pin
Vimalsoft(Pty) Ltd28-Mar-10 22:05
professionalVimalsoft(Pty) Ltd28-Mar-10 22:05 
GeneralRe: pass javascript variable to javascript function Pin
Abdul Rahman Hamidy28-Mar-10 22:17
Abdul Rahman Hamidy28-Mar-10 22:17 
GeneralRe: pass javascript variable to javascript function Pin
Vimalsoft(Pty) Ltd28-Mar-10 22:27
professionalVimalsoft(Pty) Ltd28-Mar-10 22:27 
AnswerRe: pass javascript variable to javascript function Pin
PSK_28-Mar-10 22:19
PSK_28-Mar-10 22:19 
GeneralRe: pass javascript variable to javascript function Pin
Abdul Rahman Hamidy28-Mar-10 22:26
Abdul Rahman Hamidy28-Mar-10 22:26 
GeneralRe: pass javascript variable to javascript function Pin
PSK_28-Mar-10 23:03
PSK_28-Mar-10 23:03 
GeneralRe: pass javascript variable to javascript function Pin
Abdul Rahman Hamidy28-Mar-10 23:13
Abdul Rahman Hamidy28-Mar-10 23:13 
Questionallow user to manage pop3 account in our website ? [modified] Pin
keyur satyadev28-Mar-10 20:06
keyur satyadev28-Mar-10 20:06 
AnswerRe: allow user to manage pop3 account in our website ? Pin
Arun Jacob28-Mar-10 22:52
Arun Jacob28-Mar-10 22:52 
Questionhow to develop a web page with the help of AD rotator control Pin
sowjanya328-Mar-10 19:17
sowjanya328-Mar-10 19:17 
AnswerRe: how to develop a web page with the help of AD rotator control Pin
PSK_28-Mar-10 19:33
PSK_28-Mar-10 19:33 
AnswerRe: how to develop a web page with the help of AD rotator control Pin
Gaurav Dudeja India28-Mar-10 19:47
Gaurav Dudeja India28-Mar-10 19:47 

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.