Connecting primary key between FormView and DataList

  • Thread starter Thread starter Daves
  • Start date Start date
D

Daves

I have an aspx page to view a single blog entry along with user comments.
The blogs are stored in one table in the database and the comments in
another. A (2.0) FormView displays the blog entry and a DataList iterates
the comments.
The problem is I cannot find a way to connect the DataKeys, making the
DataList's datasource selecting only comments with BlogID=X
I tried
<asp:ControlParameter ControlID="FormView1" Name="blID"
PropertyName="SelectedValue" />

but it seems that SelectedValue property is always null
 
<asp:ControlParameter ControlID="FormView1" Name="blID"
PropertyName="SelectedValue" />

Name is the name of the parameter in your Sql. ControlName is the name of
the Control from which to use the value from PropertyName="SelectedValue".

-Brock
DevelopMentor
http://staff.develop.com/ballen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top