Wonders of Javascript

For the first I had to use javascript from Server side. this is how I did the job.I had a datatable fetching a rows from a stored procedure. these records where being added to the table control and then


dtClaim = SCMERP.Sale.Claims_GetbyClaimID(ddlClaim.SelectedValue)
If dtClaim.Rows.Count = 0 Then
Else

strClientScript &= "var TotalClaims = (" & dtClaim.Rows.Count & ");" & vbNewLine
strClientScript &= "function UpdateDND(){" & vbNewLine
strClientScript &= "var TotalDND= 0, i=0;" & vbNewLine
strClientScript &= "for(i=0;i strClientScript &= "var tbxSaleable = document.getElementById('ctl00_BodyContent_tbxSaleable'+i ).value;" & vbNewLine
strClientScript &= "var tbxQty = document.getElementById('ctl00_BodyContent_lblQuantity'+i ).value;" & vbNewLine
strClientScript &= "var tbxSettled = document.getElementById('ctl00$BodyContent$tbxSettled'+i ).value;" & vbNewLine
strClientScript &= " if(tbxSettled != '' & tbxSaleable !=''){" & vbNewLine
strClientScript &= " if((parseFloat(tbxSettled)+ parseFloat(tbxSaleable)) < (parseFloat(tbxQty))){" & vbNewLine
strClientScript &= "var Total = (parseFloat(tbxQty)- (parseFloat(tbxSettled)+ parseFloat(tbxSaleable)));" & vbNewLine
strClientScript &= " }" & vbNewLine
strClientScript &= " }" & vbNewLine

strClientScript &= "document.getElementById('ctl00_BodyContent_lblDND'+i).innerText = formatAmount(Total); " & vbNewLine
strClientScript &= " }" & vbNewLine
strClientScript &= "}" & vbNewLine
ScriptManager.RegisterClientScriptBlock(Me, Me.GetType(), "Script", strClientScript, True)
ScriptManager.RegisterStartupScript(Me, Me.GetType(), "Startup", "UpdateDND();", True)
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Script Block
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
End If
End Sub

Comments

Popular posts from this blog

SPFx: Develop using SharePoint Framework without Installing all the dependecies.

SharePoint Online: Elevated Permissions....with love

Powershell: Filling up an Existing Excel Sheet with data from SQL Server