Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I am a new developer
I want to store the form information Which is located inside the partial view to my data base.
Can this be done like a regular view with a razor? There is no need to do anything special...?
No need to do anything special zahra, just call your partial view in your razor view, by using form or ajax call, you can send the form data to mvc controller and from there you can store the data in your Database
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed last year.
Improve this question
I've got a web app for a form in which we collect a lot of information from the user from a single form, what's the best way to collect all this data without having [FromForm] type variableName 30 times in my parameter list?
If not using the action results and models that are able to transform your requests directly to a model, The MVC controller provides a list of keys vai this.Request.Form.Keys and you can loop over these keys.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I'm new in asp.net. How to pass model from Main page and work with it in my partialview. Can somone show me how to do it with examples and explanation.
You can render PartialView like this example with passing model as a parameter.
#Html.Partial("YourPartialView.cshtml", model)
In your PartialView (YourPartialView.cshtml) you should define your model for the PartialView like this
#model ClassForYourModel
From now, you can use your models attributes as follows.
#model.Attribute1
#model.Attribute2
Example
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I want to reuse partial view in multiple ASP MVC applications. Is it possible to do that?
I have some partialview.cshtml which uses MyViewViewModel.cs and lots of typescripts/javascripts.
Is it possible to reuse all this code in different application?
If so, how I use views from external assembly?
look at razor generator: https://github.com/RazorGenerator/RazorGenerator
and look for samples in the internet
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I'm new in MVC and I need to modify EditorForModel for using permissions (show/Not show, disabled/Enable, etc) in the fields from my DB, according with kind of user. Can anybody help me ?
You can create custom editors for your models by adding a EditorTemplates folder in your Views/Shared folder. More info about this process can be found here – http://blogs.msdn.com/b/nunos/archive/2010/02/08/quick-tips-about-asp-net-mvc-editor-templates.aspx
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Does ASP have a construct similar to Access's On Current event? I've inherited a set of ASP web forms coded in C# and the rules associated with the form controls kick in OK if you click one of the controls but I need them to apply when the form opens, not only on change. That they don't is allowing bad data.
I need them to apply when the form opens, not only on change.
With ASP.NET you can use the Page_Load event handler; check out the page lifecycle documentation for more details, as that may lead you to something more appropriate and would be a rather educational read on the whole.