Posted: 7/8/2011
Hey there!
Email data is an issue. I mean...at first when you select one item with displaying image, you will see the price list with checkbox control shows several prices (memo, card A6, fridge magnet etc) . When you want two items to add to cart to another listbox (id="dlist2"). Then clicking send email button to send to my gmail account. So I get this email and the data should display:
Order (first item): Images/photo1.jpg with Description: memo
Order (second item) : Images/photo2.jpg with Description: card
In this case there is problem when I got email and data looks like:
Name: xxx Email: xxxxx Description:Card A6 // I select second item and checked "card A6" from checkbox control. But where is first item?? Order: //Blank after i select two items images
How to write codes in code behind? Look at my code below:
markup:
<asp:ListBox name="order" Runat="server" ID="dlist1" SelectionMode="Multiple" onchange="swapImage1()" Width="300px" Height="100px"> <asp:ListItem Selected="True" Value="Images/NoneImage.gif">SOW SEEDS OF LOVE</asp:ListItem> <asp:ListItem data-card="32.00" data-memo="62.00" data-tags1="1.80" Value="Images/photo1.jpg">Faith</asp:ListItem> <asp:ListItem data-card="32.00" data-memo="62.00" data-tags1="1.80" Value="Images/photo2.jpg">Grace</asp:ListItem> </asp:ListBox>
<asp:Button Runat="server" ID="btnMoveRight" Text=" Add To Cart >> " onclick="btnMoveRight_Click"></asp:Button>
<asp:Button Runat="server" ID="btnMoveLeft" Text=" Remove << " onclick="btnMoveLeft_Click"></asp:Button>
<asp:ListBox Runat="server" ID="dlist2" SelectionMode="Multiple" Width="300px" Height="100px"></asp:ListBox>
<asp:Image ID="imageToSwap1" runat="server" width="147" height="195" ImageUrl="" />
Here is description (several prices);
<table> <td><input type="checkbox" name="description" value="Card A6" id="description1" runat="server" /> Card A6 (blank)</td> <td id="price_card"></td> //call from javascript to get several prices <td><input type="checkbox" name="description" value="Memo Book A6" id="description2" runat="server" /> Memo Book A6</td> <td id="price_memo"></td>
</table>
code behind (c#)
protected void Send_Click1(object sender, EventArgs e) {
....... (gmail code process working fine)
.......
msg += "Name: " + txtName.Text; // i can see this data display in email like Name: xxxxx msg += "<br>Email: " + txtEmail.Text; // i can also see this data display in email like Email: xxxxx
msg += "<br>Order: " + Request["order"]; // first listbox name="order" but cannot display image path
if (description1.Checked == true) { msg += "<br>description1:" + description1.Value; // card A6 and if you select first item and checked this description then email should display data like order: Images/photo1.jpg with description1:card A6 } if (description2.Checked == true) { msg += "<br>description2:" + description2.Value; //memo card and if you select second item and checked this description then email should display data like order:Images/photo2.jpg with description2:memo } msg += "<br>Comment: " + txtComment.Text;
Hope you understand it otherwise you can check out my url link www.ellierose.co.za/Contact.aspx so that you will understand what i want.
Hope you can help out when you have free time. Thank you again :-)