This is a migrated thread and some comments may be shown as answers.

CustomAdvancedTemplate - insert Session(userID)

4 Answers 48 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Rubihno
Top achievements
Rank 1
Rubihno asked on 17 Sep 2008, 09:20 AM
I have tried to insert automatically a session("userID")into a table appointment when i insert an appointment
I make a login and i save userID into a session("userID"), when i insert an appointment i would like inserti automatically a userID that is in session("userID")

table

ID
Subject
Start
End
Recurrence-rule
Data_storage
UserID --------------------> table -> User -> column ->UserID

I use a sqldatasource to insert..

Code

SchedulerDefaulForm.ascx

I add a textbox ->  <asp:TextBox runat="server" ID="UserIDText" Text='<%# Eval("UserID") %>'></asp:TextBox>

SchedulerDefaultForm.ascx.as

I tried to write this code but don't works

 [Bindable(BindableSupport.Yes, BindingDirection.TwoWay)]
        public int  UserID
        {
            get
            {
                return UserIDText.Text;
            }
            set
            {
                UserIDText.Text = Session("userID");
            }

        }
 
There is a method to save automatically a session("userID") into a table appointment when i insert?with a customadvancedtemplate is not easy..i have a problem to develop all that i want...

4 Answers, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 18 Sep 2008, 12:40 PM
Hi Rubihno,

You can configure the SqlDataSource that RadScheduler is bound to to get the UserID parameter directly from the session variable:

            <UpdateParameters> 
                <asp:Parameter Name="Subject" Type="String" /> 
                <asp:Parameter Name="Start" Type="DateTime" /> 
                <asp:Parameter Name="End" Type="DateTime" /> 
                <asp:SessionParameter SessionField="userID" Name="UserID" Type="Int32" /> 
                <asp:Parameter Name="RoomID" Type="Int32" /> 
                <asp:Parameter Name="RecurrenceRule" Type="String" /> 
                <asp:Parameter Name="RecurrenceParentID" Type="Int32" /> 
                <asp:Parameter Name="Annotations" Type="String" /> 
                <asp:Parameter Name="ID" Type="Int32" /> 
            </UpdateParameters> 
            <InsertParameters> 
                <asp:Parameter Name="Subject" Type="String" /> 
                <asp:Parameter Name="Start" Type="DateTime" /> 
                <asp:Parameter Name="End" Type="DateTime" /> 
                <asp:SessionParameter SessionField="userID" Name="UserID" Type="Int32" /> 
                <asp:Parameter Name="RoomID" Type="Int32" /> 
                <asp:Parameter Name="RecurrenceRule" Type="String" /> 
                <asp:Parameter Name="RecurrenceParentID" Type="Int32" /> 
                <asp:Parameter Name="Annotations" Type="String" /> 
            </InsertParameters> 

I hope this helps.

All the best,
Simon
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Rubihno
Top achievements
Rank 1
answered on 18 Sep 2008, 12:43 PM
Thanks, i try this solution..

Hi
0
Rubihno
Top achievements
Rank 1
answered on 18 Sep 2008, 01:18 PM
Don't run, there are problem..i don't must declare a sessionfield?for associate session("userid") to a sessionparameter...
0
Rubihno
Top achievements
Rank 1
answered on 18 Sep 2008, 03:44 PM
now works, thans a lot
Tags
Scheduler
Asked by
Rubihno
Top achievements
Rank 1
Answers by
Simon
Telerik team
Rubihno
Top achievements
Rank 1
Share this question
or