Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>STEP 1. There should be a "SubmitRating" button</p> <p>STEP 2. Create a OnSubmitRatingHandling...pseudo code below:</p> <pre><code>private void OnSubmitRatingHandler(...) { IDictionary&lt;int, int&gt; Ratings = new Dictionary&lt;int,int&gt;(); for(int i = 0; GridViewDoctor.Rows.Count; i++) { Label lblDocId = GridViewDoctor.Rows[i].FindControl("lblDoctorId") as Label; sTmp = lblDocId.Text; DocId = Int32.Parse(sTmp); RadioButton rdr1 = GridViewDoctor.Rows[i].FindControl("RadioButton1") as RadioButton; ... same for rdr2/3/4/5 if(rdr1.Checked) { Rating=1; } else if(rdr2.Checked) { Rating=2; } ... Ratings.Add(DocId, Rating} } return; } </code></pre> <p>STEP 3. I don't know why you want save Ratings in Session but not in a disk file or database somewhere? but if this is what you want, then:</p> <p>Session.Add("DoctorRatings", Ratings);</p> <p>But, if you want to persists the information, try add to session a class which include user IP address (Since no login) + rating in session or application variables - such as "UserRating" below</p> <pre><code>public class UserRating { public string UserIP = null; public IDictionary&lt;int, int&gt; Ratings = null; } private void OnSubmitRatingHandler(...) { ... other stuff... string clientIp = (Request.ServerVariables["HTTP_X_FORWARDED_FOR"] ?? Request.ServerVariables["REMOTE_ADDR"]).Split(',')[0].Trim(); UserRating UserRating = new UserRating(); UserRating.UserIP = clientIP; UserRating.Ratings = Ratings; Session.Add("UserRatings", UserRating); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload