1. What is ASP?
Active
Server Pages (ASP), also known as Classic ASP, is a Microsoft's server-side
technology, which helps in creating dynamic and user-friendly Web pages. It
uses different scripting languages to create dynamic Web pages, which can be
run on any type of browser. The Web pages are built by using either VBScript or
JavaScript and these Web pages have access to the same services as Windows
application, including ADO (ActiveX Data Objects) for database access, SMTP
(Simple Mail Transfer Protocol) for e-mail, and the entire COM (Component
Object Model) structure used in the Windows environment. ASP is implemented
through a dynamic-link library (asp.dll) that is called by the IIS server when
a Web page is requested from the server.
2. What is ASP.NET?
ASP.NET is
a specification developed by Microsoft to create dynamic Web applications, Web
sites, and Web services. It is a part of .NET Framework. You can create ASP.NET
applications in most of the .NET compatible languages, such as Visual Basic,
C#, and J#. The ASP.NET compiles the Web pages and provides much better
performance than scripting languages, such as VBScript. The Web Forms support
to create powerful forms-based Web pages. You can use ASP.NET Web server
controls to create interactive Web applications. With the help of Web server
controls, you can easily create a Web application.
3. What is the basic difference between
ASP and ASP.NET?
The basic
difference between ASP and ASP.NET is that ASP is interpreted; whereas, ASP.NET
is compiled. This implies that since ASP uses VBScript; therefore, when an ASP
page is executed, it is interpreted. On the other hand, ASP.NET uses .NET
languages, such as C# and VB.NET, which are compiled to Microsoft Intermediate
Language (MSIL).
4. How to send email using ASP.NET?
public string server1 = "xyz.com", user_id = "info@xyz.com", pass = "123456";
protected void btnSend_Click(object sender, EventArgs e)
{
if (txtMessage.Text != "" && txtName.Text != "" && txtEmail.Text != "")
{
string body = "<b>Name : </b>" + txtName.Text + "<br/><b>E-mail : </b>" + txtEmail.Text + "<br/><b>Contact : </b>" + txtcontact.Text + "<br/><b>Full Address : </b>" + txtMessage.Text;
sendMail(server1, user_id, pass, "rb4ever4u@gmail.com", body, "Feedback");
//sendMail(server1, user_id, pass, "rb4ever4u@gmail.com", body, "Feedback", FileUpload1, FileUpload2);
ClearAll();
lblmsg.Text = "Message Send...";
}
else
lblmsg.Text = "Fill detail first...";
}
public static void sendMail(string server, string userID, string password, string sendTo, string body, string subject)
{
try
{
using (System.Net.Mail.MailMessage mess = new System.Net.Mail.MailMessage())
{
System.Net.Mail.SmtpClient sc = new System.Net.Mail.SmtpClient();
mess.To.Add(sendTo);
//if (file.HasFile)
// mess.Attachments.Add(new Attachment(file.PostedFile.InputStream, file.FileName));
mess.Subject = subject;
mess.Body = body;
mess.IsBodyHtml = true;
mess.From = new System.Net.Mail.MailAddress(userID);
sc.Host = server;
sc.Port = 25;
sc.UseDefaultCredentials = false;
sc.Credentials = new System.Net.NetworkCredential(userID, password);
sc.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network;
sc.Send(mess);
}
}
catch (Exception)
{
}
}
5. How to send sms on mobile using ASP.NET?
string message = message + ", Confirm appointment with " + DocName + " on " + grdRow.Cells[1].Text + " at " + grdRow.Cells[2].Text + " for " + grdRow.Cells[8].Text + ": " + ClinicName + " Tel: " + Session["ProviderTel"].ToString() + "";
SMSSend("8896748285", message);
public void SMSSend(String PatMobNo, String MsgText)
{
lstSMS = objEmailSms.ReadDefaultSMS();
String profileid = "", propasswd = "", senderid = "";
lstSMS = objEmailSms.ReadDefaultSMS();
if (lstSMS != null && lstSMS.Count > 0)
{
int a = MsgText.Length;
profileid = lstSMS[0].ProfileID.ToString();
propasswd = lstSMS[0].Password.ToString();
senderid = lstSMS[0].SenderID.ToString();
}
else
return;
if (PatMobNo.StartsWith("0"))
PatMobNo = PatMobNo.Substring(1, PatMobNo.Length - 1);
String MobileNo = "91" + PatMobNo.Replace(@"-",string.Empty);;
WebClient client = new WebClient();
string baseurl = "http://www.genesis-sms.com/app/smsapi/index.php?key=" + profileid + "&campaign=" + propasswd + "&routeid=39&type=text&contacts=" + MobileNo + "&senderid=" + senderid + "&msg=" + MsgText;
Stream data = client.OpenRead(baseurl);
StreamReader reader = new StreamReader(data);
string s = reader.ReadToEnd();
data.Close();
reader.Close();
}
public void SMSSend(String PatMobNo, String MsgText)
{
lstSMS = objEmailSms.ReadDefaultSMS();
String profileid = "", propasswd = "", senderid = "";
lstSMS = objEmailSms.ReadDefaultSMS();
if (lstSMS != null && lstSMS.Count > 0)
{
int a = MsgText.Length;
profileid = lstSMS[0].ProfileID.ToString();
propasswd = lstSMS[0].Password.ToString();
senderid = lstSMS[0].SenderID.ToString();
}
else
return;
if (PatMobNo.StartsWith("0"))
PatMobNo = PatMobNo.Substring(1, PatMobNo.Length - 1);
String MobileNo = "91" + PatMobNo.Replace(@"-",string.Empty);;
WebClient client = new WebClient();
string baseurl = "http://www.genesis-sms.com/app/smsapi/index.php?key=" + profileid + "&campaign=" + propasswd + "&routeid=39&type=text&contacts=" + MobileNo + "&senderid=" + senderid + "&msg=" + MsgText;
Stream data = client.OpenRead(baseurl);
StreamReader reader = new StreamReader(data);
string s = reader.ReadToEnd();
data.Close();
reader.Close();
}
{
lstSMS = objEmailSms.ReadDefaultSMS();
String profileid = "", propasswd = "", senderid = "";
lstSMS = objEmailSms.ReadDefaultSMS();
if (lstSMS != null && lstSMS.Count > 0)
{
int a = MsgText.Length;
profileid = lstSMS[0].ProfileID.ToString();
propasswd = lstSMS[0].Password.ToString();
senderid = lstSMS[0].SenderID.ToString();
}
else
return;
if (PatMobNo.StartsWith("0"))
PatMobNo = PatMobNo.Substring(1, PatMobNo.Length - 1);
String MobileNo = "91" + PatMobNo.Replace(@"-",string.Empty);;
WebClient client = new WebClient();
string baseurl = "http://www.genesis-sms.com/app/smsapi/index.php?key=" + profileid + "&campaign=" + propasswd + "&routeid=39&type=text&contacts=" + MobileNo + "&senderid=" + senderid + "&msg=" + MsgText;
Stream data = client.OpenRead(baseurl);
StreamReader reader = new StreamReader(data);
string s = reader.ReadToEnd();
data.Close();
reader.Close();
}
public void SMSSend(String PatMobNo, String MsgText)
{
lstSMS = objEmailSms.ReadDefaultSMS();
String profileid = "", propasswd = "", senderid = "";
lstSMS = objEmailSms.ReadDefaultSMS();
if (lstSMS != null && lstSMS.Count > 0)
{
int a = MsgText.Length;
profileid = lstSMS[0].ProfileID.ToString();
propasswd = lstSMS[0].Password.ToString();
senderid = lstSMS[0].SenderID.ToString();
}
else
return;
if (PatMobNo.StartsWith("0"))
PatMobNo = PatMobNo.Substring(1, PatMobNo.Length - 1);
String MobileNo = "91" + PatMobNo.Replace(@"-",string.Empty);;
WebClient client = new WebClient();
string baseurl = "http://www.genesis-sms.com/app/smsapi/index.php?key=" + profileid + "&campaign=" + propasswd + "&routeid=39&type=text&contacts=" + MobileNo + "&senderid=" + senderid + "&msg=" + MsgText;
Stream data = client.OpenRead(baseurl);
StreamReader reader = new StreamReader(data);
string s = reader.ReadToEnd();
data.Close();
reader.Close();
}
No comments:
Post a Comment