.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

error rendering control

Posted By:      Posted Date: September 21, 2010    Points: 0   Category :ASP.Net

Hi, I am working with VS 2008, I created a usercontrol to select dates, when I put It into my web pages inside an UpdatePanel and all seem to be ok, but suddenly I got the Error Rendering Control, I don´t understand it?  

View Complete Post

More Related Resource Links

Object Reference Error While Rendering Menu Control


I am having a problem with rendering a menu control inside a server control. I am getting an error in the RenderContents override method when I try to render the Menu Control. The error I am getting is an Object Reference error. The code is below...

[ToolboxData("<{0}:Login runat=server></{0}:Login>")]
    public class Login : CompositeControl
        #region Members

        Label tst;
        Menu loginMenu;
        MenuItem mainLoginItem;
        MenuItem loginItem;
        MenuItem usernameItem;
        MenuItem passwordItem;
        SubMenuStyle subMnuStyleControl;
        SubMenuStyle subMnuStyleMenu;

        bool isLoggedIn = false;


        #region Properties

        public bool IsLoggedIn
            get { return isLoggedIn; }

            set { isLoggedIn = value; }


        #region Overridden Events

        protected override void RenderContents(HtmlTextWriter writer)



        protected override void OnInit(EventArgs e)

            #region Add CSS references
            string cssUrl = Page.ClientScript.GetWebResourceUrl(this.Ge

Error rendering control


Hi there,


VS2010, XP


I am getting an error message "An unhandled exception has occurred. Object reference not set to an instance of an object." in

Design mode for my new server control which I write for testing and learning purposes.

If I run the page the control does what it expected to.

Any idea ?

Custom Control Design-Time SiteMap Provider Error


Greetings - I was referred here by MSDN forums hope this is the right place -  

I have a custom control (:WebControl) that renders web.sitemap in a specific way. While it runs error free and produces the expected result, at Design-Time it complains

Error Creating Control - MyControl  The provider 'AspNetXmlSiteMapProvider' specified for the defaultProvider does not exist in the providers collection.

I have discovered that the error is cause by this line of code:

string div = string.Format("<div class='{0}' id='{1}'>{2}</div>", this.CssClass, this.ID.ToString(), EnumerateNodesRecursive(SiteMap.RootNode, level));

or more specifically, by the reference to SiteMap.RootNode - I am not clear what is missing thoough because I have configured the SiteMapProvider in web.config as this:

        <add name="AspNetXmlSiteMapProvider" 
             type="System.Web.XmlSiteMapProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 

"Type ASP.x is not defined" error for dynamic user control when publishing updateable


I have a user control (ContainerCtrl) which programmatically instantiates another user control (SimpleCtrl) in OnLoad. It builds and runs fine, but when I publish it I get the error "error BC30002: Type 'ASP.SimpleCtrl' is not defined." (If I publish without the "updateable" option there's no error, but I need the site to be updateable.)

I assume this has to do with the particulars of how the assembly(ies) are built for the different compiler options. My question is, how can I get it to work properly for "updateable" publishing?

VS 2008 / .NET 3.5 sp1

The code follows (web.config is the default from Visual Studio).

Many thanks, Dave


<%@ Control Language="VB" ClassName="SimpleCtrl" CodeFile="SimpleCtrl.ascx.vb" Inherits="_SimpleCtrl" %>

    Simple control


Partial Class _SimpleCtrl
    Inherits UserControl

    'Nothing to see here.

End Class


<%@ Control Language="VB" CodeFile="ContainerCtrl.ascx.vb" Inherits="_ContainerCtrl"

Custom Control Design view error



I have created a custom control from scratch and it works fine as in you can build the project that uses it and it works fine at runtime. Problem is when you go to design view the control shows an error in the place of where the control should be rendered.

Error: '<SomeValue>' Could not be set to '<SomeProperty>'

This shows up on all my custom set properties. These properties are created as basic as possible. I can give the properties values in Source view and run the app just fine. I can even add a Onclick event. If I don't set any custom properties the control will render fine in Design view. It's only when I set a value to a custom property.

Property Code Example:

public string Text
                string ret = "";
                object obj = ViewState["Text"];
                if (obj != null)
                    ret = obj.ToString();
                return ret;
                ViewState["Text"] = value;

I've even removed the Category and Description tags with no difference.

I don't know if what I said makes sens, but I hope it

Rendering User Control content


I have a scenario where, the content is:
 ASP.NET Controls
      User Control
 ASP.NET Controls

The entire div code is rendered and is sent at a mail using the code:

Dim sw As New StringWriter()
Dim w As New HtmlTextWriter(sw)
Dim s As String = sw.GetStringBuilder().ToString()

This works fine except that the User Control does not get rendered.

Any way out, so that the User Control content is also rendered ?

RDL Rendering (500 Internal Server) Error at Sharepoint Integrated Reporting Service


I have a serious problem that cannot be solved by googling around the keywords below:
sharepoint, moss 2007, reporting service, ssrs 2008, rendering, internal server error, ....

The error is;

"An error occurred during client rendering. The remote server returned an error: (500) Internal Server Error. "

Everything is O.K.;

* When I render the report from the REPORTSERVER (http://localhost/ReportServer)
* When the reports are scheduled to be sent by the reporting service (planned via MOSS 2007) 

But if I open (render) the RDL file from the sharepoint REPORTS LIBRARY interface, all of the reports fail with that internal error message above. 

It is weird also that parametrized reports are displayed without errors although the parameters are queried from a sql dataset. But I got the error when rendering the report after I've chosen a parameter  and order "apply/report"...

Possible causes how I met that error may be;

After I have installed (then uninstalled) AJAX extensions
After I have re-configured IIS Web Service Extensions list items

Possible solution alternatives I've found;

I've found a solution on MSDN replying a similar issue with an ideal cause of the error but an evreka answer but no sol

Menu control rendering issue with IE8



Using VS2010, I created an ASP.NET 4.0 web application and simply added a couple of menu items below the "Home" menu item in the master page that's created by the project wizard. I made no other changes - no code, no stylesheet changes.

If I run the app locally then everything is fine. I suspect because the local IIS is responsive enough for the problem not to occur.

If I deploy the app to a web host (discountasp.net) then I see the menu render vertically for less than a second before it renders correctly. If I refresh the page a few times then usually I can see the menu vertical flash but sometimes I can't, so there's some sort of timing consideration.

I'm using IE8. The problem doesn't seem to occur with either Firefox 3 or Chrome.

Have others seen this problem?

Any suggestions for a fix?

I can supply the zipped up project if anyone wants it.


Using tabs from the AjaxControlToolkit causes error: ...control contains code blocks (i.e. <% ... %>


I'm getting the error:

The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

When attempting to add the tabs from the AjaxControlToolkit.  A little background..Theres an existing aspx page in a microsite which used the accordion control and the tabbed control ...I need to modify this page to use a different masterpage. 

The original site was .Net Framework 2.0 and the page in question used AjaxControlToolkit 1.0. which I manually installed originally.  Some of the site has been further developed using the .Net Framework 3.5.  (Come with AjaxControlToolkit) Now I have come to update this aspx page and I get the error above.

I have narrowed the down to the TabContainer (I think)  Does anyone have any experience with this sort of problem?  Also what version of the AjaxControlToolkit should be with the .Net Framework 3.5? I have 1.0.20229.20821. 

I also tried to browse to the AjaxControlToolkit.dll to add the tools to the tool box as they're missing... thinking this may be an indicator as to why it wasn't working. I get the error: 'There was an error loading types from assembly C:\inetpub\wwwroot\project\Bin\AjaxControlToolkit.dll Could not load file or assembly 'System.Web.Extensions. Version=

Report Viewer Control Error

Hi All, I am adding a report datasource dynamically to report view web server control and getting the following eroor when i open the page. The DataSourceID of the ReportDataSource 'DataSet1_employees' of the ReportViewer 'ReportViewer1' must be the ID of a control of type IDataSource. A control with ID 'DataSet1_employees' could not be found.     Please help me where i am going wrong. The code is given below: protected void Page_Load(object sender, EventArgs e)    {        ReportViewer1.ProcessingMode = ProcessingMode.Local;        ReportViewer1.LocalReport.ReportPath = "Report2.rdlc";         ReportDataSource rdS = new ReportDataSource("Employees", GetData());        rdS.DataSourceId = "DataSet1_employees";        //this..Add(rdS);                ReportViewer1.LocalReport.DataSources.Add(rdS);        ReportViewer1.LocalReport.DataSources["Employees"].DataSourceId = "DataSet1_employees";        ReportViewer1.LocalReport.DataSources["Employees"]

An error occurred during client rendering

Hi Guys, Can anyone help me with the error message prompting after the deployment of simple report. It works fine in VS and report builder but some reason I am getting below error message when you define parameter after the deployment. I am mean to say on http://localhost/Reports/   An error occurred during client rendering. Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index Thanks in advance, D

Getting an error using FileUpload Control on a server.

Hello FriendsI m getting a problem while executing the following code for my website.This code works perfactly on localhost but when I use d same code on my webpage on the server it does nothing...even it doesnt return any error msg.Plz help me...protected void BtnUpload_Click(object sender, EventArgs e) {        int intFileSizeLimit = 1000;               string strFileNameWithPath = FileUpload1.PostedFile.FileName;               string strExtensionName = System.IO.Path.GetExtension(strFileNameWithPath);              string strFileName = System.IO.Path.GetFileName(strFileNameWithPath);           int intFileSize = FileUpload1.PostedFile.ContentLength / 1024;                              strExtensionName = strExtensionName.ToLower();        if (strExtensionName.Equals(".doc") || strExtensionName.Equals(".txt") || strExtensionName.Equals(".docx"))        {      

Can't get ClientID of ASP control in Rendering template

Hi, I've made custom field with its own rendering template. Inside template i need to show/hide some controls, but i cant get ClientID of them. Inside rendering template : <%@ Assembly Name="XXX, Version=, Culture=neutral, PublicKeyToken=72277ea422a3515d" %> <%@ Assembly Name="Microsoft.Web.CommandUI, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %> <%@ Import Namespace="Microsoft.SharePoint" %> <%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Control Language="C#" AutoEventWireup="true&q

An error occurred during client rendering.

ERROR: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index  Dear all, I have installed SQL server 2008 Developer Edition on my Sever, the Server has Windows Server 2003, I also installed Service Pack 1 for SQL server 2008. I have created some reports in Arabic Languages, the reports has RTL property enabled with more than 1 level of grouping. when I remove RTL from our reports it works fine, when i Enable the RTL property then it fives me the above error. Please help me in this regard. Thanks

error provider control in aspx pages?

how can i add error provider control in an asp.net page using c#..  for example,if i am using a textbox control which prompts the user to fill it on clicking the submit button,how should i make the textbox control to prompt the user. someone help me with this!!! and also reply me if v can use status strip control in aspx pages

Error rendering "*************" web part: [The remote server returned an error: (400) Bad Request.]

Hi There I am implementing a WCF based solution and all was working fine until I started to process larger quantities of data. The Solution worked well in DEV where we added large quantities of daata when we restored the site to QA we got this error . Error rendering Councillors Online web part: [The remote server returned an error: (400) Bad Request.] Can anyone propose a solution to this problem? Thank you My WCF web.config looks as follows : ======================================================== <system.serviceModel>  <bindings>   <webHttpBinding>   </webHttpBinding>  </bindings>  <behaviors>   <serviceBehaviors>    <behavior name="serviceBehavior" >     <serviceMetadata httpGetEnabled="true" />    </behavior>   </serviceBehaviors>   <endpointBehaviors>    <behavior name="web">     <webHttp/>    </behavior>   </endpointBehaviors>  </behaviors>  <services>   <service name="CouncillorsOnline.Service.CouncilMasterDataService" behaviorConfiguration=

AjaxToolkit's CascadingDropDown control is throwing Method Error 404 in Hybrid system environment (

Hi Experts, We have an Asp.net web application, which is deployed in shared hosting environment. On shared hosting environment initial request to this web application is handled by Linux server and then based on the requested page the Linux server is redirecting request to web server on windows OS. Now, in our web application, we have used ajaxToolkit's CascadingDropDown control to populate three levels of categories. In the hybrid system described above, the CascadingDropDown control is throwing Method Error 404. I would appreciate if some body can guide on how to resolve this issue. The sample of code snap shot is mentioned below. ********************************************************************* Aspx file. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ <asp:DropDownList ID="ddlMajorLevelCategory" runat="server" Width="250px" ToolTip="Select Major Level Category" TabIndex="1"                            SkinID="h6BlueArial"> </asp:DropDownList>   <ajaxToolkit:CascadingDropDown ID="ccMajorCategory" runat="server" TargetControlID="ddlMajorLevelCategory" Category="M" PromptText=&qu
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend