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

I cant reach custom attribute from rate event

1 Answer 29 Views
Rating
This is a migrated thread and some comments may be shown as answers.
Cuneyt
Top achievements
Rank 1
Cuneyt asked on 31 Jan 2014, 08:48 AM
hi . i am using rating in listview. and i give to rating custom cId attribute. but i cant reach it now.
rating
<ItemTemplate>
                   <div class="rlvI">
<telerik:RadRating ID="rCevap" runat="server"
                                   Orientation="Vertical"
                                   SelectionMode="Continuous"
                                   IsDirectionReversed="true"
                                   Precision="Exact"
                                   AutoPostBack="true"
                                   OnRate="rCevap_Rate"
                                   cId='<%# Eval("CId") %>'
                                   ViewStateMode="Disabled"
                                   EnableViewState="false"
                                   Visible='<%# Eval("CId")==null?false:true %>'
                                    >
                               </telerik:RadRating>
                   </div>
               </ItemTemplate>

Eval("CId") is not null it has a value.

rate event

protected void rCevap_Rate(object sender, EventArgs e)
        {
           
            RadRating rc = (sender as RadRating);
          
            int cId = Convert.ToInt32(rc.Attributes["cId"]);
...
}


rc.Attributes["cId"] comes null every time.
What is my mistake here.
Thanks.

1 Answer, 1 is accepted

Sort by
0
Cuneyt
Top achievements
Rank 1
answered on 31 Jan 2014, 11:38 AM
ok my mistake viewstate.
problem is solved with viewstate enable.
Tags
Rating
Asked by
Cuneyt
Top achievements
Rank 1
Answers by
Cuneyt
Top achievements
Rank 1
Share this question
or