locked
Custom Control not Working RRS feed

  • Question

  • User-1249878189 posted

    Hi everyone,

    i am new to ASP.Net. I am maintaining the website of the company i am working in.

    I downloaded all the files and the database(SQL Server) of the website from the hosting center and built it on my system in VWD 2008. Everything is working fine except the custom controls, which are used to display news on the webpage from the database. When i run the website on my system, the content (from custom controls) is not displayed on the page.

    The Custom controls (ViewContent.cs & ViewContentDetails.cs) are placed in a folder CustomControls in the App_code folder. Both the .cs files have a namespace definition "CustomControls". In the web.config file, the following code is there:

    <pages theme="GETtheme" validateRequest="false">
                <controls>
                    <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                    <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                    <add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit" tagPrefix="ajaxToolkit"/>
                    <add tagPrefix="GETcc" namespace="CustomControls"/>
                </controls>

    </pages>

     

    In the master page, the following code is there for the content to be displayed:

     <GETcc:ViewContent ID="ViewContentNews" runat="Server" publisherCategory="News" />

     

    But i don't know why the content is not displayed when i run the website.I have tried many things but its of no use.

    So please somebody help me with this. Its very important for me.

    Thanks in advance.

    Wednesday, June 17, 2009 3:30 AM

Answers

  • User-644392667 posted

    Is it throwing an error, or are you simply not getting any news? If it is not throwing an error than it is probably loading the control fine, it just is not returning anything. You might try a quick tweak of the control to have it display dummy data (maybe just a label or text) so that you can verify that it is loading.

    It could be something as simple as that your sql query is not returning any info.

    Hope this helps,

    m

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, June 17, 2009 9:41 AM

All replies

  • User-644392667 posted

    Is it throwing an error, or are you simply not getting any news? If it is not throwing an error than it is probably loading the control fine, it just is not returning anything. You might try a quick tweak of the control to have it display dummy data (maybe just a label or text) so that you can verify that it is loading.

    It could be something as simple as that your sql query is not returning any info.

    Hope this helps,

    m

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, June 17, 2009 9:41 AM
  • User-1249878189 posted

    Well thanks buddy. I tried to print a text and it did. I also checked the queries and they were working fine but then also it was not displaying the content.

    Then I uninstalled SQL Server completely and reinstalled it. Earlier i installed it with windows authentication. Now, I set a userid & password for connecting SQL Server and modified the connection string in web.config. When i tried to run the website, it worked.[Yes]

    Thanks for ur help buddy. [;)]

    Thursday, June 18, 2009 2:45 AM