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

In my project i have user type table in which i stored only 2 ids

UserType Table

Usertype id Name
3 Customer User
5 Business User
I need to set that 2 ids in the web. congif file in my MVC project . While coming in code we need to call that from web.config file. Is it possible to do

I hardcoded the value in the below code

public ActionResult Calendar(int id)

var cal = (from s
in db.tblUsers
where s.UserTypeId == 5 && s.UserID == id
select new Appt
FirstName = s.FirstName,
BusinessCategory = s.tblBusinessCategory.BusinessCategory,
BusinessName = s.tblBusinessCategory.BusinessName,
StartTime = s.WorkingHour.StartTime,
UserTypeID =5,
UserID = s.UserID
Session["BUId"] = id;
return View(cal);


in that usertype id we need the get the value from web.config
Can anyone please help me . thanks in advance

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