[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details

asp .net CookieParameter

Asked by leong92232 in Active Server Pages (ASP), Programming for ASP.NET, .NET Framework 2.x

Tags: asp, CookieParameter, sqldatasource

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("role", userRole.ToString());
            Response.Cookies.Add(userCookie);

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
[+][-]11/05/09 10:03 PM, ID: 25756907Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/05/09 10:06 PM, ID: 25756919Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/05/09 10:14 PM, ID: 25756954Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/05/09 10:27 PM, ID: 25756991Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/08/09 05:44 PM, ID: 25772948Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-89 - Hierarchy / EE_QW_3_20080625