Thursday, August 06, 2009

Invalid length for a Base-64 char array

Error "Invalid length for a Base-64 char array" when using Convert. FromBase64String(InputString)

Resolution:

When Crypted, replace "+" to space.

string encryptString = Convert.ToBase64String(ms.ToArray());

encryptString = encryptString.Replace("+", " ");


 

When decrypted, replace space back to "+"

encryptString = encryptString.Replace(" ", "+");


 


 

Tuesday, August 04, 2009

Customize Web Dialog Header


Sample of Customizing Header of Web Dialog window, the style of the header
need to override



<style type="text/css">

.edgeTop

{

height:4px;

background:#F0F0F0;

border-top:1px
solid #707070;

font-size:1px;

}

.cornerLeft

{

height:4px;

background:#F0F0F0;

border-top:1px
solid #707070;

border-left:1px
solid #707070;

font-size:1px;

}

.cornerRight

{

height:4px;

background:#F0F0F0;

border-top:1px
solid #707070;

border-right:1px
solid #707070;

font-size:1px;

}



. igdw_HeaderContent



{ background-images:url(‘igdw_HeaderContent_blue.gif’)



}

</style>



<ig:WebDialogWindow
ID="WebDialogWindow1"
runat="server" Height="200px" Width="400px">

<
RoundedCorners
BodyCornerTopLeftCssClass="cornerLeft" BodyCornerTopRightCssClass="cornerRight" BodyEdgeTopCssClass="edgeTop" />

<
Header Visible="False"></Header>

</
ig:WebDialogWindow>





Resizing the infragistics web grid and column automatically

Set Body

body onload ="OnPageLoad();" onresize="SetGridSize();"

JavaScript function:


function OnPageLoad() {
SetGridSize();
}
function SetGridSize() {
//debugger;
//g_grdMediaAttachments_ClientID defined in the codeBehind
var webGrid = igtbl_getGridById(g_grdMediaAttachments_ClientID);
var band = webGrid.Bands[0];
var column = band.getColumnFromKey("Comments");
column.setWidth(GetResizedColumnWidth());

//Not sure why the total of the column width are not equal to frame width
var totalColumnWidth = GetResizedColumnWidth()) + GetFixedColumnWidth() - 34;
webGrid.MainGrid.style.width = totalColumnWidth + "px";


}
function GetResizedColumnWidth() {
var resizedColumnWidth = document.body.clientWidth - GetFixedColumnWidth();
if (resizedColumnWidth < resizedcolumnwidth =" 150;" fixedcolumnwidth =" 0;" fixedcolumnwidth =" fixedColumnWidth" fixedcolumnwidth =" fixedColumnWidth" fixedcolumnwidth =" fixedColumnWidth" fixedcolumnwidth =" fixedColumnWidth" fixedcolumnwidth =" fixedColumnWidth" fixedcolumnwidth =" fixedColumnWidth" width =" 0;" webgrid =" igtbl_getGridById(g_grdMediaAttachments_ClientID);" band =" webGrid.Bands[0];" column =" band.getColumnFromKey(columnName);" width =" column.getWidth();">