.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
MarieAdela
Imran Ghani
Post New Web Links

How do I add smtp status code to this?

Posted By:      Posted Date: September 15, 2010    Points: 0   Category :ASP.Net
 
I have this code that logs an error when it occurs at the application level.  This is in a class of it's own.  I then have the logic in the global asax file that calls this code and passes in the base and inner exception along with some other info.I want to add the smtp status code to this so it's captured when an error occurs.  I think this will make it easier to figure out what's wrong when something goes wrong.I'm not clear on the best way to capture the smtp status code though.  How should I add this to this code?Global.asax file: protected void Application_Error(object sender, EventArgs e) { // Code that runs when an unhandled error occurs Exception baseException = Server.GetLastError().GetBaseException(); Exception innerException = Server.GetLastError().InnerException; string stackTrace = Server.GetLastError().StackTrace; // gets the name of the application that caused the exception string source = Server.GetLastError().Source; string baseException2 = baseException.Message.ToString(); string innerException2; if (innerException != null) { innerException2 = innerException.ToString(); } else { innerException2 = "Inner exception is null


View Complete Post


More Related Resource Links

Change the Workflow Status through code

  

HI Folks,

I have a scenario where i need to develop a 6 stage approval workflow(sequential) using WWF and depoly it to sharepoint. Everythigns fine till here.

Now we look ahead to change the Status field on the documents library which actually has the Workflow Name as the column name and its value being In Progress, depending on the stage of approval. Like(Approved 1, Approved 2, Approved 3.)

And if rejected the status should be rejected than Completed. Any idea how can we update this column of the List item.

I have tried item[workflowProperties.Workflow.ParentAssociation.Name]="Approved 1";

But this throws an error saying input string is not in a correct format.

Any information would be of great help :)

Thanks


Sreeharsha Alagani

The status code returned from the server was: 500

  
  I am getting the following eroor , when using the UpdatePanel of Ajax Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server.The status code returned from the server was: 500 To my strange ,the error is thrown not all the time , only in some rare cases which could not be found out . I tried to increase the AsyncPostBackTimeout to 300 which was 60 but i could n't  get the error down  installing the ajax set up in server is must or not ?  We just placed the ajax dlls in the server. Please can anybody help me with right solution.   Regards G Suresh Kumar         

i cannot access iis virtual directory using http protocol..getting status code error 403

  
i am trying to connect to remote exchange using powershell..while using powershell session i get status error 403...i changed the settings in iis manager...i have set all the settings in the iis manager as said in the msdn support blogs...yet i get the same error when i access it in the client url and also in powershell of the client computer...if i cannot connect using powershell,can i connect using .net???somebody help me...i am beginner and i am stuck...

JQuery: is there a way to show status message - from code behind?

  

i am trying to figure out how to display message box after it done executing the server side code

 here is the code which works from the client side but still looking for a way to make it work from code-behind

.aspx

<div id="status"></div>

script:

$("#status").fadeTo(500, 1, function() { $(this).html("You are now registered!").fadeTo(7000, 0); })


SSRS 2008 error - Sys.WebForms.PageRequestManagerServerErrorException: status code 12029

  

Hi,

I am executing a huge report in SSRS 2008, after some time the report doesn't renders and there is an error icon at the left bottom of the web page. When I click open it to see the details, it gives following error;

Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while
processing the request on the server. The status code returned from the server was: 12029.

Any help on this will be appreciated.

Regards.


WebForms.PageRequestManagerServerErrorException: Status code 500

  

Hi

I'm getting "Sys, WebForms.PageRequestManagerServerErrorException: an unknow error occured while processing the request on the server. the status code returned from the server was: 500".

I'm using a GridView and Button in an Update panel, and on click on the button i'm returning selected rows from the gridview which was throwing the above error in javascript popup. Specifically this error is coming only if I assign "DataKeysNames" property of the gird view. Otherwise, it is working fine.

Please help me how to resolve this error.

Thanks inadvance

Regards

Anand

 

 

WsHttpBinding: No FaultException for http status code 400 (for 500 everything works fine)

  

A .NET client consumes web services using Soap 1.2 via WCF. The services generate SOAP errors with http status code 400 and body containing SOAP fault code as well as subcodes. The client side exception that is thrown only contains InnerException = {"The remote server returned an error: (400) Bad Request."} without ability to access SOAP error code information.

For http status code 500 type of errors everything works fine by raising a FaultException with information.

Is there any flag to get it working for http status code 400 as well?


TDSSNIClient initialization failed with error 0x2, status code 0x35.

  
Hi,
I've just added a second node to a w2k3 / SQL2005 cluster. I got through the install of SQL onto the new node but when I tried to fail over SQL would not start. Now it won't run on either node. I get the following error messages in the SQL log. My research indicates this is related to named pipes (possibly having an extra space in the config but I could not see one. I have alsotried to start the node with this disabled and enabled and neither work.

Error: 17182, Severity: 16, State: 1.
TDSSNIClient initialization failed with error 0x2, status code 0x35.
Error: 17182, Severity: 16, State: 1.
TDSSNIClient initialization failed with error 0x2, status code 0x1.
Error: 17826, Severity: 18, State: 3.
Could not start the network library because of an internal error in the network library. To determine the cause, review the errors immediately preceding this one in the error log.
Error: 17120, Severity: 16, State: 1.
SQL Server could not spawn FRunCM thread. Check the SQL Server error log and the Windows event logs for information about possible related problems.


This is my test setup running on VMWare Server but I need to do this twice on a mission critical production server soon, replacing the hardware of both nodes, so

RESTful service call results in status code 409 - why?

  

My RESTful WCF service has methods to retrieve and update an object.  The retrieval works just fine but the update (or PUT) doesn't.

Here's the service interface and implementation:

 

    [ServiceContract]
    public interface ICandidate
    {
        [OperationContract]
        Common.RestResponse<Person> GetPersonByIndex(string index);

        [OperationContract]
        void UpdatePerson(string id, Person person);
    }
[AspNetCompatibilityRequirements(RequirementsMode=AspNetCompatibilityRequirementsMode.Required)]
    public class Candidate : ICandidate
    {
        [WebGet(UriTemplate = "/{index}",
                RequestFormat = WebMessageFormat.Json,
                ResponseFormat = WebMessageFormat.Json)]
        public Common.RestResponse GetPersonByIndex(string index)
        {
            Common.RestResponse result = new TWA.Common.RestResponse();

            int Index = 0;
            if (Int32.TryParse(index, out Index)) 
            {
                List list = PersonService.GetPersonList(true, true, true);
                if (list.Count > Index)
                {
                    result.Success = true;
                    result.Count = list.Count;
                    result.Data = list[Index];
                }
            }
 

Code Optimized Web Development Profile (VS 2010 and .NET 4.0 Series)

  
When you first run VS 2010 it prompts you to select an IDE profile to use. The profile you select will configure how tool windows are displayed/docked in the IDE by default and set the default keyboard shortcuts. You can then customize any of these settings by using the Tools->Options menu within the IDE and then override/change them. You can also later reset your profile and pick a different one by choosing the Tools->Import and Export Settings menu command.

Free Code Snippets - ASP.NET

  
You Can Find Useful ASP.NET Related Posts on the above link.

Free Code Snippets - C#

  
Free C# Code Snippets

call JavaScript - jQuery code from ASP.NET Server-Side

  
jQuery got so close to me lately that I can see myself adding the scripts to my project almost unconsciously. The thing is, jQuery is very useful for me, in almost all situations and it has been a do or die enhancement for all my project since I first put my hands on it.

Of course while using it, you encounter few situations which need a bit of research to solve, mostly when you are trying to combine it with some other technologies like: UpdatePanels and ASP.NET Ajax. For instance there are many situations when I would like to run some jQuery magic based on some decision that I make on the server side.

call JavaScript - jQuery code from ASP.NET Server-Side

  
jQuery got so close to me lately that I can see myself adding the scripts to my project almost unconsciously. The thing is, jQuery is very useful for me, in almost all situations and it has been a do or die enhancement for all my project since I first put my hands on it.

Of course while using it, you encounter few situations which need a bit of research to solve, mostly when you are trying to combine it with some other technologies like: UpdatePanels and ASP.NET Ajax. For instance there are many situations when I would like to run some jQuery magic based on some decision that I make on the server side

Microsoft StyleCop: Source Code Analyzer for C#

  
StyleCop is similar in many ways to Microsoft Code Analysis (specifically FxCop), but there are some important distinctions. FxCop performs its analysis on compiled binaries, while StyleCop analyzes the source code directly. For this reason, FxCop focuses more on the design of the code, while StyleCop focuses on layout, readability and documentation. Most of that information is stripped away during the compilation process, and thus cannot be analyzed by FxCop.

Code spelling checker extension for visual studio 2010

  
Building a spelling checker for source code as an extension for visual studio 2010.

C# and XML Source Code Documentation

  
Through many years of enterprise level software development and consulting, I became critically aware of the importance of good source code documentation, and several years ago when I began working with the first release of Visual Studio .NET beta 1 and found C# provided built-in support for inline XML code documentation, I was thrilled.
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend