Posts

Showing posts from December, 2021

UnEditable TextBox (For Security)

   <asp:TextBox ID="someId" runat="server" oncopy="return false" onpaste="return false" oncut="return false" ondelete="return false" Text="hi"></asp:TextBox> Note:- A textbox will be appeared in the screen on which you can not do any operation wheather  it is to copy the data , cut the data, paste the data and delete the data  - this is used for security purposes.

Sending Image Through Mail in dot net

Method 1: Sending mail by directly giving the link in src:- protected void mail_send(object sender, EventArgs e)     {         connectdb();         string q = "select img from wedding_regdb where userid='" + TextBox1.Text + "'";         cm = new SqlCommand(q, cn);         dr = cm.ExecuteReader();         if (dr.Read())         {                          GridViewRow gr1 = ((Button)sender).NamingContainer as GridViewRow;             Button b2 = (Button)gr1.FindControl("mailbtn");             SmtpClient sm = new SmtpClient("student-cell.com", 25);             sm.Credentials = new System.Net.NetworkCredential("contact@student-cell.com", "password");             sm.DeliveryMethod =...