Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Form action method not forming #35

Closed
dev-vkagrawal opened this issue Jan 2, 2022 · 14 comments
Closed

Form action method not forming #35

dev-vkagrawal opened this issue Jan 2, 2022 · 14 comments
Labels

Comments

@dev-vkagrawal
Copy link

dev-vkagrawal commented Jan 2, 2022

When we use regular <form> attribute with asp-controller and asp-action html tag helpers then final output does not contain action property of form, instead it contains blank action value on specified <form> like <form action="" method="post">... </form>
Any solution please?

@soundaranbu
Copy link
Owner

soundaranbu commented Jan 3, 2022

Hi @dev-vkagrawal, are you rendering the .cshtml file from console app or mvc?

@dev-vkagrawal
Copy link
Author

Hi @soundaranbu it is from mvc application. From controllers' action method I want to return view's string content along with some other couple of data.
Everything seems returning properly except the form action value when used with asp-controller and asp-action.

@soundaranbu
Copy link
Owner

Ok I'll look into it this weekend. Between what version of dotnet and the library are you using?

@dev-vkagrawal
Copy link
Author

dev-vkagrawal commented Jan 7, 2022

I am using .Net Core 3.1 and nuget package version of library is 1.6.0

@soundaranbu soundaranbu added the bug Something isn't working label Jan 9, 2022
@dev-vkagrawal
Copy link
Author

Thanks @soundaranbu can you please tell me which version of nuget package with a fix would be compatible with .Net core 3.1 ?

@soundaranbu
Copy link
Owner

Hi @dev-vkagrawal , Currently the fix is in testing phase. I'll release a preview version in one or two days. I'll let you know by then. Thanks

@soundaranbu
Copy link
Owner

Hi @dev-vkagrawal, I've made a pre-release v1.6.1-rc.1. please it try out and let me know https://www.nuget.org/packages/Razor.Templating.Core/1.6.1-rc.1

Thanks.

@dev-vkagrawal
Copy link
Author

dev-vkagrawal commented Jan 25, 2022

Hi @soundaranbu it does not seem working with either version. Still action property of < form > is blank.

@soundaranbu
Copy link
Owner

Ok that's weird. if possible, please send a sample project to reproduce the issue. otherwise, it'll be hard to look into this further. thanks!

@dev-vkagrawal
Copy link
Author

dev-vkagrawal commented Jan 29, 2022

It is simple .net core mvc project and I have regular view with form element and action property on it. When trying to get html of such view then just action property is blank in resultant view string.

@soundaranbu
Copy link
Owner

Ok then you might need to take a look at this sample mvc project which renders the form action method properly and let me know how it works for you.

Checkout branch: release/1.6.x
https://github.com/soundaranbu/RazorTemplating/tree/release/1.6.x/examples/Mvc/ExampleWebApp.NetCore3_1

Look for this action method: https://github.com/soundaranbu/RazorTemplating/blob/1ff2c21c0ee4b9bd218f4b6f0cca93898dee6264/examples/Mvc/ExampleWebApp.NetCore3_1/Controllers/HomeController.cs#L66-L70

Output Url: /Home/TagHelpers

Template:
image

Output:
image

@dev-vkagrawal
Copy link
Author

Hi, I cloned project but solution explorer shows just .Net 6 project, while I am trying to see .Net Core 3.1 project to test. Can you please tell me what else I need to change to make it work with .net core 3.1?
Please see attached image.
image

@soundaranbu
Copy link
Owner

soundaranbu commented Feb 9, 2022

Hi @dev-vkagrawal, it looks like you are in master branch. Please checkout release/1.6.x branch where you can find the project.

@soundaranbu
Copy link
Owner

Closing this one as I have shown the output with screenshots #35 (comment)

In case, if you still have issues, feel free to reopen. Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants