|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Datalist and LoadTemplateproducts. 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! 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! > > 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! > > > > > > > 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! >> > >> > >> >> >> 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! > >> > > >> > > >> > >> > >> > > >
Protected Shadows With Events.
dynamic textbox empty string DropDownList with default values Weird "defined in multiple places" error How do I set the value of a checkbox on my repeater control? Gridview OnPageIndexChanging not firing in beta 2 e.Item.Cells.Count in UpdateCommand event of Datagrid Losing selectedIndex on Control inherted from ListBox during postback Enabled / Disabled my control textbox onfocus event |
|||||||||||||||||||||||