Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Custom webpart posback issues with custom navigation

$
0
0

Hi All,

I have a simple custom feedback web part developed with a single text box and a button to use in the footer area of the masterpage. On the same master page I have used custom consistent global navigation driven by Managed metadata Termset following this blog, 

http://www.bluesphereinc.com/blog/sharepoint/real-cross-site-collection-navigation-in-sharepoint-using-the-term-store/

Now, the issue is that whenever I submit my feedback form, top navigation disappears, I understand that this is due to some postback issues, but not sure how to fix it. Below is the code used for the feedback form webpart.

  protected void Button1_Click(object sender, EventArgs e)
           
        {
            SPWeb theSite = SPControl.GetContextWeb(Context);
            SPUser theUser = theSite.CurrentUser;
            string strUserEmail = theUser.Email;
            if (string.IsNullOrEmpty(TextBox1.Text))
            {
                Label1.Text = ("Your feedback form is empty");
            }
            else
            {
                //SPWebApplication webApp = SPWebApplication.Lookup(new Uri("http://app102"));
                SPWebApplication webApp = SPContext.Current.Site.WebApplication;
                var mail = new MailMessage();
                mail.From = new MailAddress(strUserEmail);
                mail.To.Add("pramod.pendyala@mariestopes.org.uk");
                mail.Subject = "OpenDoor Feedback";
                mail.Body = TextBox1.Text;
                SmtpClient smtp = new SmtpClient(webApp.OutboundMailServiceInstance.Server.Address);
                smtp.UseDefaultCredentials = true;
                smtp.Send(mail);
                Label1.Text = "Your feedback is successfully sent"; 
            }     
            
            
    }

Any help is much appreciated.


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>