Posts

How to get absolute URL of a web application (SPWebApplication) in SharePoint 2010 C#

Hi Here is the sample code to get absolute URL of web application; string path = webApp.GetResponseUri(SPUrlZone.Default).AbsoluteUri; Thanks

Solved! How to send email using C# in .Net , Simple Code

Hi, These settings are using google email. You may configure it accordingly. using System.Net; using System.Net.Mail; MailMessage mail = new MailMessage (); SmtpClient SmtpServer = new SmtpClient ( "smtp.google.com" ); mail.From = new MailAddress ( "from address" ); mail.To.Add( "to address" ); mail.Subject = "Email Subject" ; mail.Body = "Email Body" ; SmtpServer.Port = 587; SmtpServer.Credentials = new System.Net. NetworkCredential ( "from address" , "from address password" ); SmtpServer.EnableSsl = false ; SmtpServer.Send(mail);

Solved! The state information is invalid for this page and might be corrupted. Solved!

Image
Hello Mates, While working on a ASP.NET project in framework 4.0 i faced a strange error. It was working fine on development machine but failed on server. I google around and spent my 6 to 7 hours to fix the issue. I have tried with making changes in Web.Config and in the page directives but in vain. Finally i decided to troubleshoot my code line by line and point out the issue. The Error was... The state information is invalid for this page and might be corrupted.  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.  Exception Details: System.Web.HttpException: The state information is invalid for this page and might be corrupted. Source Error:  The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then reques...

Iterating through all Web Applications,Site Collections,Sites,Lists and Libraries and Items in a SharePoint farm

private void TraversFarm()         {             SPFarm farm = SPFarm .Local;             foreach ( SPService curService in farm.Services)             {                 if (curService is SPWebService )                 {                     SPWebService webService = ( SPWebService )curService;                     foreach ( SPWebApplication webApp in webService.WebApplications)         ...

security policy export failed. the binding contains a transportsecuritybindingelement

After having a fresh installation of SharePoint 2010 i was facing the following error in my Security Token Service. I tired multiple solutions but could not fix my issue. Finally a  thread  helped me out to solve my problem. Note: This solution worked for me. I had a fresh installation of SharePoint 2010 without SP1 and any update. It was completely OOB. If one tries to visit standard web service such as SecurityTokenServiceApplication ( http://localhost:32843/SecurityTokenServiceApplication/SecurityToken.svc  , or https://localhost:32844/SecurityTokenServiceApplication/SecurityToken.svc  ), the service will respond with System.InvalidOperationException Error:  Security policy export failed. The binding contains a TransportSecurityBindingElement but no transport binding element that implements ITransportTokenAssertionProvider. Policy export for such a binding is not supported. Make sure the transport binding element in the binding implements the ITran...

Security Token Service is not available (I fixed it)

After having a fresh installation of SharePoint 2010 i was facing the following error in my Security Token Service. I tired multiple solutions but could not fix my issue. Finally a thread helped me out to solve my problem. Note: This solution worked for me. I had a fresh installation of SharePoint 2010 without SP1 and any update. It was completely OOB. If one tries to visit standard web service such as SecurityTokenServiceApplication ( http://localhost:32843/SecurityTokenServiceApplication/SecurityToken.svc  , or https://localhost:32844/SecurityTokenServiceApplication/SecurityToken.svc  ), the service will respond with System.InvalidOperationException Error: Security policy export failed. The binding contains a TransportSecurityBindingElement but no transport binding element that implements ITransportTokenAssertionProvider. Policy export for such a binding is not supported. Make sure the transport binding element in the binding implements the ITransportTokenAsse...

Applications of Artificial Inteligence

http://www.mediafire.com/?7dbd7gi27efg6qh Download Slides