Click here to Skip to main content
15,906,625 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I am doing the ASP.net MVC 3 (Empty type and not the internet type) with the Database First approach...

What i need is

Step 1:
I just used the dropdown to display the various locations where the company is located. The list comes from the Organization table and Location is only one string field in this Oranization Table,


Step 2:
While the user is doing registration, the dropdown list will show the locations.. Now, user selects India, then this value (Location Name) should store in the UserLogin Table...

Now how to read the value from the dropdown and i hope you understand my question and thanks in advance
Posted
Updated 11-May-12 19:41pm
v2
Comments
Sandeep Mewara 12-May-12 3:44am    
Multiple reposts! Did you tried anything?
P_A_1 12-May-12 5:23am    
Hi
It is simple and clear that,

see once here,

Obj.OLocation = // code to get the data from the dropdown list

so that we can store this to db with help of above previous cod...

I hope u understand it

Hi sandeep

see code here once


// My Code
public void addUser(User_Details_Class UDCObj)
{

// Creating Object to Store data and assingning Data

WM_DB.User_Details UDObj = new User_Details();

// Assinging
UDObj.UId = UDCObj.UId;
UDObj.UName = UDCObj.UName;
UDObj.UPassword = UDCObj.UPassword;
UDObj.ULocation = // you write your code here to catch the data which is selected from drop down


// Here it is clear that i am assigning values one by one like id,password and
// here i am failed to read the value form dropdown.

// If we catch then surely we can add it into user table by combing my code and your code...

// I hope u understand my code

//Saving Data
dbcontext.User_Details.AddObject(UDObj);
dbcontext.SaveChanges();


}
C#

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900