Commerce Server General - AddToCart code -> change to link instead of button

This is Interesting: Free IT Magazines  
Home > Archive > Commerce Server General > February 2004 > AddToCart code -> change to link instead of button





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author AddToCart code -> change to link instead of button
Ryan Ross

2004-02-14, 9:34 am

I'm trying to change the AddToCart code so that I can call the web control
from a link (think this: customer clicks on picture instead of button). Any
ideas on how to do this? I keep running into an error: I try grabbing info
from the link, and Raise event args, but no item is added to the basket.

Thanks,
Ryan


Max Akbar

2004-02-16, 4:34 pm

Are you talking about the Retail2002 site?

Regards,
-Max

"Ryan Ross" <ryanr@nni.com> wrote in message
news:102t9enmdp4ia9d@corp.supernews.com...
> I'm trying to change the AddToCart code so that I can call the web control
> from a link (think this: customer clicks on picture instead of button).

Any
> ideas on how to do this? I keep running into an error: I try grabbing info
> from the link, and Raise event args, but no item is added to the basket.
>
> Thanks,
> Ryan
>
>



Ryan Ross

2004-02-17, 7:35 am

Correct.
"Max Akbar" <maximum2000@hotmail.com> wrote in message
news:#cohcRR9DHA.1052@TK2MSFTNGP12.phx.gbl...
> Are you talking about the Retail2002 site?
>
> Regards,
> -Max
>
> "Ryan Ross" <ryanr@nni.com> wrote in message
> news:102t9enmdp4ia9d@corp.supernews.com...
control[color=blue]
> Any
info[color=blue]
>
>



Max Akbar

2004-02-17, 3:34 pm

in the AddToCart.ascx page remove the button and add this:
<asp:ImageButton id="Imagebutton2" runat="server" OnClick="Submit_Clicked"
ImageUrl="someimage.gif"></asp:ImageButton>

in the AddToCart.ascx.vb class add this if not already there.
Protected WithEvents Imagebutton2 As System.Web.UI.WebControls.ImageButton

Then change the signature of the Submit_Clicked method to this.
Public Sub Submit_Clicked(ByVal sender As Object, ByVal e As
System.Web.UI.ImageClickEventArgs) Handles Imagebutton2.Click

Also make sure to remove the button reference from SetLocalizableResources
method.

Good luck,
-Max

"Ryan Ross" <ryanr@nni.com> wrote in message
news:1034tld6ofj8l43@corp.supernews.com...
> Correct.
> "Max Akbar" <maximum2000@hotmail.com> wrote in message
> news:#cohcRR9DHA.1052@TK2MSFTNGP12.phx.gbl...
> control
button).[color=blue]
> info
basket.[color=blue]
>
>



Ryan Ross

2004-02-18, 9:35 am

Hmm. Rewrote some of the code last night, but here's what I am
thinking...change from a button to a hyperlink. This will enable me to wrap
any text or image in the hyperlink...

How to go about that is the question. I currently think that removing the
ascx page and keeping just the class file should accomplish these aims.
Rewrite part of the ProductList Control...

What do you think, should I put a hyperlink in the ascx (for AddToCart)
page, and try to wrap the images or text in the control, or should I put the
hyperlink in the ProductList Control...?

I think that trying to wrap an image or text in a control will either
nullify the text or cause an error with the control...

Your thoughts?

Ryan



"Max Akbar" <maximum2000@hotmail.com> wrote in message
news:enu$0ad9DHA.2460@TK2MSFTNGP09.phx.gbl...
> in the AddToCart.ascx page remove the button and add this:
> <asp:ImageButton id="Imagebutton2" runat="server" OnClick="Submit_Clicked"
> ImageUrl="someimage.gif"></asp:ImageButton>
>
> in the AddToCart.ascx.vb class add this if not already there.
> Protected WithEvents Imagebutton2 As System.Web.UI.WebControls.ImageButton
>
> Then change the signature of the Submit_Clicked method to this.
> Public Sub Submit_Clicked(ByVal sender As Object, ByVal e As
> System.Web.UI.ImageClickEventArgs) Handles Imagebutton2.Click
>
> Also make sure to remove the button reference from SetLocalizableResources
> method.
>
> Good luck,
> -Max
>
> "Ryan Ross" <ryanr@nni.com> wrote in message
> news:1034tld6ofj8l43@corp.supernews.com...
> button).
grabbing[color=blue]
> basket.
>
>



Max Akbar

2004-02-18, 5:34 pm

This depends on what you are trying to achieve. You can create a control
without having an *.ascx page but if you are going to do that you would have
to implement the render method so that the control can display a UI. I would
recommend that you take a look at http:\\www.asp.net forum.

Good luck,
-Max

"Ryan Ross" <ryanr@nni.com> wrote in message
news:1037rob5tma9p6a@corp.supernews.com...
> Hmm. Rewrote some of the code last night, but here's what I am
> thinking...change from a button to a hyperlink. This will enable me to

wrap
> any text or image in the hyperlink...
>
> How to go about that is the question. I currently think that removing the
> ascx page and keeping just the class file should accomplish these aims.
> Rewrite part of the ProductList Control...
>
> What do you think, should I put a hyperlink in the ascx (for AddToCart)
> page, and try to wrap the images or text in the control, or should I put

the
> hyperlink in the ProductList Control...?
>
> I think that trying to wrap an image or text in a control will either
> nullify the text or cause an error with the control...
>
> Your thoughts?
>
> Ryan
>
>
>
> "Max Akbar" <maximum2000@hotmail.com> wrote in message
> news:enu$0ad9DHA.2460@TK2MSFTNGP09.phx.gbl...
OnClick="Submit_Clicked"[color=blue]
System.Web.UI.WebControls.ImageButton[color=blue]
SetLocalizableResources[color=blue]
> grabbing
>
>



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com