TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Vikram
1.5k
276
308.1k
DataList and SqlDataSource SelectCommand Parameter
May 27 2010 2:46 AM
Hi,
In my application, I am using DataList. In Item Template I added One GridView and SqlDataSource to populate data in GridView. DataList having one DataKey field, I want to pass this DataKey Value to the SqlDataSource as Parameter.
I tried this by Using Following:
<SelectParameters>
<%--<asp:Parameter DefaultValue="" Name="LocatioID" DbType="Int32" />--%>
<asp:ControlParameter ControlID="dlJobsByLocation" Name="LocatioID" PropertyName="DataKeys[0]" />
</SelectParameters>
<SelectParameters>
<asp:ControlParameter ControlID="dataList" Name="ID" PropertyName=
"DataKeys[0]"
/>
</SelectParameters>
In above snippet I hard coded Property Name to DataKeys[0], due to this it return DataKey value of first row only.
Here I need ProperyName which gives the DataKeys value for every row at the time of ItemDataBound. The Value 0 should be replaced with something thats where I stuck.......
Any Help Appreciated.........
Thanks,
VIkram
Reply
Answers (
2
)
Javascript
Javascript