|
Question 1.
Code to send email using ASP.NET?
Answer: using System.Net.Mail;
smtpClient = new SmtpClient();
smtpClient.Host = "localhost";
smtpClient.Port = 25;
MailMessage message = new MailMessage();
message.To.Add("to@to.com");
message.From = new MailAddress("from@from.com", "Sender Name");
message.Subject = "Your subject";
message.IsBodyHtml = false;
message.Body = "Your Message";
smtpClient.Send(message );
|
|
Question 2.
How can you read file hosted on other server using http protocol?
Answer: using System.Net;
WebRequest webRequest = WebRequest.Create(row["QPUrl"].ToString());
webRequest.Timeout = 5000;
WebResponse objResponse = null;
objResponse = webRequest.GetResponse();
long length = objResponse.ContentLength;
length = length/1024;
lblFileSize.Text = "File Size : " + length.ToString() + " KB";
|
|
Question 3.
What is WSDL?
Answer: web services defination Laguage
|
|
Question 4.
What is custom validator?
|
|
Question 5.
Whats the purpose of .asmx files? or How can you create webservice using ASP.NET?
|
|
Question 6.
Session state vs. View state?
|
|
Question 7.
Define ViewState?
Answer: The Control.ViewState property is associated with each server control in your web form and provides a dictionary object for retaining values between such multiple requests for the same page. This is the method that the page uses to preserve page and control property values between round trips.
When the page is processed, the current state of the page and controls is hashed into a string and saved in the page as a hidden field. When the page is posted back to the server, the page parses the view state string at page initialization and restores property information in the page.
|
|
Question 8.
Whats the difference between Response.Write and Server.Transfer?
|
|
Question 9.
What is .skin file?
|
|
Question 10.
How can you define themes for ASP.NET Website?
|
|
Question 11.
What is Master Page?
|
|
Question 12.
Whats the difference between inline and code behind.
Answer: Code-behind is code written in a separate file and referenced by the .aspx page.
<%Page CodeFile="MyCodeFile.aspx.cs" %>
Inline code written in within the html file.
|