How to customize /C1WebMvc/WebResources?r=xxx URL

Posted by: 1728884346 on 16 September 2025, 2:51 am EST

  • Posted 16 September 2025, 2:51 am EST

    we are using below code to load style and script file, but how to customize the host or virtual path?

    because our application is deployed behind a gateway, it has customized host and virtual path to determine the traffic route.

    @Html.C1().Styles()

    @Html.C1().Scripts().Basic()

  • Posted 16 September 2025, 3:11 am EST - Updated 16 September 2025, 3:16 am EST

    here is dll version we use in our application

  • Posted 17 September 2025, 4:40 am EST

    Hello,

    To test your scenario, we created a virtual directory. (see virtualDirectory.png)

    Running the sample did not produce any issues—all network calls returned status 200, and the web resources were available at “./myapp/”. Please see the attached screenshots. (see networkTab.png and sourcesTab.png)

    Sample: https://drive.mescius.io/download?file=ExternalShare/WinForms/Sample_WebResources.zip

    Could you please update the attached sample with your implementation, and share the exact steps along with any additional details needed to reproduce the behavior so we can investigate further?

    Regards,

    Uttkarsh.

    images.zip

  • Posted 17 September 2025, 5:55 am EST

    No, I want to customize the path, not only the virtual path, for example add-in some custpath into the URL.

    host.com/myapp/custpath/resourceUrl

  • Posted 18 September 2025, 4:40 am EST - Updated 18 September 2025, 4:46 am EST

    Hello,

    We’re sorry, but we’re having trouble fully understanding your query.

    To test the scenario, we published the app we attached in previous reply and hosted it on IIS. To simulate a nested path, we created an application under the Default Web Site named “myapp” and then added a child application under “myapp” named “custpath”. Please refer to the screenshot below:

    After this setup, we were able to access the application at http://localhost/myapp/custpath

    without any issues. The resources were loading correctly and located at: myapp/custpath/C1WebMvc/. Please see the attached screenshots for reference.



    Could you please share more details on your scenario and the exact steps we can follow to reproduce the issue locally? If the information is confidential, you may also open a private ticket on our support portal: https://developer.mescius.com/my-account/my-support/newcase

    Regards,

    Uttkarsh.

  • Posted 18 September 2025, 4:53 am EST

    Sorry that I didn’t clearly explain my scenario, in my case, I’m hosting application behind an application gateway, inside the application gateway, we have different rule to control the traffic routing.

    for example,

    host/uat/app1 => app1Host

    host/dev/app2 => app2Host

    so now we want to customize our C1WebResource URL,

    we want to append /uat/app1/ when load C1WebMvc resource request.

    host/uat/app1/C1WebMvc/WebResources?r=xxx

    =>

    app1Host/C1WebMvc/WebResources?r=xxx

  • Posted 19 September 2025, 8:20 am EST

    Hello,

    If we understand correctly from your latest reply:

    You are setting up the site at your end in the same way as described here:

    https://developer.mescius.com/forums/mvc-edition/how-to-customize-c1webmvc-webresources-r-xxx-url#83508

    We would like to further confirm how you are re-routing or mapping the site at your end from:

    https://localhost/myapp/custpathhttps://mysite/

    Could you please share the exact steps you are following for this re-routing so that we can reproduce and test the same behavior on our side?

    Additionally, please confirm if you are performing this on the same server (same machine) where the application https://localhost/myapp/custpath is hosted.

    Lastly, we would recommend you create a case here (if any information is confidential):

    https://developer.mescius.com/my-account/my-support

    This portal is private, and your case will only be visible to the assigned support agent.

    Regards,

    Uttkarsh.

  • Posted 9 October 2025, 9:53 pm EST

    Hi, let me explain in more clear way what I want to achieve.

    the traffic like,

    1. user access to application-gateway url, this application gateway will host many applications, for example: https://app-gateway/app1, https://app-gateway/app2

    2. application gateway will base on path /app1, /app2 route traffic to individual backend application host, for example: https://backend-app1, https://backend-app2

    3. each application will add customize path /app1, /app2 when it does redirection (this to ensure the traffic reach to application gateway correct route rule.

    user => application-gateway host => backend application host

    now, the problem is the application is using below to load C1 resource,

    @Html.C1().Styles()

    @Html.C1().Scripts().Basic()

    it cannot add customize path, so the actual URL for load C1 resource become https://app-gateway/C1xxx

    but I want it to be https://app-gateway/app1/C1xxx or https://app-gateway/app2/C1xxx

    hope this explanation is more clear

  • Posted 10 October 2025, 7:08 am EST

    Hello,

    Thank you for your explanation, as per our understanding, you have application structure like as follows:

    http://app-gateway - main application to provide route for /app1 or /app2

    And /app1 and /app2 are also application hosted under main website http://app-gateway

    So you have basically three application:

    http://app-gateway

    http://app-gateway/app1

    http://app-gateway/app2

    So if your all of the above application using C1 controls, you should have register the C1 to all of the apps and publish to their respective location using C1 controls and registration.

    This way you will have access for individual C1xx resources and as per your comment you have added C1 controls to your gateway application.

    And trying to access from /app1 and /app2, which requires the C1 resource registration to the individual apps to if they are separate applications.

    Also, if /app1 and /app2 applications are part of main application, you would not need to register it individually for app1 or app2 like our https://demos.componentone.com/ASPNET/LearnMvcClient/

    which offline version can be get at ComponentOne Samples\ASP.NET MVC\v4.8\MVC\CS\HowTo\LearnMvcClient

    Please confirm if we understood the application structure as per your application or not.

    As per us, your structure should be like this

    /mainapp

    |-mainapp-code

    |-/app1

    |-app1 code

    |-/app2

    |-app2 code

    And you would be redirecting the apps from your main-app specific controller available for routing purpose only based on validation.

    Regards,

    Uttkarsh.

  • Posted 6 November 2025, 4:08 am EST

    No, I just want to know is there a way to customize the C1 resource render path, when application using below to load C1 resource.

    @Html.C1().Styles()

    @Html.C1().Scripts().Basic()

    I need the specific keywords in the path to meet our business requirement.

    for example, originally it renders like /C1WebMvc/WebResources?r=xxx

    I want to append keywords make it become /abc/C1WebMvc/WebResources?r=xxx

  • Posted 7 November 2025, 9:51 am EST

    Hello,

    We have shared your concerns and requirement to the development team for further insights. [Internal Tracking ID: C1WEB-30199]

    Rest assured, we’ll get back once we have more information.

    Regards,

    Uttkarsh.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels