Home All Groups Group Topic Archive Search About
Author
23 Apr 2005 11:59 PM
Albert
I have a main web page that allows a user to perform searches on our
products. On this main web page I have a datalist that I would like to use
for all types of searches and it's declares as follows:

<asp:datalist id="ddl_generic" onitemCommand="itemSelected" runat=server>

</asp:datalist>

For the Header Template, Item Template and footer templates I have separate
ascx files that contain the content for the datalist based on the Search Type
selected by the user. The Search Type is a Text Box and 2 dropdowns lists.

The issue is that while I can load the templates with no problems I cannot
get the OnItemCommad event to fire unless the templates are loaded within the
Page's Init Sub. This would be fine except that the values from the Search
Type control are not refreshed until the Page Load event occurs. 

So how does one wire up the loaded template's controls to the Datalist's 
OnItemCommand event outside of the Page's Init Sub?

Thanks for the help!

Author
25 Apr 2005 10:15 AM
Galin Iliev
if I understood your question correctly you want to init your user controls
use Page.Prerender event as thus you can be sure ther are already loaded

regards
Galin Iliev

Show quoteHide quote
"Albert" <Alb***@discussions.microsoft.com> wrote in message
news:34359DAA-3B0C-4962-8CD2-12B6664F8E40@microsoft.com...
>I have a main web page that allows a user to perform searches on our
> products. On this main web page I have a datalist that I would like to use
> for all types of searches and it's declares as follows:
>
> <asp:datalist id="ddl_generic" onitemCommand="itemSelected" runat=server>
>
> </asp:datalist>
>
> For the Header Template, Item Template and footer templates I have
> separate
> ascx files that contain the content for the datalist based on the Search
> Type
> selected by the user. The Search Type is a Text Box and 2 dropdowns lists.
>
> The issue is that while I can load the templates with no problems I cannot
> get the OnItemCommad event to fire unless the templates are loaded within
> the
> Page's Init Sub. This would be fine except that the values from the Search
> Type control are not refreshed until the Page Load event occurs.
>
> So how does one wire up the loaded template's controls to the Datalist's
> OnItemCommand event outside of the Page's Init Sub?
>
> Thanks for the help!
>
>
Author
25 Apr 2005 12:46 PM
Albert
Do you mean load up the Templates for the Datalist in the PreRender event?

Thanks for your time,
Albert

Show quoteHide quote
"Galin Iliev" wrote:

> if I understood your question correctly you want to init your user controls
> use Page.Prerender event as thus you can be sure ther are already loaded
>
> regards
> Galin Iliev
>
> "Albert" <Alb***@discussions.microsoft.com> wrote in message
> news:34359DAA-3B0C-4962-8CD2-12B6664F8E40@microsoft.com...
> >I have a main web page that allows a user to perform searches on our
> > products. On this main web page I have a datalist that I would like to use
> > for all types of searches and it's declares as follows:
> >
> > <asp:datalist id="ddl_generic" onitemCommand="itemSelected" runat=server>
> >
> > </asp:datalist>
> >
> > For the Header Template, Item Template and footer templates I have
> > separate
> > ascx files that contain the content for the datalist based on the Search
> > Type
> > selected by the user. The Search Type is a Text Box and 2 dropdowns lists.
> >
> > The issue is that while I can load the templates with no problems I cannot
> > get the OnItemCommad event to fire unless the templates are loaded within
> > the
> > Page's Init Sub. This would be fine except that the values from the Search
> > Type control are not refreshed until the Page Load event occurs.
> >
> > So how does one wire up the loaded template's controls to the Datalist's
> > OnItemCommand event outside of the Page's Init Sub?
> >
> > Thanks for the help!
> >
> >
>
>
>
Author
25 Apr 2005 2:39 PM
Galin Iliev
That's right
use this  Page.Prerender event

Good luck
Galin Iliev

