We were supposed to write a plugin against say entity A which would be updating a related entity B only if the value of one of the attribute(string) in entity A is blank.
The plugin was a post update one , so even though we had registered pre/post image with that particular attribute and as it was null, the property/value wasn’t getting passed.
So there was no way to access it in the entity images.
Only way to access the value was to make use of query expression class to get the value saved in the table for that entity. But we decided to use another approach.
Normally if we set a ForceSubmit on a particular field it is passed as one of the property of inputparameters of the context.
So what we did was set ForceSubmit on the field and then converted the inputparameters properties as Dynamic Entity and were able to get the value of that attribute even in case when it was null/blank.
Sub RC4Initialize(strPwd)
dim tempSwap
dim a
dim b
intLength = len(strPwd)
For a = 0 To 255
key(a) = asc(mid(strpwd, (a mod intLength)+1, 1))
sbox(a) = a
next
b = 0
For a = 0 To 255
b = (b + sbox(a) + key(a)) Mod 256
tempSwap = sbox(a)
sbox(a) = sbox(b)
sbox(b) = tempSwap
Next
End Sub
Function EnDeCrypt(plaintxt, psw)
dim temp
dim a
dim i
dim j
dim k
dim cipherby
dim cipher
i = 0
j = 0
RC4Initialize psw
For a = 1 To Len(plaintxt)
i = (i + 1) Mod 256
j = (j + sbox(i)) Mod 256
temp = sbox(i)
sbox(i) = sbox(j)
sbox(j) = temp
k = sbox((sbox(i) + sbox(j)) Mod 256)
cipherby = Asc(Mid(plaintxt, a, 1)) Xor k
cipher = cipher & Chr(cipherby)
Next
EnDeCrypt = cipher
End Function
%>
And following is the code for my asp page
<!–#include file=”g.inc”–>
<html>
<head>
<title>TestPage</title>
</head>
<body>
<form action=”G.asp” method=”post”>
<%
dim psw, txt
dim strTemp
txt=”NishantRana”
psw=”myPassword”
strTemp=EnDeCrypt(txt,psw)
response.write “Encrypted Text =” & strTemp & “</Br>”
txt=EnDeCrypt(strTemp,psw)
response.write “Decrypted Text =” & txt
%>
</form>
It mostly happens when IIS is installed after .NET is installed. So in this case we need to make use of aspnet_regiis.exe utility.
1) Go to command prompt
2) Go to the following path
“C:WINDOWSMicrosoft.NETFrameworkv2.0.50727”
depending on the version.
3) Enter “aspnet_regiis.exe -i”
4) It will display the message finished installing
5) Open your IIS
6) Select web service extensions
7) Click on Allow for ASP.NET v2.0.50727
That’s it . Now the IIS has been configured properly
But if you haven’t installed the management studio than in that case you need to make following change in the registry
HKEY_LOCAL_MACHINE / SOFTWARE / Microsoft / Microsoft SQL server / MSSQL.1/ MSSQLSERVER/ LoginMode
Click on it change it’s value from 1 to 2.
Then Restart your sql server service !!!
After you have done this you need to enable you sa account for sql server authentication for this follow these steps
1) Open SQL Server Management Studio Express and Login
2) In Object Explorer, click Security followed by Logins
3) Right click sa user and select Properties.
4) Uncheck Enforce password policy
5) Select Status. Click the Grant and Enabled radio buttons. Click OK
6) Restart your database server and select restart.
The ability to catch certain user actions in code and respond programmmatically. These are theclasses which we can inherit and write event handlers or receivers against them.
Get the values for assembly tag by right clicking the assembly and selecting properties within the GAC.
If we have multiple eventhandler attached to a same event we can specify which handler should be executed first through SequenceNumber tag. It’s value should start from 20000
In case when we need to add controls to our web part we need to override the CreateChildControls method of the base WebPart class along with Render method.
Let’s take a simple example for it, a kind of sample calculator which shows sum of two numbers ]
For this we have added 2 labels, 3 textboxes and 1 button.
On Click of the button the sum of the values entered in textbox1 and textbox2 would be displayed in the textbox3.
The name of the assembly,it’s version, culture and public key token information can be found by right clicking the assembly within gac and selecting properties.