I can't rename control in User Control (.ascx) properly

5 posts, 0 answers
  1. LamKhoa
    LamKhoa avatar
    92 posts
    Member since:
    Jun 2011

    Posted 30 Jun 2012 Link to this post

    Hi,

    I've just tried out Telerik JustCode product, the only reason that I want to use it is that it has the ability to rename/refractor the control both on the Design surface (.aspx) and in the code behind (.aspx.cs) at once. (Visual Studio can't do it like that).

    However, when I try to refractor on User Control (ascx), it does not appear to work like in aspx, for example, I tried to rename the control on Design surface (.ascx), it only rename the control on the .ascx only, but not in the code-behind .ascx.cs.

    Is it one of the limitation of Telerik JustCode or I'm just missing some setting for making it to work?

    Thanks

    Lamk.
  2. Rumen
    Admin
    Rumen avatar
    6 posts

    Posted 05 Jul 2012 Link to this post

    Hi,

    Thank you for your feedback.
    First of all let me apologize for the inconvenience this has caused you. In order to solve the problem we should identify it first. That’s why I would like to ask you what do you mean by saying “Design surface (.ascx) “? Is it the design view?
    Thank you in advance for the assistance.

    Kind regards,
    Rumen
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft banner
  4. LamKhoa
    LamKhoa avatar
    92 posts
    Member since:
    Jun 2011

    Posted 05 Jul 2012 Link to this post

    Attached, Please take a look at the screenshot of "Design Surface" and "Code-Behind".

    As you can see in first two pictures (Design-Surface.png and Code-Behind.png), I have highlighted the name of the control (rbl_Type1). When I rename it in Design, it should be renamed in Code-behind as well, that's what I want, however, it appear to work only in ASPX page only, not in ASCX User Control.

    If you want to know the different between ASPX and ASCX, then please take a look at the third pic (ASPX Page  & ASCX user control.png)

    Thanks

    Lamk.
  5. Rumen
    Admin
    Rumen avatar
    6 posts

    Posted 05 Jul 2012 Link to this post

    Hello,

    Thank you for your assistance.
    You should create an @ Control directive at the top of the page. After that specify the Inherits attribute like it is done in the example below. The Inherits attribute defines a code-behind class for the control to inherit.

    <%@ Control Inherits="WebApplication2.ReportSelector" %>

    I hope this helps you.

    Greetings,
    Rumen
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  6. LamKhoa
    LamKhoa avatar
    92 posts
    Member since:
    Jun 2011

    Posted 05 Jul 2012 Link to this post

    Thanks,

    You have correctly pointed out the error in my code. I got it working now.


    Lamk.
Back to Top
DevCraft banner