Tech-Today
Rijndael Invalid length for a Base-64 char array
I have a requirement to send a variable from a link to a page. But the variable should be encrypted. And md5 will not work because I'm using entity framework and it doesn't recognized the md5 function.
So I implement encryption using Rijndael. I downloaded the class from microsoft and it's working properly in my test cases. So I immediately put it on my web page, but from time to time I got the error above. Note that I already encoded/decoded the variable. What I noticed is that the '+' character is being replaced by a space, weird. I don't have any explanation to this. So what I did was simply revert back ' ' to '+' character, as shown in the following code:
var s = HttpUtility.UrlDecode(Request.QueryString["param"]);
s = s.Replace(" ", "+");
var id = Rijndael.DecryptStringAes(s);
-
How To Create A Data Table In Angular Using Ngtable
I'm trying to evaluate front end frameworks since it's becoming more and more popular lately (I'm more of a backend developer using primefaces). And so I'm looking at angular2 and react, but in this tutorial we will be trying to develop...
-
How To Change Jquery's Dialog Button Label At Run Time
Recently I've used a 3rd party jquery library that pops up a jquery dialog with form content. However if has a default button Save and Cancel, which most of the time is ok, but sometimes you have need to localized or change the label depending on...
-
Validation-summary-errors Div Showing Even If There Is No Error Binded To A Property
I'm working on a change password form when I encountered this strange behavior from mvc3. I created a simple form and change password model with 3 fields (old, new, confirm password). Then I extended ValidationAttribute to validate the password's...
-
Jquery Document.ready $("#controlid") Is Null Error
I'm working on a script that uses jquery and it's working normally on a simple page that I made. However when I create a master page in c# and put the jquery code in the page that extends the master page I get this error: $("#controlId") is null...
-
Magento Email To A Friend Not Working, Even After Updating Product_share.html
After we have successfuly setup our magento store, we've been testing its functionality and found out that email to a friend is not working properly. The product link and image are missing. What we did: 1.) After checking the controller for sendfriend,...
Tech-Today