Skip to main content

Posts

Processing AntiForgeryToken send with Ajax

You might have seen below error while doing ajax post to MVC action that validates AntiForgeryToken. ASP.net MVC ValidateAntiForgeryToken does not handle passing RVToken in ajax requests by default. ex: Below token sent in header won't be accepted at Controller level in MVC: __RequestVerificationToken = $('[name=__RequestVerificationToken]').val() I found a  better solution that works perfectly fine for all POST requests. Just implement the custom MVC Authorize attribute as shown below code:  [AttributeUsage(AttributeTargets.Class, AttributeTargets.Method)] public class MyValidateAntiForgeryToken : AuthorizeAttribute { public override void OnAuthorization( AuthorizationContext filterContext ) { var request = filterContext.HttpContext.Request; if (request.HttpMethod == WebRequestMethods.Http.Post) { if (request.IsAjaxRequest()) { var antiForgeryCookie = request.Cookies[AntiForgeryConfi

Web-API - RESTful Services on Microsoft .net for building Ubiquitous web world

It's been very interesting to note about the fantastic things happening in the world of web development. Finally, we got the solid framework for building RESTful services on Microsoft platform. Let's have a very  quick look at the basic detail. REST [Representation State Transfer Protocol]           A representation is a opaque string of bytes that is effectively manifestation of a resource. REST was never about pretty URLs. The whole point of the hypermedia is that client should not need to know how to construct these URLs in the first place. For your clients, they are just STRINGS.           Web-API can be used when you have clients which consumes data from server over HTTP. Now a days, lot of browser applications are rich clients with web server returns some static html and then may be it uses client side framework like jquery, backbonejs or knockoutjs and makes calls back to server to pull data to execute some client-side functionality. Web-API's role is not j

dbms_output.put_line NOT WORKING

In SQL Developer, do you ever face issue while running some test oracle script like below and want to see the dbms output..?  and you don't see the dbms output.. DECLARE    l_name   VARCHAR2 (50) := 'Steven Feuerstein'; BEGIN    DBMS_OUTPUT.put_line ( TRANSLATE (l_name, 'e', '2')); END; Then here is what you got to do .. just add the below snippet on the top and now you should see the dbms output : set serveroutput on format wraped;

steps used for certificate request and configuring a web server for SSL (HTTPS)

These are the standard steps used for certificate request and configuring a web server for SSL (HTTPS) Request a certificate for a web server Before you can use SSL, you have to first install a certificate on your IIS web server. ·          In IIS, right-click on the site you want to secure ·          Select Properties ·          On the  Directory Security  tab, click  Server Certificate ·          Click Next and select  Create A New Certificate ·          Select  Prepare The Request Now, But Send It Later  and click Next ·          Type a name for the certificate and bit length, and then click Next. ·          Type your organizational name and organizational unit in the box provided and click Next. ·          Enter your Web server name and click Next. ·          In the next dialog box, provide some geographical information and click Next. ·          Enter the location and the name for the certification request, then click Next. ·          Verify the inf

SharePoint yammer integration error: System.Exception: Unable to load the web part. IsEdit: False, IsAsync: False, FormMode: Invalid, SharedProperties: {"site_url":"http:// ","service_account":"true","webpart_guid":" ","iframe":"true","version":" "} at Yammer.SharePoint.WebParts.YammerAppsWebPart.CreateChildControls()

Hi there,  if you are searching for below error ..  System.Exception: Unable to load the web part. IsEdit: False, IsAsync: False, FormMode: Invalid, SharedProperties: {"site_url":"http:// ","service_account":"true","webpart_guid":" ","iframe":"true","version":" "} at Yammer.SharePoint.WebParts.YammerAppsWebPart.CreateChildControls()  The solution you can try could be disabling uploading file attachments to yammer. Below are the steps: 1.Select your webapplication from CA > Manage web apps 2.On the Ribbon>Yammer>Yammer Settings 3.Deselect 'Enable uploading file attachments to Yammer' 4.Click 'Save Settings'. And you are done! You can now add yammer web part to page and can check again.

load report failed error - with formatted crystal reports, iis6 and asp.net.net

Error:  load report failed This error troubled us a lot in reports deployment on 64bit server with IIS 6   and took at least 5 hours continuous focus to fix.  We tried to troubleshoot by giving all permissions to the iis user to application folder, application pool recycled,   server reboot and even compared all deployment files in the problem environment with the one in application working environment. But we are failed to fix. 

Test method AddItemRankTest threw exception: System.ServiceModel.ActionNotSupportedException: The message with Action 'urn:xxx.com:xxx /AddItemRank' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and …

This summary is not available. Please click here to view the post.