Click here to Skip to main content
15,917,005 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: How to get the values into the textbox using datareader in asp.net Pin
Abhijit Jana6-May-09 9:53
professionalAbhijit Jana6-May-09 9:53 
AnswerRe: How to get the values into the textbox using datareader in asp.net Pin
SayreCC6-May-09 15:04
SayreCC6-May-09 15:04 
QuestionHow to get the values into the textbox using datareader Pin
Anjani Poornima6-May-09 4:30
Anjani Poornima6-May-09 4:30 
AnswerRe: How to get the values into the textbox using datareader Pin
netJP12L6-May-09 4:36
netJP12L6-May-09 4:36 
AnswerRe: How to get the values into the textbox using datareader Pin
Abhijit Jana6-May-09 10:24
professionalAbhijit Jana6-May-09 10:24 
Questionproperties and methods Pin
netJP12L6-May-09 4:13
netJP12L6-May-09 4:13 
AnswerRe: properties and methods Pin
Jeff Circeo6-May-09 12:29
Jeff Circeo6-May-09 12:29 
QuestionCheckBoxList DataBinding on Postback [modified] Pin
Swetha Sankaran6-May-09 3:53
Swetha Sankaran6-May-09 3:53 
I am trying to pass filter values from a webpart to a consumer. The vlaues are listed in a CheckBoxList. The databinding occurs in the GetValues method.
I have 2 issues:

a) When i select the values from the consumer web part(checkboxlist) and hit apply(i have added a imagebutton with autopostback attribute set to true) the checked values appear in a comma seperated string within a textbox but the values are lost after postback.

b) If I take the databind from getvalues and put it in Page_LoadComplete with if(!this.Page.IsPostBack) then, the values dont even appear in the checkboxlist.

How do i resolve this issue?
I'm pretty stumped. I've been staring at this thing for over 2 days now. Please find attached the code i'm working with. There is a javacript handler attached to the checkboxlist that correctly identifies the values selected. I guess it gets messed up on PostBack event.

       [ConnectionConsumer("Input Values")]<br />
       public void GetValues(ITransformableFilterValues values)<br />
       {<br />
           foreach (string val in values.ParameterValues)<br />
               {<br />
                   //this.Provider_Values += this.Provider_Values != " " ?","+ "'" + val +"'" : "'" + val + "'" ;<br />
                   this.Provider_Values = val;<br />
                   this.Provider_Name = values.ParameterName;<br />
                   ds = new SqlDataSource();<br />
                   ds.ID = "Source ID";<br />
                   ds.ConnectionString = cString;<br />
                   ds.SelectCommand = this.SQLSelectCommand;//"select distinct " + cName + " from " + tName + " where " + this.Provider_Name+ " = '" + this.Provider_Values+ "';";<br />
                   cBList.DataTextField = cName;<br />
                   cBList.DataValueField = cName;<br />
                   cBList.DataSource = ds;<br />
                   cBList.ID = "List ID";<br />
                   cBList.Attributes.Add("onclick", "FindSelectedItems(this," + tB.ClientID + ");");<br />
                   cBList.DataBind();<br />
               }<br />
           <br />
       }<br />
        public void BuildControls()<br />
           {  <br />
           try<br />
           {<br />
               cBList = new CheckBoxList();<br />
               this.Controls.Add(cBList);<br />
           }<br />
           //Sql exception cought.<br />
           catch (Exception ex)<br />
           {<br />
               ex1 = ex.Message;<br />
           }<br />
       }<br />
<br />
       protected override void CreateChildControls()<br />
       {<br />
           this.BuildControls();<br />
           base.CreateChildControls();<br />
       }<br />
<br />
       protected override void OnInit(EventArgs e)<br />
       {<br />
           this.Page.LoadComplete += new EventHandler(Page_LoadComplete);<br />
           base.OnInit(e);<br />
       }<br />
       <br />
       void Page_LoadComplete(object sender, EventArgs e)<br />
       {<br />
           if (this.Page.IsPostBack && !String.IsNullOrEmpty(this.Provider_Name) && String.IsNullOrEmpty(this.Provider_Values))<br />
           {<br />
               ds.SelectCommand = "select distinct " + cName + " from " + tName + " where " + this.Provider_Name + " = '" + this.Provider_Values + "';";<br />
               <br />
           }<br />
        <br />
       }


modified on Wednesday, May 6, 2009 1:09 PM

QuestionTimer Control in User control Pin
scothykonma6-May-09 3:28
scothykonma6-May-09 3:28 
AnswerRe: Timer Control in User control Pin
Jeff Circeo6-May-09 12:31
Jeff Circeo6-May-09 12:31 
QuestionLocalizing DateTime using microsoft report viewer [ RDLC ] Pin
vbexpert16-May-09 2:27
vbexpert16-May-09 2:27 
Questionbind textboxes runtime Pin
Sneha Bisht6-May-09 1:20
Sneha Bisht6-May-09 1:20 
AnswerRe: bind textboxes runtime Pin
Abhijit Jana6-May-09 2:03
professionalAbhijit Jana6-May-09 2:03 
Questiondomain check availability Pin
nithydurai6-May-09 1:12
nithydurai6-May-09 1:12 
AnswerRe: domain check availability Pin
Vimalsoft(Pty) Ltd6-May-09 1:18
professionalVimalsoft(Pty) Ltd6-May-09 1:18 
Questioncreate Windows Service Project in VS2005 & VS 2008??? Pin
nkmkrishna6-May-09 0:51
nkmkrishna6-May-09 0:51 
AnswerRe: create Windows Service Project in VS2005 & VS 2008??? Pin
Abhijit Jana6-May-09 1:01
professionalAbhijit Jana6-May-09 1:01 
AnswerRe: create Windows Service Project in VS2005 & VS 2008??? Pin
Baran M6-May-09 1:31
Baran M6-May-09 1:31 
GeneralRe: create Windows Service Project in VS2005 & VS 2008??? Pin
nkmkrishna6-May-09 2:03
nkmkrishna6-May-09 2:03 
GeneralRe: create Windows Service Project in VS2005 & VS 2008??? [modified] Pin
Baran M6-May-09 2:19
Baran M6-May-09 2:19 
QuestionMaster Page Pin
indian226-May-09 0:41
indian226-May-09 0:41 
AnswerRe: Master Page Pin
Abhijit Jana6-May-09 0:48
professionalAbhijit Jana6-May-09 0:48 
GeneralRe: Master Page Pin
indian226-May-09 18:58
indian226-May-09 18:58 
Questiondata display according to selected radio button list Pin
sanju056-May-09 0:32
sanju056-May-09 0:32 
AnswerRe: data display according to selected radio button list Pin
Abhijit Jana6-May-09 1:03
professionalAbhijit Jana6-May-09 1:03 

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.