PDA

View Full Version : need small help


Cyberoxy
07-05-2011, 10:56 AM
Hey there!

Hope not I disturb you. I just need a small help. I'm using some html tags in asp.net c#.

I rather chose to use html select tag and checkbox tag. Contact.aspx.cs (code behind) doesn't recognise it because it is html tags. Is there a way to recognise html tags behind codes?? Look at below codes (bold):

Contact.aspx:

<select runat="server" name="order" multiple="multiple" id="dlist1" onchange="swapImage1()">
<optgroup label="Sow Seeds of Love">
<option data-card="32.00" data-memo="62.00" data-tags1="1.80" data-tags4="8.50" data-key="30.00" data-fridge="40.00" data-flower_sachet="----" value="Images/Order_names/SowSeeds/Faith01_yellow.jpg">Faith Card</option>
<option data-card="32.00" data-memo="62.00" data-tags1="1.80" data-tags4="8.50" data-key="30.00" data-fridge="40.00" data-flower_sachet="----" value="Images/Order_names/SowSeeds/Grace01_green.jpg">Grace Card</option>
</optgroup>
<optgroup label="Goosebumps Vintage A">
<option data-card="32.00" data-memo="62.00" data-tags1="1.80" data-tags4="----" data-key="30.00" data-fridge="40.00" data-flower_sachet="----" value="Images/Order_names/GoosebVA/GoosebumpVA_blue.jpg">Blue</option>
</optgroup>

</select>

<table>

<tr>
<td class="style3"><input type="checkbox" name="description" value="Card A6" id="description" /> Card A6 (blank)</td>
</tr>

</table>

Contact.aspx.cs:
using System.Web.UI.HtmlControls; //included

msg += "Name: " + txtName.Text; // fine
msg += "<br>Surname: " + txtSurname.Text; // fine
msg += "<br>Email: " + txtEmail.Text; // fine
msg += "<br>Order:" + HtmlTextWriterTag.Select.ToString("dlist1"); // belong to select tag

msg += "<br>Order:" + HtmlTextWriterTag...? // belong to checkbox tag - how?

mail.Body = msg;
mail.BodyEncoding = System.Text.Encoding.ASCII;

Hope you can help fix it! Your help much appreciated. Thank you! :-)

Tasslehoff
07-06-2011, 02:25 PM
Why not just use the DropDownList control? It does the wiring for you.