Rating System: JQuery & C#.NET - No Value Passed Through To The Back End
Aug 10, 2010
Just to rule it out, I have tried using the AJAX Rating system to no success, so i've decided to develop my own (as useful as AJAX seems to be for some reason I've never got it working on my system). I'm using a Star Rating Widget I attained from [URL] and from there I've taken a demo (so that it is working) and started editing it accordingly to my needs.
What I am setting out to do convert the radio buttons to stars (done via jQuery and working correctly). The user selects their rating then clicks the the Submit Button. The C# in the Submit OnClick Event then accesses the database, using LINQ to SQL, taking the current 'NumberOfVotes' value and adds one to the number, storing in an int object ready to update. The current 'Rating' Value is then updated too, by adding the Value of the Radio button to the current Rate Value then divided by the number of votes (to create the average rating) 'This article has been rated 4.28/5 by 286 Voters.'
However, the value from the selected radio button isnt being passed through to the back end, as debug has shown, and as you will see in the code below. The jQuery does state a callback which i had initially commented out (due to errors being caused). I have since reassigned it as advised, with a small edit in it to call the btnSubmit control and thus its onclick Event. Im not sure on a resolution to this having tried the only advised suggestion fail. The result of which posts back the message which should appear if no value/star was selected ("You have not selected a rating!"). If I can somehow transfer the jQuery to the ASp:RadioList I would do so, as I think this would be better in terms of calling and processing the data. Being new to it, I have no idea. In addition, apologies if my coding appears scrappy or poor
C#:
Csharp Code:
protected void btnSubmit_Click(object sender, EventArgs e)
{
RatingSys rate = RatingSys.Get(1);
int RateID = Convert.ToInt32(hdnRateID.Value);
int CurrentRating = rate.Rating.Value;
int RadioValue = 0;
int NewRating = 0;
int NumberOfVotes = 0;
if (!radio1.Checked || !radio2.Checked || !radio3.Checked || !radio4.Checked || !radio5.Checked)
{
lblMessage.Text = "You have not selected a rating!";
return;
}...................
View 1 Replies
Similar Messages:
Feb 20, 2011
I have a rating control that shows the average rating of a user supplied posting (think of a forum post that others will rate). So if the average rating for that posting is lets say 3 out of 5 all users will see 3 stars. If someone wants to rate the posting, then they could click lets say 4 stars and I save the rating to the database, re-average the current rating and display the result (which may or may not still be 3 at this point). So far so good. The problem comes in when a user wants to agree that it's 3 stars. Since the rating control currently shows 3 stars, choosing 3 again does not cause a postback. In my case even though the value didnt technically change, I need to capture the users choice so I can average it in and save that users rating. I also modify the UI so that I can show each user of the site what he/she choose as a rating.How can i get the control to let me know that a user choose a star rating even if its the same one the control is currently displaying?
View 3 Replies
Dec 3, 2010
i need to create a rating mechanism for a website just like the one in here (asp.net forums) but i don't know how it's working and it's a little confusing since i saw someone with 105 posts is rated 35 point while another person with 35 posts has the samerate
View 1 Replies
Aug 11, 2010
Amazon has a star rating system. Other sites use smiley faces that change color when you mouse over them. Does anyone know of an API I can get or a simple way to put this together?
This is an ASP.NET 2010 app.
View 5 Replies
Mar 1, 2011
I have a Gridview with a templated column that gets a True/False value from the SQL Datasource. The value displays as a string in a label in the template. I added a RadioButtonList and in the RowDataBinding event put in some logic to set the appropriate radio button based on the text value of the Label.
Now I want to be able to interrogate the RBL upon update and set the Label text accordingly. I tried the Row_Updating event but that doesn't have a handle on the row itself and the RBL is not in the NewValues or OldValues collection since it's not one of the bound fields. I tried the RBL_SelectedIndexChanged event but I can't get the current row (got a handle on the Gridview but Gridview.SelectRow and Gridview.SelectedDataKey are both null).
how to interrogate the RBL and set the Label so the correct value is passed back to the datasource for update?
View 2 Replies
Apr 3, 2011
I am not sure what the event is called but I'm trying to get it so if your not logged in you can't manually type the page name in the bar at the top. I need to find a way so it will always redirect you to the login page if you haven't signed in.
Also the same goes for sessions, at the moment when my session time runs out my website fails as there is alot linked to sessions from my database, how do I get it so when a session expires upon trying to navigate inside the website you are passed back to the login page?
View 2 Replies
May 2, 2010
Calling Index view is giving me this very very annoying error . Can anybody tell me what to do about it
Error:The model item passed into the dictionary is of type 'System.Collections.Generic.List1[MvcApplication13.Models.Groups]', but this dictionary requires a model item of type 'MvcApplication13.Helpers.PaginatedList1[MvcApplication13.Models.Groups]'.
public ActionResult Index(int? page)
{
const int pageSize = 10; [code].....
View 1 Replies
Jan 29, 2011
I am now doing a project mobile musical website. I have used Ajax Toolkit in my last project and so that I know how to install it and work with it...
I have used CalenderExtender, TextboxWatermark, Password Strength, etc. But I am not familiar with the rating control. How does it work ?
View 1 Replies
Aug 18, 2015
Article [URL] .....
Above article show rating only integer part .
How can i show decimal rating on ajax rating control not any labels?
View 1 Replies
Feb 7, 2014
I want to create a 5 star rating in which 5 stars will show. On mouse over, the color of star will change and it will show Bad, Average, Good, Very Good and Excellent. Near stars currently rated and number of raters will show. On mouse over, "currently rated" and "number of raters" will change into "Rate Now!". If you are rating first time then number of raters is increased by 1 and currently rated is calculated by Adding total ratings of raters divided by number of raters. After your rating the result is shown instantly. If you have already rated then in javascript the message will show that you have already rated this article. For checking that you have rated this article, there will be no login page. we can use cookies or other method to check that this user has alraedy rated this article or not. I want to create this 5 Star rating system using jQuery, ASP.Net, C# and SQL Server.How i will create this,
View 1 Replies
Mar 19, 2010
I am trying to convert 22 rating control currentrating values to a double instead of int
I am also displaying in a label control so it is converted to String here is what I have
[Code]....
My display label displays
Rating is x stars out of 5.0 stars
I also record the results in a decimal 1.1 form
I did Convert.ToDouble(rate1.CurrentRating) + Convert.ToDouble(rate2.CurrentRating) .....
but I get a 7 digit after 0 return, how do i round that to a single point?
View 1 Replies
Oct 11, 2013
I am using AJAX Rating Control.I want half star rating.For Example,If My AVG Rating Count is 3 Then My Stars Wants to be show 3If My AVG Rating Count is 2.5 Then My Stars Wants to be Show 2 1/2 mark i.e., two & half stars.But,it was not showing then also it is showing 3 stars.
View 1 Replies
Mar 7, 2011
I want to implement a rating system for my application to rate events.I've been searching and I think this is the list that I need to do to achieve the rating system and I'll also attach what I found about each point.Find a JQuery plugin :
JRating, Opineo, RateItFind a suitable algorithm: I've searched a lot but didn't find a good algorithm till nowDetermine the database structure that I'm going to use
The c# code and the JavaScript code required to implement the plugin and send the poll results to the databaseI think that's it!
View 1 Replies
Aug 30, 2010
There is a similar instance of this @ http://forums.asp.net/p/1380776/2919093.aspx#2919093 However I haven't had a response, maybe due to the age of the topic, but the problem is different in the sense I am not using AJAX Rating Control, I am using radio buttons contained in a Div named Ratings, which is picked up by jQuery to style to radio buttons accordingly.The output is that it will put the stars on the first record but anything after just shows origionalunstyled radio buttons.Just thinking off the top of my head, but does anything need to be put in the ItemDataBound event?The jQuery for the stars etc were attained from the link below:http://orkans-tmp.22web.net/star_rating/index.html#demos=&main-menu=0&demo-tabs=3Here is my code:.ASPX:
[Code]....
[Code]....
View 2 Replies
Feb 5, 2014
How to create 5 Star rating using jQuery and SqlServer.
View 1 Replies
Sep 10, 2010
code is like -
[Code]....
so in this line i am passing "ss".but in my controller i didnot get the value in a parameter variable, instead i am getting ss as parameter, not the selected ids.how can i do that.
View 2 Replies
Jan 31, 2011
If I use jQuery AJAX to call a specific ASP.NET page method how to have that method return a value back to the AJAX method that called it?
Update
My situation is I have an existing web application with many existing methods. I would like to be able to use jQuery to execute some of these methods and then update the UI with the results. My mandate is to stay away from ASP.NET AJAX and stick with jQuery. Management is concerned about continued development and support with ASP.NET AJAX from Microsoft. I agree with them.
View 3 Replies
May 26, 2010
Cascading html select server control, jQuery does not retain value on post back
View 4 Replies
Feb 25, 2011
I have a keyboard-controlled menu which I did with jquery (When I press down, it marks second option and so on...)
But after I select the option I need, I want to click enter to call the button's OnClick method as if the user really clicked it. Which means I have to do a postback.
how do I do that?
View 3 Replies
Jan 5, 2011
I have the following J query which is linked to a texbox - when the user selects the textbox a calendar control appears.After selecting a date I would like it to Auto post back.Currently when I select a date it does nothing.but i need to do a auto post back.is there anyway of doing this ??
[code]...
View 2 Replies
Jan 20, 2011
I was very kindly given some code to do drag and drop which works well. I'm now having a problem posting the data back on a button click event. To recap the JQuery looks like this:
[Code]...
View 16 Replies
May 21, 2010
I have a asp.net app that I want to disable the buttons as soon as they are clicked in order to prevent multiple submissions. I'd like to use jquery for this as the site already liberally uses it anyway.
What I've tried is:
[code]....
View 5 Replies
Oct 7, 2010
I accept both C# and VB.NET
If you visit this [URL] and then click on the link like the image below you'll see in-line pop-up DIV which displays a busy status of Ajax callback before it displays the information. So, the information is not there yet until you click on the link.
I'd like to do the same but ASP.NET and jQuery.
View 2 Replies
Aug 26, 2010
my web app uses lots of asp:textboxes and I can save this data back to SQL Server easily using a stored procedure.. however my JQuery datepicker uses an input textbox, how do I save the date entered into this control. <input id="datepicker"type="text" /> back to server and can I use the same stored procedure that I use for the other data?
View 2 Replies
Sep 15, 2010
I am using jQuery tabs and an ASP.NET listview to display and edit some information. My problem is that when a user inserts a new record in one of the listview items my jQuery tabs go back to the first tab. Is there a way to keep track of which tab I am on or keep it from resting on post back?
View 3 Replies