Forgot your password?
Sign in with
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Python questions
View Java questions
All Message Boards...
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Design and Architecture
Internet of Things
C / C++ / MFC
ATL / WTL / STL
Objective-C and Swift
Hardware & Devices
Hosting and Servers
.NET (Core and Framework)
Site Bugs / Suggestions
Spam and Abuse Watch
The Insider Newsletter
The Daily Build Newsletter
Most Valuable Professionals
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
What is 'CodeProject'?
Ask a Question
Bugs and Suggestions
Article Help Forum
Comments by vini vasundharan (Top 19 by date)
How do i post the values from my View to the Create post action method? I display all the Option values in my View and the user selects the required Option Values. How do I access all these values in the post and save it into the database. I suppose these values should be saved in the Config_OptionVal table
I have not tried TVP. I am afraid i haven't even heard of it before. I am a basic level programmer.
i have also created a list of objects of ViewModel class and passed it to the View
I am unable to make the View as a code. it truncates half of my code when I use the <pre> tag
And thanks a lot for your time.
Hello John. Sorry for such a delayed response. i could achieve it without using a ViewModel. May not be the best practice, but i could make it work. And i missed to convert the var set to list or Ienumerable i guess. and that prevented it from working
But finally without use of ViewModel i could do it. using ViewModel was making the model class redundant. I was getting messed up with all the One to many relationships.
I am using remote Json validation. Server side validation.
Thanks for your reply. I also added a if else statement to get it working because i else i got the same reply like i had before.
I am not sure if the If else approach is a right way of doing. Posting what I got
i have already checked if count has the right value. It has the right value. The code doesnt display the results as required. the logic in the HTML block is wrong but it is right to generate a table with rowspan
I am having remote validation that is not working for. the normal required attribute is working. ihave also checked with validation in the controller and that is laso working fine
I have tried a lot to make the model more simpler. But i think when i tried making it simple it got more complex. making it even difficult make a delete function work. I will try the join.
I already tried join once for another class and it never worked out. i am not really well versed in using joins. But i will try.
It will select all the elements in TcSet, but i only want the elements where a particular condition is satisfied
i have already added all the model classes that are referred in the context.
So as you can see in my model classes, I have Option(each with a TechnicalCharacteristic) with many OptionValues.
Each OptionValue contains a collection of SetValue which holds the value for one property of TcSet associated with a TechnicalCharacteristic.
SideNote : TechnicalCharacteristic is a collection of TcSet.
A real example could be the following with sample data.
Technical Characterstic : WheelCup
TcSet for WheelCup(for simplicity only the TCSet Name is mentioned) : Diameter, material, Durability
Option : Wheel (Foreign Key : WheelCup)
OptionValues for Wheel : 01,02,03
What I want to achieve
for Option Value 01, I need to insert values for TcSet with foreign key WheelCup
So i have SetValue
SetValue for OptionValue 01
Material : Plastic
SetValue for OptionValue 02
Diameter : 9
Material : Steel
Durability : long
I want to list in a dropdown only the TcsetName where the TechnicalCharacteristic matches with the Option.
Hope I could make it clear.
What exactly are you confused about? If you could give a bit more detail.
you seems to be so much irked..
Yes. I removed the Scripts in my View and it worked. But i could not get my Json validation working.
@krunalRohit : I want to pass the value from my view to the controller to achieve the task of creating a new record. I am unable to pass values from view to action method in another controller. I have created a viewmodel to access the the variables from both my classes
in my view can i the code that is place in my create to add a new row? but it doesnt match with the data types of the model.
Last Updated 1 Jan 1900
All Rights Reserved.