AjaxData:GridViewTemplateColumn with Ajax Rating Control error

Last post 10-07-2008 10:10 AM by Murali. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 08-21-2008 10:38 PM

    • renasis
    • Top 75 Contributor
    • Joined on 08-21-2008
    • Wannabe Slacker
    • Points 181

    AjaxData:GridViewTemplateColumn with Ajax Rating Control error

    Hello,

    By the way, great controls, just what I was looking for.  I have been using GridViewTemplateColumn with success, but when I try to use an AjaxToolkit rating control I get an error. Here is the code that is giving me the error.

    Thanks,

    -renasis

     

    <AjaxData:GridViewTemplateColumn >
    <ItemTemplate>

    <cc1:Rating
    Style="float: left; padding-left: 5px;"
    ID="rtgaveragerating"
    runat="server"
    CurrentRating='<%# Eval("averagerating") %>'
    MaxRating="5"
    RatingDirection="LeftToRightTopToBottom"
    RatingAlign="Horizontal"
    StarCssClass="ratingStar"
    WaitingStarCssClass="savedRatingStar"
    FilledStarCssClass="filledRatingStar"
    EmptyStarCssClass="emptyRatingStar" >
    </cc1:Rating>

    </ItemTemplate>
    </AjaxData:GridViewTemplateColumn>

    The error message is as follows:

    Page cannot be null. Please ensure that this operation is being performed in the context of an ASP.NET request.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.InvalidOperationException: Page cannot be null. Please ensure that this operation is being performed in the context of an ASP.NET request.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [InvalidOperationException: Page cannot be null. Please ensure that this operation is being performed in the context of an ASP.NET request.]
       System.Web.UI.ExtenderControl.get_IPage() +326508
       System.Web.UI.ExtenderControl.Render(HtmlTextWriter writer) +19
       AjaxControlToolkit.ExtenderControlBase.Render(HtmlTextWriter writer) +138
       System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
       System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134
       System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
       System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer) +10
       AjaxControlToolkit.Rating.RenderContents(HtmlTextWriter writer) +67
    

     

     

  •  Advertisement

    Outstanding performance. Full ASP.NET AJAX support. Nearly codeless development.

     
  • 08-22-2008 12:19 AM In reply to

    • xxxd
    • Top 10 Contributor
    • Joined on 12-18-2006
    • Wannabe Slacker
    • Points 15,067

    Re: AjaxData:GridViewTemplateColumn with Ajax Rating Control error

    ADC control is AJAX enabled script control. Most of rendering work is done on the client JavaScript side. As such, it is totally impossible for it to recognize and render server side controls. The GridViewTemplateColumn accepts only an itemTemplate of html code / DOM controls. I am sorry the rating control cannot fit in. However, what do you want to accomplish? Maybe we can work around it.

  • 08-22-2008 11:09 AM In reply to

    • sonu
    • Top 10 Contributor
    • Joined on 05-22-2006
    • Montreal / Canada
    • Slacker
    • Points 9,810
    • MVP

    Re: AjaxData:GridViewTemplateColumn with Ajax Rating Control error

    Take a look at the /ACT folder in project samples to see how ACT controls such as the rating control can be added into the ADC.

    [MVP since 2005] [MCAD]
    Webmaster of DotNetSlackers
    Question or Suggestion?
    Feel free to ask my any .NET question
    Our Posting FAQ
  • 10-07-2008 10:10 AM In reply to

    • Murali
    • Top 500 Contributor
    • Joined on 10-07-2008
    • Wannabe Slacker
    • Points 20

    Re: AjaxData:GridViewTemplateColumn with Ajax Rating Control error

    Hi,

     

            Please add this line for top of the page tag(Page Language="C#")

            ValidateRequest="false" EnableEventValidation="false"

     

Page 1 of 1 (4 items)