views:

628

answers:

3

Hi,

I can't get the ASP.NET Rating control's selected value(Current Value) in javascript. I am using Rating control in datagrid and do you know how I can get the CurrentValue of ASP.NET Rating in javascript?

A: 

Any Ideas?

A: 

Can you provide any code snippet of Javascript where you want to use the current value of Rating control?
I think, You might need to set the values in hidden valriables and send the variable names in the form of an array to Javascript in the following way:

1) In the RowDataBound Event of the DataGrid
     AjaxControlToolkit.Rating objRatingControl= (AjaxControlToolkit.Rating)row.FindControl("objRatingControl");
     Page.ClientScript.RegisterArrayDeclaration("RatingControlIDs", "'" + objRatingControl.ClientID + "'");

2) Now you can use this array of Rating controls in Javascript.

A: 

Thanks Sachin Gaur,i tried a smilar solution before and asp.net confuses and gives error.I asked that on asp.net forum and a person answered,for databinding controls there is a different solution and it worked for me.