Show quoteHide quote
"Albert" <Alb***@discussions.microsoft.com> wrote in message
news:E3F60A30-076B-4CCE-B395-AE5F6353CEE2@microsoft.com...
> Do you mean load up the Templates for the Datalist in the PreRender event?
>
> Thanks for your time,
> Albert
>
> "Galin Iliev" wrote:
>
>> if I understood your question correctly you want to init your user
>> controls
>> use Page.Prerender event as thus you can be sure ther are already loaded
>>
>> regards
>> Galin Iliev
>>
>> "Albert" <Alb***@discussions.microsoft.com> wrote in message
>> news:34359DAA-3B0C-4962-8CD2-12B6664F8E40@microsoft.com...
>> >I have a main web page that allows a user to perform searches on our
>> > products. On this main web page I have a datalist that I would like to
>> > use
>> > for all types of searches and it's declares as follows:
>> >
>> > <asp:datalist id="ddl_generic" onitemCommand="itemSelected"
>> > runat=server>
>> >
>> > </asp:datalist>
>> >
>> > For the Header Template, Item Template and footer templates I have
>> > separate
>> > ascx files that contain the content for the datalist based on the
>> > Search
>> > Type
>> > selected by the user. The Search Type is a Text Box and 2 dropdowns
>> > lists.
>> >
>> > The issue is that while I can load the templates with no problems I
>> > cannot
>> > get the OnItemCommad event to fire unless the templates are loaded
>> > within
>> > the
>> > Page's Init Sub. This would be fine except that the values from the
>> > Search
>> > Type control are not refreshed until the Page Load event occurs.
>> >
>> > So how does one wire up the loaded template's controls to the
>> > Datalist's
>> > OnItemCommand event outside of the Page's Init Sub?
>> >
>> > Thanks for the help!
>> >
>> >
>>
>>
>>
Author
25 Apr 2005 3:13 PM
Albert
I loaded up the Templates in the Page.Prerender event but now the
Datalist does not display any Header,Item or Footer info. No Errors
encountered.

Just need to wire up the Template's controls to the Datalist's
onItemCommand...seems simple enough....

Thanks again..

Show quoteHide quote
"Galin Iliev" wrote:

> That's right
> use this  Page.Prerender event
>
> Good luck
> Galin Iliev
>
> "Albert" <Alb***@discussions.microsoft.com> wrote in message
> news:E3F60A30-076B-4CCE-B395-AE5F6353CEE2@microsoft.com...
> > Do you mean load up the Templates for the Datalist in the PreRender event?
> >
> > Thanks for your time,
> > Albert
> >
> > "Galin Iliev" wrote:
> >
> >> if I understood your question correctly you want to init your user
> >> controls
> >> use Page.Prerender event as thus you can be sure ther are already loaded
> >>
> >> regards
> >> Galin Iliev
> >>
> >> "Albert" <Alb***@discussions.microsoft.com> wrote in message
> >> news:34359DAA-3B0C-4962-8CD2-12B6664F8E40@microsoft.com...
> >> >I have a main web page that allows a user to perform searches on our
> >> > products. On this main web page I have a datalist that I would like to
> >> > use
> >> > for all types of searches and it's declares as follows:
> >> >
> >> > <asp:datalist id="ddl_generic" onitemCommand="itemSelected"
> >> > runat=server>
> >> >
> >> > </asp:datalist>
> >> >
> >> > For the Header Template, Item Template and footer templates I have
> >> > separate
> >> > ascx files that contain the content for the datalist based on the
> >> > Search
> >> > Type
> >> > selected by the user. The Search Type is a Text Box and 2 dropdowns
> >> > lists.
> >> >
> >> > The issue is that while I can load the templates with no problems I
> >> > cannot
> >> > get the OnItemCommad event to fire unless the templates are loaded
> >> > within
> >> > the
> >> > Page's Init Sub. This would be fine except that the values from the
> >> > Search
> >> > Type control are not refreshed until the Page Load event occurs.
> >> >
> >> > So how does one wire up the loaded template's controls to the
> >> > Datalist's
> >> > OnItemCommand event outside of the Page's Init Sub?
> >> >
> >> > Thanks for the help!
> >> >
> >> >
> >>
> >>
> >>
>
>
>