What is the code to send an email from an ASP.NET application?

mail message = new mail(); message.From = “abc@gmail.com”; message.To = “xyz@gmail.com”; message.Subject = “Test”; message.Body = “hello”; SmtpMail.SmtpServer = “localhost”; SmtpMail.Send(message); To send an email from an ASP.NET application, you can use the SmtpClient class available in the System.Net.Mail namespace. Here’s a simple example of how you can send an email using ASP.NET: csharpCopy code … Read more

List the events in the page life cycle

Following are the events in the page life cycle: Page_PreInit Page_Init Page_InitComplete Page_PreLoad Page_Load Page_LoadComplete Page_PreRender Render In the context of a .NET interview, the interviewer might ask about the ASP.NET page life cycle, which describes the sequence of events that occur during the lifetime of an ASP.NET web page. Understanding the page life cycle … Read more

What are EXE and DLL?

EXE and DLL are assembly executable modules. EXE: It is an executable file that runs the application for which it is designed. When we build an application, an exe file is generated. Therefore the assemblies are loaded directly when we run an exe. But an exe file cannot be shared with other applications. DLL: It … Read more

What are the different validators in ASP.NET?

Client-side validation – When the validation takes place on the client-side browser, it is called client-side validation. Usually, JavaScript is used for client-side validation. Server-side validation – When the validation takes place on the server then it is called server-side validation. Server-side validation is considered as a secure form of validation because even if the … Read more

What is delegate in .NET?

A delegate in .NET is similar to a function pointer in other programming languages like C or C++. A delegate allows the user to encapsulate the reference of a method in a delegate object. A delegate object can then be passed in a program, which will call the referenced method. We can even use a … Read more