I've been working on a photography page for a while now. Now I've tried to create a page on which user will upload photos to database.
I wanted to give the user an option of selecting photo categories on the create/upload page using checkboxes. I wanted to use a viewmodel with list of categoryview models which would represent the checkboxes.
Now the tricky part that i need some help with is how do I allow user to dynamically add new categories (if he needs to) on the same page. So how would i add new values into the list of categories on view.
Only thing that comes to my mind is to create an ajax post that would call a method that would create the new category in the database. Then i could append a new checkbox representing that category, But then i do not know how i would send that category in the list of categories in viewmodel without refreshing current page. Is this even possible?
If any1 has any ideas how to start on this I would be grateful.
Related
I am using Blazor, I have a page shows a list of products I scroll down to s specific product and click it and go to product details, but when the user return back by browser back the product list page is re rendered and so the user see the product list from the first Item and loose where he was, and also it refreshes the list so it me need some time to render, is there any way to prevent this and make it normal back Navigation
I would look into the lifecycle methods that you have to the page. What is probably happening is every time you navigate to a product list page (a component) it loads the product list for the first time. Then when you click on the product list, you navigate to another page.
To get the experience you want you'll want to somehow save the scroll position of on the Product List page. OR you could just use a modal to surface the product Or another way to show the Product Details without navigating out of the Product List page.
I have a customer search view that allows the user to enter various criteria, like name, address, and phone number, and the controller will lookup all of the matching customers and return another view with the list. The list has a button for each row and when selected should perform various functions. There are a few places where I'd like to reuse this same search feature, mainly when you first launch the app and secondly when you want to add another customer to the current customer's household that you're currently viewing.
How can I make the search view flexible enough that when you:
Launch the app, search, and select a customer it brings you to another view with information about this specific customer that was selected
When you want to add another customer to this customer's household, you are navigated to the search page, select a customer from the results, and the selected customer ID is passed along to the householding logic
I'm sure there's a way to do it using modals and JavaScript, but I don't think that will work for my case since there are a number of search criteria fields that would be too much to jam into a modal dialog.
I think you can reuse your View Customer Information view.
For example, in query string of this view, you add one more parameter, name ViewType i.e. then if ViewType=Add, you can render the view with searched criteria fields. Otherwise, if ViewType=View, the view will be rendered with selected customer's information. The searched criteria fields can be stored in TempData, ViewBag, or ViewData.
In case of Add new Customer to current household, if your customer contains so many fields, you can consider to pre-load all values base on selected customer's information, but editable.
Hope my thoughts are helpful.
I am currently stuck with a scenario that I need to achieve and I am hoping you would be able to help me.
The scenario I am facing is as follow:
I am displaying a list of objects with a basic summary of information. These objects are populated from c# code via a web service call that retrieves the data. For each one of these objects that are then displayed there is a select button. When this select button is clicked, another div right below the current summary div should load a partial view. This partial view must also retrieve more data via web service and display the detailed view for the current object that was selected.
I have read the article on using the ko.onDemandObservable (http://www.knockmeout.net/2011/06/lazy-loading-observable-in-knockoutjs.html) which seems to be doing what I want, but I am unsure on how to re use the same template as detail view for each summary object.
am really new to MVC, i was web form developer but i happened to get involved in a project developed using MVC.
My view looks like this, 5 textboxes to enter values (stored as a List), when added will be displayed in a grid on the same view, gird has a edit and delete button. when user clicks on edit button the list of values will appear in each textboxes for the user to edit the values.
My Model has List Values.
Please shed some insight on how to achieve this scenario.
Thank you,
I'm working on a university project and trying to learn MVC3 at the same time. I have a shopping basket style page with a table that shows the items. The model contains a list of products purchased.
I can display the products in a table via looping through the Model and displaying, however I need to implement a way to update the quantities. I currently have the quantities displayed in a HTML.TextBox which can be amended, but when I change the value it's not represented as such in the model.
Could somebody please advise how I could do this.
Thanks.
To update the model, you have post the edited values back to the server. To populate the model values in a text box, you can use the Html.EditorFor extension method and Pass in the lambda expression pointing to the quantity property. You can put the shopping cart controls within an HTML form control with an action of "post" and target of the controller route which will update the model. These are very basic operations in Asp.Net MVC, and you should be able to see how it is done in www.asp.net/MVC
Please do some research before posting your questions in the forum.