Archive

Archive for the ‘Security’ Category

ASP.NET Exception – Invalid postback or callback argument

September 27th, 2009 Kulrom 1 comment

Invalid postback or callback argument

Invalid postback or callback argument

I’ve read many different suggestions for the Invalid postback or callback argument exception but, most of them do not work.
Some people will suggest to add your code inside If Not Page.IsPostBack Then block, other will tell you to set EnableEventValidation to false which is not serious at all. Even the compiler suggests ClientScriptManager.RegisterForEventValidation method but in most of the situations these will not work.

One is for certain: This specific exception is mostly thrown when you use a Master page!!!

Add the same javascript attributes to the very same server control out of the master page and you’ll see that it is working just fine.
Read more…

Categories: ASP.NET, Security Tags:

Force ASP.NET Page to Use secure HTTP (https) with SSL/TLS

September 15th, 2009 Kulrom No comments

Force ASP.NET to use HTTPS

Force ASP.NET to use HTTPS

Sometimes we want to provide encryption and secure identification of the server creating a secure channel over an insecure network.
In that case we need HTTPS connection which ensures reasonable protection e.g. for payment transactions.

 

Ok let’s see how this thing works.

Say that your page is as follows: http://www.domain.com/yourpage.aspx
Ok, just add this code inside Load Event Handler and voila! That’s it!

 

If Not Request.IsSecureConnection Then
   Response.Redirect("https://www.domain.com/yourpage.aspx ")
End If

 

Categories: Security Tags: