I have a cookie on user information. The code below stated the way to store the cookie:
HttpCookie userCookie = new HttpCookie("user");
userCookie.Values.Add("id"
, uid.ToString());
userCookie.Values.Add("rol
e", userRole.ToString());
Response.Cookies.Add(userC
ookie);
I have a FormView Page for one data entry. I am using SQLDatasource to do the update. I want to access the user id from the cookie by using CookieParameter as below:
<InsertParameters>
<asp:Parameter DbType="DateTime" Name="JobDate" />
<asp:Parameter Name="MF_Job_Ref" Type="String" />
<asp:Parameter Name="Vessel" Type="String" />
<asp:Parameter Name="Voyage" Type="String" />
<asp:Parameter Name="BKG_No" Type="String" />
<asp:Parameter Name="Outer_Pack_Qty" Type="Int32" />
<asp:Parameter Name="Outer_Pack_Unit_ID" Type="Int32" />
<asp:Parameter Name="CBM" Type="Double" />
<asp:Parameter Name="WT" Type="Int32" />
<asp:Parameter Name="CustomerID" Type="Int32" />
<asp:CookieParameter CookieName="user.id" Name="CreateBy" Type="Int32" />
<asp:CookieParameter CookieName="user.id" Name="UpdateBy" Type="Int32" />
</InsertParameters>
The CookieParameter seems not working, It is failed to save. Any help can provide? Thanks