I'm trying to use an image as a value and I put the html code and it works fine, but when I view it on the site. It just shows the html code for the image. Is there away to make it show?
I'm trying to use an image as a value and I put the html code and it works fine, but when I view it on the site. It just shows the html code for the image. Is there away to make it show?
Where are trying to put it? Could you elaborate the issue a little bit?
I'm trying to use the button as a replacement of text on a input button for the shopping cart. It had the text "Checkout" but I have a button image that says "Proceed to Checkout". And I was putting the image as the value in the admin section of aspdnsf I would use CSS but i feel that the ID of the Button is similar but in different areas with different text. Am I going about the wrong with this?
Last edited by pkdang; 08-14-2009 at 12:44 PM.
Correct me if I'm wrong but you're trying to use image to replace the Checkout button, right?
Yes, I attached some screenshots to show you want I mean.
If you intend to modify the Checkout button and I believe you're modifying the shoppingcart.aspx page. You could just change the asp.net button control to asp.net image control, rather than using the string resource.
To elaborate, unfortunately, you can't use an HTML tag as a string resource in this context, which is why you're seeing the HTML you entered on the checkout page, but the actual button on the admin site. The reason this isn't working the way you expect is on the customer facing side of the site we HTMLEncode all dynamic values we display on the page. Not doing so would leave the site vulnerable Cross-Site Scripting attacks. While you can change the text of the checkout button, to change the button itself you need to change such in the code rather than the string resource.
Dusty
ASPDotNetStorefront Staff
Last edited by Dusty; 08-14-2009 at 01:24 PM. Reason: Clarifying
So I try inserted this code to show the button as an image
This is the originalCode:<asp:ImageButton ImageUrl="skins/Skin_1/curo_images/proceed_checkout.jpg" runat="server" ID="btnCheckOutNowTop" onCommand="btnCheckOutNowTop_Click" />
But I get this errorCode:<asp:Button ID="btnCheckOutNowTop" Text="(!shoppingcart.cs.111!)" runat="server" CssClass="CheckoutNowButton" />
What am I doing wrong? I'm really new to asp.netCode:Compiler Error Message: CS0029: Cannot implicitly convert type 'System.EventHandler' to 'System.Web.UI.ImageClickEventHandler' Source Error: Line 144: btnContinueShoppingTop.Click += new EventHandler(btnContinueShoppingTop_Click); Line 145: btnContinueShoppingBottom.Click += new EventHandler(btnContinueShoppingBottom_Click); Line 146: btnCheckOutNowTop.Click += new EventHandler(btnCheckOutNowTop_Click); Line 147: btnCheckOutNowBottom.Click += new EventHandler(btnCheckOutNowBottom_Click); Line 148: btnInternationalCheckOutNowTop.Click += new EventHandler(btnInternationalCheckOutNowTop_Click);
A little modification needed. First, you must change the onCommand="btnCheckOutNowTop_Click" toThen, search and comment the following lines out on the shoppingcart.aspx.cs:Code:OnClick="btnCheckOutNowTop_Click"
Lastly, change this line:Code:btnCheckOutNowTop.Click += new EventHandler(btnCheckOutNowTop_Click); btnCheckOutNowTop.Text = AppLogic.GetString("shoppingcart.cs.111", SkinID, ThisCustomer.LocaleSetting);
void btnCheckOutNowTop_Click(object sender, EventArgs e)
to:
and that should be it...Code:protected void btnCheckOutNowTop_Click(object sender, System.Web.UI.ImageClickEventArgs e)
Last edited by Jao; 08-17-2009 at 10:08 AM.
It Works! Thanks for the help!
I have not found
btnCheckOutNowTop.Click += new EventHandler(btnCheckOutNowTop_Click);
I found the .text code but not the .click code
I get the error:
Code:Parser Error Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. Parser Error Message: The base class includes the field 'btnCheckOutNowTop', but its type (System.Web.UI.WebControls.Button) is not compatible with the type of control (System.Web.UI.WebControls.ImageButton). Source Error: Line 33: <td valign="center" align="right"> Line 34: <asp:Button ID="btnContinueShoppingTop" Text="<%$ Tokens:StringResource,shoppingcart.cs.62 %>" CssClass="ContinueShoppingButton" runat="server" />  Line 35: <asp:ImageButton ImageUrl="App_Themes/Skin_1/proceed_checkout.png" runat="server" ID="btnCheckOutNowTop" OnClick="btnCheckOutNowTop_Click" />  Line 36: <asp:Button ID="btnQuickCheckoutTop" Text="<%$ Tokens:StringResource,shoppingcart.cs.111a %>" Visible="false" runat="server" CssClass="CheckoutNowButton" /> Line 37: <asp:Button ID="btnInternationalCheckOutNowTop" Visible="false" Text="<%$ Tokens:StringResource,shoppingcart.cs.111b %>" runat="server" CssClass="CheckoutNowButton" />  Source File: /shoppingcart.aspx Line: 35
Last edited by PowerProducts; 09-30-2011 at 02:06 PM.
Currently running 9.3 Multistore on 5 sites.
Anyone have any ideas?
This forum is frustrating, it is hard to get support.
Currently running 9.3 Multistore on 5 sites.