2
Answers

Unable to cast object of type 'System.Web.UI.WebControls.HiddenField'

Ramco Ramco

Ramco Ramco

2y
702
1

Hi

  In below line i am getting error

List Result = bALSessionRatingParameter.GetSessionRatingParameter(Convert.ToInt32(hf));

protected void lnkSelect_Click(object sender, EventArgs e)
{
    var repeaterItem = ((Control)sender).NamingContainer;
    HiddenField hf = (HiddenField)repeaterItem.FindControl("hdfId");
    BALSessionRatingParameter bALSessionRatingParameter = new BALSessionRatingParameter();
    List<SessionRatingParameter> Result = bALSessionRatingParameter.GetSessionRatingParameter(Convert.ToInt32(hf));
    rptRating.DataSource = Result;
    rptRating.DataBind();
}

Thanks

Answers (2)