Click here to Skip to main content
15,891,033 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Shop item display: Matrix style (?control?) vs Table style (DataGrid) Pin
devvvy5-May-09 16:05
devvvy5-May-09 16:05 
QuestionFilling in form fields Pin
redone6325-May-09 12:12
redone6325-May-09 12:12 
AnswerRe: Filling in form fields Pin
Christian Graus5-May-09 12:14
protectorChristian Graus5-May-09 12:14 
GeneralRe: Filling in form fields Pin
redone6325-May-09 12:21
redone6325-May-09 12:21 
GeneralRe: Filling in form fields Pin
Christian Graus5-May-09 12:25
protectorChristian Graus5-May-09 12:25 
GeneralRe: Filling in form fields Pin
redone6325-May-09 13:10
redone6325-May-09 13:10 
AnswerRe: Filling in form fields Pin
saanj5-May-09 19:23
saanj5-May-09 19:23 
QuestionCheckBoxList value lost on postback Pin
Swetha Sankaran5-May-09 9:44
Swetha Sankaran5-May-09 9:44 
I have a checkboxlist that has values populated from a sql table's column. When i apply the selected values to a report within a page postback is triggered and the selected value seems to be lost.
how to set the selected to remain even after postback?
Appreciate your thoughts.
Thanks.
public ReadOnlyCollection<string> ParameterValues
        {
            get
            {
                //This method first checks the current value of the ChildControlsCreated property. 
                //If this value is false, the CreateChildControls method is called. 
                this.EnsureChildControls();

                List<string> names = new List<string>();
                if (!string.IsNullOrEmpty(cName))
                {
                    for (int i = 0; i < cBList.Items.Count; i++)
                    {
                        if (cBList.Items[i].Selected)
                        {
                            names.Add(cBList.Items[i].Value);
                        }
                    }

                }
                for (int i = 0; i < cBList.Items.Count; i++)
                {
                    ListItem item = cBList.Items[i];
                    if (item.Value == cName.ToString())// The cName is the name of the column, this condition check is wrong. I have to change it to the selected values from the checkbox list and i dont know how to do that.
                    {
                        cBList.SelectedIndex = i;
                        item.Selected = true;
                    }
                }
                ReadOnlyCollection<string> result = new ReadOnlyCollection<string>(names);
                return result;
            }
        }
        [ConnectionConsumer("Input Values")]
        public void GetValues(ITransformableFilterValues values)
        {
            foreach (string val in values.ParameterValues)
            {
                //this.Provider_Values += this.Provider_Values != " " ?","+ "'" + val +"'" : "'" + val + "'" ;
               this.Provider_Values = val;
               this.Provider_Name = values.ParameterName;
               ds = new SqlDataSource();
               ds.ID = "Source ID";
               ds.ConnectionString = cString;
               ds.SelectCommand = this.SQLSelectCommand;//"select distinct " + cName + " from " + tName + " where " + this.Provider_Name+ " = '" + this.Provider_Values+ "';";
               cBList.DataTextField = cName;
               cBList.DataValueField = cName;
               cBList.DataSource = ds;
               cBList.ID = "List ID";
               cBList.Attributes.Add("onclick", "FindSelectedItems(this," + tB.ClientID + ");");
               cBList.DataBind();
        
            }
            
        }

AnswerRe: CheckBoxList value lost on postback Pin
Christian Graus5-May-09 12:13
protectorChristian Graus5-May-09 12:13 
GeneralRe: CheckBoxList value lost on postback Pin
Swetha Sankaran6-May-09 4:20
Swetha Sankaran6-May-09 4:20 
AnswerRe: CheckBoxList value lost on postback Pin
saanj5-May-09 19:25
saanj5-May-09 19:25 
AnswerRe: CheckBoxList value lost on postback Pin
Swetha Sankaran13-May-09 9:50
Swetha Sankaran13-May-09 9:50 
QuestionASP.NET Test Tool Question Pin
elapid5-May-09 9:14
elapid5-May-09 9:14 
QuestionLocal Server Problem(C# ASP DOT NET) Pin
mishigun5-May-09 8:34
mishigun5-May-09 8:34 
AnswerRe: Local Server Problem(C# ASP DOT NET) Pin
Yusuf5-May-09 9:07
Yusuf5-May-09 9:07 
GeneralRe: Local Server Problem(C# ASP DOT NET) Pin
mishigun5-May-09 9:26
mishigun5-May-09 9:26 
QuestionUrgent : Web and Windows Integration(Passing values from web to windows) Pin
mishigun5-May-09 8:27
mishigun5-May-09 8:27 
AnswerRe: Urgent : Web and Windows Integration(Passing values from web to windows) Pin
Yusuf5-May-09 9:11
Yusuf5-May-09 9:11 
QuestionLosing cookies Pin
yasBinder5-May-09 8:14
yasBinder5-May-09 8:14 
AnswerRe: Losing cookies Pin
Yusuf5-May-09 9:15
Yusuf5-May-09 9:15 
GeneralRe: Losing cookies Pin
yasBinder5-May-09 9:37
yasBinder5-May-09 9:37 
GeneralRe: Losing cookies Pin
yasBinder7-May-09 16:47
yasBinder7-May-09 16:47 
QuestionHelp on Socket Programming in ASP.NET Pin
RoopeshReddy5-May-09 7:52
RoopeshReddy5-May-09 7:52 
QuestionAnyone familiar with "Prompt for symbolic renaming when renaming files" in Visual Studio Pin
pzn3xq5-May-09 7:45
pzn3xq5-May-09 7:45 
QuestionIs it best to store the sln and suo file within the same directory as your website directory (cs, aspx)? Pin
pzn3xq5-May-09 7:20
pzn3xq5-May-09 7:20 

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.