Posted on: 8/18/2014 1:48:32 PM | Views : 389

Hi,

I am building a website for leave management, for which i need to setup the email server setting for sending the emails. It is in asp.net 4.0 with master page functionality.

This page is container page of master page with following textboxes like hostsmtp, usersmtp etc. I am just loading the value on page load and it is giving error system null reference exception on assigning a value to textbox, can you please let me know the reason for the same:

code is placed below
public partial class ConfigEmail : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Configuration config = WebConfigurationManager.OpenWebConfiguration(HttpContext.Current.Request.ApplicationPath); SmtpSection settings = (SmtpSection)config.GetSection("system.net/mailSettings/smtp&q ...

Go to the complete details ...