Connecting primary key between FormView and DataList

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
 
B

Brock Allen

<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".
 

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

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top