Page 1 of 1

Wrapping KitsList and TemplatesList in a div

Posted: Thu Feb 20, 2014 3:02 pm
by webbspot
Hey guys, I am trying to create an onlick event in the product page so that Kit Options and Product Templates will be able to toggle between visible and not. Basically, we use the Kit and Product Templates to show custom options for products, but would like those fields to be hidden until a user clicks a customize button.

I have found the repeaters for those fields in the BuyProductDialog, but have not idea how to wrap them in a div to create the onclick event.

Maybe I am going about this wrong and there is an easier way than trying to use javascript and you could enlighten me on that option as well.

For a reference you can look at this example on our site: http://shop.golfusa.com/Clubs/Drivers/C ... river.aspx

Like I said, we want to hide the technifit logo all the way down to the additional notes unless someone clicks on a customize button.

Any help would be greatly appreciated as always.

David

Re: Wrapping KitsList and TemplatesList in a div

Posted: Mon Feb 24, 2014 10:48 am
by webbspot
So I have spent quite a few hours racking my head over this and still have no solution....PLEASE HELP!!! I guess I am going about this all wrong.

Thanks,

David

Re: Wrapping KitsList and TemplatesList in a div

Posted: Tue Feb 25, 2014 7:24 pm
by tripleW
Have you tried using OnClientClick with a button to call your javascript function? Here is an example where I'm calling the function named Switch from an ImageButton inside a repeater.

Code: Select all

<asp:Repeater ID="repComponent" OnItemDataBound="repComponent_ItemDataBound" runat="server">
<ItemTemplate>
<asp:Label ID="ComponentProduct" runat="server" Text= '<%# Eval ("Name") %>' > </asp:Label>
<asp:ImageButton ID="imgComponent" 
ImageUrl='<%# "~/assets/" + DataBinder.Eval (Container.DataItem,"Manufacturer") + "/" + DataBinder.Eval (Container.DataItem,"Id") + ".jpg" %>' 
runat="server"  
OnClick="PopupButton_Click" CommandName="DataBinder.Eval (Container.DataItem,'Name')" CommandArgument="popup" 
OnClientClick='<%# "Switch(\"" + DataBinder.Eval (Container.DataItem,"Id") + "\",\"" + DataBinder.Eval (Container.DataItem,"ComponentIndex") + "\",\"" + DataBinder.Eval (Container.DataItem,"KitProductId") + "\" ,\"" + DataBinder.Eval (Container.DataItem,"Name") + "\", \"" + DataBinder.Eval (Container.DataItem,"TotalPrice") + "\");return false;"%>'   />
</ItemTemplate>
</asp:Repeater>
 

Re: Wrapping KitsList and TemplatesList in a div

Posted: Mon Mar 03, 2014 6:19 pm
by webbspot
Thanks for your reply! I got it to work with javascript calling for the class instead of the id since it is generated from the .asp compiling code. I am not worth a flip with c# , but can work around html and javascript. Is there a plus or minus to using html and javascript instead of .asp calling the script?

Thanks!