Click here to Skip to main content
15,919,028 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: imageButton in datagrid Pin
janetb992-May-06 3:18
janetb992-May-06 3:18 
QuestionHow to create a photo album using Asp.net Pin
boombabyy1-May-06 9:05
boombabyy1-May-06 9:05 
AnswerRe: How to create a photo album using Asp.net Pin
minhpc_bk1-May-06 13:43
minhpc_bk1-May-06 13:43 
AnswerRe: How to create a photo album using Asp.net Pin
OmegaCD1-May-06 16:06
OmegaCD1-May-06 16:06 
GeneralRe: How to create a photo album using Asp.net Pin
boombabyy4-May-06 7:30
boombabyy4-May-06 7:30 
AnswerRe: How to create a photo album using Asp.net Pin
J4amieC1-May-06 22:19
J4amieC1-May-06 22:19 
QuestionNested DataLists and SqlDataSources Pin
dtrickett1-May-06 8:07
dtrickett1-May-06 8:07 
AnswerRe: Nested DataLists and SqlDataSources Pin
minhpc_bk1-May-06 13:46
minhpc_bk1-May-06 13:46 
Hi there,
In this case, you can define a select parameter for the child SqlDataSource control. If you are not familiar with the Parameter, you can read the document in MSDN:

Using Parameters with the SqlDataSource Control [^]

Basically, there are a couple of parameters which you can use like the generic Parameter or ControlParameter.
+ With the Paremeter, you cannot bind data from the parent datalist item to the DefaultValue property of the Parameter as the Parameter does not have the DataBinding event, so you should create an event handler for the Selecting event of the child SqlDataSource control, and populate the select parameter value in there.

+ With the ControlParameter, you can simply bind data from the parent datalist to a control like Label. If you don't want to display it in the datalist, you can set the Visible to false. Then you simply define a ControlParemeter for the child SqlDataSource control, and configure the ControlParameter to get the value from this Label control. The sample markup look like this:
<asp:DataList ID="parent"> 
<ItemTemplate> 
  <asp:Label ID="lblParentID" Text='<%# Eval("parentId")%>' /> 
  <asp:DataList ID="child"> 
  </asp:DataList> 
  <asp:SqlDataSource ID="childDataSource" 
				SelectCommand="Select * FROM childTable WHERE parentId = @parentId" >
     <SelectParameters>
        <asp:controlparameter name="parentId" controlid="lblParentID" propertyname="Text"/>
     </SelectParameters>
  </asp:SqlDataSource>
</ItemTemplate> 
</asp:DataList> 
<asp:SqlDataSource ID="parentDataSource" SelectCommand="Select * FROM parentTable" />

GeneralRe: Nested DataLists and SqlDataSources Pin
dtrickett2-May-06 3:19
dtrickett2-May-06 3:19 
QuestionTreeView Component and XML string Pin
aliserdarilter1-May-06 6:06
aliserdarilter1-May-06 6:06 
AnswerRe: TreeView Component and XML string Pin
minhpc_bk1-May-06 13:46
minhpc_bk1-May-06 13:46 
GeneralRe: TreeView Component and XML string Pin
aliserdarilter1-May-06 22:40
aliserdarilter1-May-06 22:40 
AnswerRe: TreeView Component and XML string Pin
OmegaCD1-May-06 16:08
OmegaCD1-May-06 16:08 
GeneralRe: TreeView Component and XML string Pin
aliserdarilter1-May-06 22:41
aliserdarilter1-May-06 22:41 
Questionhelp need in asp german plz Pin
icsvoice1-May-06 5:32
icsvoice1-May-06 5:32 
AnswerRe: help need in asp german plz Pin
Guffa1-May-06 6:24
Guffa1-May-06 6:24 
GeneralRe: help need in asp german plz Pin
icsvoice1-May-06 7:46
icsvoice1-May-06 7:46 
QuestionObjectDataSource Parameter. Please Help. Pin
DotNetDominator1-May-06 4:41
DotNetDominator1-May-06 4:41 
AnswerRe: ObjectDataSource Parameter. Please Help. Pin
Colin Angus Mackay1-May-06 4:58
Colin Angus Mackay1-May-06 4:58 
AnswerRe: ObjectDataSource Parameter. Please Help. Pin
minhpc_bk1-May-06 13:47
minhpc_bk1-May-06 13:47 
GeneralRe: ObjectDataSource Parameter. Please Help. Pin
DotNetDominator2-May-06 7:03
DotNetDominator2-May-06 7:03 
QuestionMultiple Data Adapter Pin
Mansurali1-May-06 3:09
Mansurali1-May-06 3:09 
AnswerRe: Multiple Data Adapter Pin
minhpc_bk1-May-06 13:48
minhpc_bk1-May-06 13:48 
QuestionCustomization of Web Part in Visual Studio 2005 Pin
goyal manish1-May-06 2:44
goyal manish1-May-06 2:44 
AnswerRe: Customization of Web Part in Visual Studio 2005 Pin
minhpc_bk1-May-06 13:50
minhpc_bk1-May-06 13:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.