How to add buttons and textbox in email body using c#?

Posted by Ankitsrist under ASP.NET on 2/27/2013 | Points: 10 | Views : 2609 | Status : [Member] | Replies : 2
as of now i am sending string text as email body.but i want to send approve and cancel button and some text.if user click on approve need to do some functionality .if cancel will perform some action...please help




Responses

Posted by: Santhi on: 2/27/2013 [Member] Starter | Points: 25

Up
0
Down
Hi

Try this following code. you can get some idea.
Like this you have to create.
Your aspx page:
 <form id="form1" runat="server">

<div>

</div>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
<asp:Table ID="Table1" runat="server">
</asp:Table>
</form>

Cs page:
protected void Page_Load(object sender, EventArgs e)
{
TableRow tr = new TableRow();
TableCell tc = new TableCell();
TextBox txt = new TextBox();
txt.Text = "hi";

tc.Controls.Add(txt);
tr.Cells.Add(tc);

TableCell tc1 = new TableCell();
Button btn = new Button();
btn.Click += btn_Click;
btn.Width = 200;
btn.Text = "click me";
tc1.Controls.Add(btn);
tr.Cells.Add(tc1);
Table1.Rows.Add(tr);

} void btn_Click(object sender, EventArgs e)
{
Label1.Text = "welcome";
}


Thanks & Regards,
Santhi .V

Ankitsrist, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Santhi on: 2/27/2013 [Member] Starter | Points: 25

Up
0
Down
Hi

You have to create like this in your code.
I have done like this in my project.
It worked out well.



Thanks & Regards,
Santhi .V

Ankitsrist, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response