Giter Site home page Giter Site logo

Comments (12)

dpaquette avatar dpaquette commented on August 15, 2024

Where would the HtmlHelpers go? The CollidR project does not have a dependency on System.Web.Mvc. Does it make sense to add a CollidR.Mvc project for the helpers?

from collidr.

MisterJames avatar MisterJames commented on August 15, 2024

Yeah, that's good. I think that's forward thinking, too, as far as thinking other clients. Like WinForms :)

from collidr.

dpaquette avatar dpaquette commented on August 15, 2024

I left out the

<script src="~/Scripts/CollidR.js"></script> 

portion from the generated code for a few reasons:
a) the ~ part does not get resolved when it is returned from an HTML Helper
b) the script might already be included in the shared layout
c) not sure it's a good idea to assume what folder CollidR.js is located

from collidr.

MisterJames avatar MisterJames commented on August 15, 2024

So...maybe we should include that by default and have an overload that mutes the script tag? That way it works with one line of code, but if you need to control when/where it gets written you can.

from collidr.

dpaquette avatar dpaquette commented on August 15, 2024

I will see if I can get the path to resolve then. It's a trickier problem than I thought it would be.

from collidr.

MisterJames avatar MisterJames commented on August 15, 2024

Gotcha. We could keep it simple to start...the default path (from the NuGet install) is going to be as above. If they need to change it, maybe we do an overload for the path of the script?

I think at this point we don't need to resolve the path, just assume it's okay. Add the override to mute it, then they can add it manually if they like (to a layout, for example).

from collidr.

dpaquette avatar dpaquette commented on August 15, 2024

If we put src="/Scripts/CollidR.js", and the application is installed in a virtual directory in IIS (eg. http://localhost/MyApp), then the browser will not find CollidR.js. It will try to find it at http://localhost/Scripts/CollidR.js.

The ~ solves that problem normally, but not for strings that are returned from the HTML Helper

from collidr.

MisterJames avatar MisterJames commented on August 15, 2024

Gotcha. Okay...I'll leave it to you for implementation here then, either way (assuming or full resolution) is okay with me for now.

from collidr.

dpaquette avatar dpaquette commented on August 15, 2024

Okay, figured out a way to do it

from collidr.

dpaquette avatar dpaquette commented on August 15, 2024

Now that I committed the changes, I am wondering if the helper method should be renamed RegisterCollidRFor() since it is model bound. This would be consistent with the EditorFor / Editor convention in the built in MVC helpers.

from collidr.

MisterJames avatar MisterJames commented on August 15, 2024

Agreed, that's probably a good call. Just commit the update for the rename before you merge the pull request and it will be included.

from collidr.

MisterJames avatar MisterJames commented on August 15, 2024

Closed with #23

from collidr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.