Set DefaultValue of ObjectDataSource parameter from within a child nested repeater


/ Published in: C#
Save to your folder(s)



Copy this code and paste it in your HTML
  1. if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
  2. {
  3. ObjectDataSource ObjectDataSource2 = (ObjectDataSource) e.Item.FindControl("ObjectDataSource2");
  4. ObjectDataSource2.SelectParameters["XXXXXX"].DefaultValue = DataBinder.Eval(e.Item.DataItem, "XXXXXXXX").ToString();
  5. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.