checkbox control and rowID
-
as a newbie, I have developed a simple administrative app that lists members of our mailing list. ON the viewing page, checkboxes are dynamically listed along with the member info. When one checks a box and clicks 'edit', i want the item checked to open into the edit page with it's appropriate data. Problem: I can get the checkbox associated to an id number on the viewing page. I just can't seem to figure out how to send that id and data to the edit page. any help or suggestions would be great. can provide code examples if needed. karinb karinb
-
as a newbie, I have developed a simple administrative app that lists members of our mailing list. ON the viewing page, checkboxes are dynamically listed along with the member info. When one checks a box and clicks 'edit', i want the item checked to open into the edit page with it's appropriate data. Problem: I can get the checkbox associated to an id number on the viewing page. I just can't seem to figure out how to send that id and data to the edit page. any help or suggestions would be great. can provide code examples if needed. karinb karinb
in the querystring if it's just simple data...
-
as a newbie, I have developed a simple administrative app that lists members of our mailing list. ON the viewing page, checkboxes are dynamically listed along with the member info. When one checks a box and clicks 'edit', i want the item checked to open into the edit page with it's appropriate data. Problem: I can get the checkbox associated to an id number on the viewing page. I just can't seem to figure out how to send that id and data to the edit page. any help or suggestions would be great. can provide code examples if needed. karinb karinb
From viewing page you can use code similar to this Dim trans_id As Integer Dim dgrCode As Label = E.Item.FindControl("lblCode") trans_id = CType(dgrCode.Text, Integer) Server.Transfer("EditList.aspx?&trans_id=" + trans_id.ToString(), True) which does this: reads value from control named lblCode. Since I needed to transfer this value to next page as integer, I casted it. Last line of code redirects user to "edit list" page along with value from the control In Edit List page under Page Load or somwhere else have line similar to this. lblTest.Text = Request.Params.Get("trans_id") What this does: it reads a parameter sent from viewing page and assign its value to text box. I hope this gives you the general idea Srdjan
-
From viewing page you can use code similar to this Dim trans_id As Integer Dim dgrCode As Label = E.Item.FindControl("lblCode") trans_id = CType(dgrCode.Text, Integer) Server.Transfer("EditList.aspx?&trans_id=" + trans_id.ToString(), True) which does this: reads value from control named lblCode. Since I needed to transfer this value to next page as integer, I casted it. Last line of code redirects user to "edit list" page along with value from the control In Edit List page under Page Load or somwhere else have line similar to this. lblTest.Text = Request.Params.Get("trans_id") What this does: it reads a parameter sent from viewing page and assign its value to text box. I hope this gives you the general idea Srdjan
I truly appreciate your solution, just wish i could figure out how to implement it. i should have mentioned i'm developing in c#. Here's what I've tried to do with your sample: --this is in my Page_Load--- --creates an instance of a checkbox and dynamically populates inline with the list of users and sets its value to the same as the pk of the associated dataset--- CheckBox cboCheck = new CheckBox(); cboCheck.AutoPostBack = false; cboCheck.ID = dsUserInfo.Tables[0].Rows[intCtr]["intMailIDpk"].ToString(); ---Event Handler public void btnEdit_Click(object sender,System.EventArgs e) { --->getting error message at this line: Object reference not set to an instance of an object.-- Int16 ckID = Convert.ToInt16(cboCheck.ID); cboCheck.ID = Convert.ToString(cboCheck.FindControl("ckID")); Server.Transfer("addedit.aspx?&ckID=" + ckID.ToString(), false);--probably need to user Response.Redirect here, you think??-- } any help is greatly appreciated. i'm sure i'm just one line of code off here, and then my app works great. karinb -- modified at 15:11 Tuesday 9th May, 2006