Click here to Skip to main content
15,884,388 members

Comments by mohdniyaz169 (Top 12 by date)

mohdniyaz169 1-May-16 19:50pm View    
Can u plz suggest me some book for e-commerce projects or links
mohdniyaz169 28-Mar-16 5:33am View    
i have used paging but not good response can u please give me some example,
somebody told me use web services but i don't know how to do this using web services
mohdniyaz169 1-Aug-13 4:25am View    
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
//using NPOI.HSSF.UserModel;
//using NPOI.HSSF;
//using NPOI.HSSF.Util;
//using NPOI;
using System.IO;
using System.Collections;
using System.Xml;
using System.Xml.XPath;
using System.Net.Mail;
using System.Data.SqlClient;
using System.Net;

public class CGeneral
{
public static SqlConnection con = new SqlConnection(DecValue(ConfigurationManager.ConnectionStrings["FinCon"].ConnectionString));
public static string constring = DecValue(ConfigurationManager.ConnectionStrings["FinCon"].ConnectionString);
public static DataTable Dt;
public static DateTime CurrentDate=GetCurrentDate();
// public HSSFWorkbook workbook;
//public HSSFSheet WSheet;

public CGeneral()
{

}
public static string GenUniqNum()
{
string s = "";
DateTime dt = DateTime.Now;
string format = "HHmmss";
s = dt.ToString(format);

string sd, sm, sy;
sy = Convert.ToChar((dt.Year - 2000) + 53).ToString();

if (dt.Month >= 10)
sm = Convert.ToChar(55 + dt.Month).ToString();
else
sm = dt.Month.ToString();

sd = dt.Day.ToString().PadLeft(2, '0');

int rn;
Random rand = new Random();
rn = rand.Next(999);

s = sd + sm + sy + s + rn.ToString().PadLeft(3, '0');
/*For 8 digit password*/
s=s.Remove(8);
return s;

}
public static DateTime GetIndianDate(string Datedt)
{DateTime myDateTime=new DateTime();

try
{
System.Globalization.CultureInfo ukCulture = new System.Globalization.CultureInfo("en-GB");
// pass the DateTimeFormat information to DateTime.Parse
myDateTime = DateTime.Parse(Datedt, ukCulture.DateTimeFormat);
return myDateTime;
}
catch (Exception ex) { ExecuteError(0, 0, ex); return myDateTime; }
}

public static string SentMail(string To, string Subject, string Body,FileUpload FileUplod)
{
try
{
System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();
message.To.Add(To);
message.Subject = Subject;
message.From = new System.Net.Mail.MailAddress("plan@planyourworld.org");
message.Body = Body;
if (FileUplod.HasFile)
{
// File Upload path
String FileName = FileUplod.PostedFile.FileName;
//Getting Attachment file
System.Net.Mail.Attachment mailAttachment = new System.Net.Mail.Attachment(FileName,System.Net.Mime.MediaTypeNames.Application.Octet);

//Attaching uploaded file
message.Attachments.Add(mailAttachment);
}


//message.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", 1);
//message.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "plan");
//message.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "12345678");
System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient("planyourworld.org", 587);
smtp.Credentials = new System.Net.NetworkCredential("plan@planyourworld.org", "12345678");
smtp.Send(message);
return "Mail sent";

}
catch (Exception ex)
{
CGeneral.ExecuteError(0, 0, ex);
return "Error - " + ex.Message;

}

}
public static string SentMail(string To, string Subject, string Body)
{
try
{
System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();
message.To.Add(To);
message.Subject = Subject;
mohdniyaz169 10-Jul-13 5:15am View    
i have 2 button on master page.. one is working 2nd button is not working..
here is the code..

</td><td valign="top" align="right">
<asp:Button ID="btnLoginPop" runat="server" Text="Login" CssClass="myButton2"
onclick="btnLoginPop_Click"/>
<asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
</td>

protected void btnLoginPop_Click(object sender, EventArgs e)
{
ModalPopupExtender1.Show();
}
is working
but
protected void Button1_Click(object sender, EventArgs e)
{
Response.Write(" my name is niya z");

} is not working
mohdniyaz169 10-Jul-13 5:02am View    
yes,
<asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />

////
protected void Button1_Click(object sender, EventArgs e)
{
Response.Write(" my name is niya z");

}