Click here to Skip to main content
14,827,034 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Can we have only one code behind page for two aspx pages in Asp.net? Pin
DerekT-P31-Jul-18 5:52
professionalDerekT-P31-Jul-18 5:52 
GeneralRe: Can we have only one code behind page for two aspx pages in Asp.net? Pin
Member 137012511-Aug-18 0:21
MemberMember 137012511-Aug-18 0:21 
GeneralRe: Can we have only one code behind page for two aspx pages in Asp.net? Pin
DerekT-P1-Aug-18 4:38
professionalDerekT-P1-Aug-18 4:38 
Question'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' Pin
Member 35932626-Jul-18 13:25
MemberMember 35932626-Jul-18 13:25 
AnswerRe: 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' Pin
Richard Deeming27-Jul-18 0:48
mveRichard Deeming27-Jul-18 0:48 
AnswerRe: 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' Pin
jkirkerx30-Jul-18 13:23
professionaljkirkerx30-Jul-18 13:23 
Questionasp:CalendarExtender position problem Pin
harish kashyap0125-Jul-18 19:23
Memberharish kashyap0125-Jul-18 19:23 
QuestionAn exception of type 'System.ArgumentNullException' occurred in System.Web.Mvc.dll but was not handled in user code Pin
indian14325-Jul-18 14:21
Memberindian14325-Jul-18 14:21 
Hi,

I am using DropdownListFor in my MVC cshtml page, but I am getting the above error:
 @Html.DropDownListFor(model => model.PKModeOfServiceLKPId, new SelectList(Model.ModeOfServiceLKPList, "PKModeOfServiceLKPId", "Description") , new { @class = "form-control input-sm", style = "width:300px;",  @id = "idDDLForModeOfServiceCode"})
But I am getting the values in the Model as below;
        public List<MCMSSFCrosswalk> GetMCMSSFCrosswalkList()
        {
            using (BHPRVEntities pe = new BHPRVEntities())
            {

                var prov = pe.Usp_Get_MCMSSFCategoryCrosswalkList();
                return prov.Select(p => new MCMSSFCrosswalk()
                {
                    Id = p.Id,
                    Description = p.MCMSSFCrosswalkDescription,
                    MCModeOfServiceCode=p.ModeOfServiceCode,
                    FKServFuncCatMCModeOfServiceId = p.FKServFuncCatMCModeOfServiceId,
                    ModeOfServiceCode=p.ModeOfServiceCode,
                    ServiceFunctionCategoryCode=p.ServiceFunctionCategoryCode,
                    ServiceFunctionCategoryDescription=p.ServiceFunctionCategoryDescription,
                    CreatedDate = ((p.CreatedDate != null) && (!DBNull.Value.Equals(p.CreatedDate))) ? p.CreatedDate : null,
                    CreatedBy = p.CreatedBy,
                    ModifiedDate = ((p.ModifiedDate != null) && (!DBNull.Value.Equals(p.ModifiedDate))) ? p.ModifiedDate : null,
                    ModifiedBy = p.ModifiedBy,                    
                    IsValid = ((p.IsValid == null) || (DBNull.Value.Equals(p.IsValid))) ? true : p.IsValid,
                    ModeOfServiceLKPList=GetListOfModeOfServices(),
                    MCModeOfServiceLKPList = GetListOfMCModeOfServices(),
                    ServiceFunctionCategoryLKPList = GetListOfServiceFunctionCategories()
                }).ToList();
            }
        }
My Model is as below:
    public class MCMSSFCrosswalk
    {
        private List<ModeOfServiceLKP> listOfModeOfServiceLKP = new List<ModeOfServiceLKP>();
        private List<MCModeOfServiceLKP> listOfMCModeOfServiceLKP = new List<MCModeOfServiceLKP>();
        private List<ServiceFunctionCategoryLKP> listOfServiceFunctionCategoryLKP = new List<ServiceFunctionCategoryLKP>();

        public int Id { get; set; }
        public string Description { get; set; }
        public string RevenueCode { get; set; }
        public string ProcedureCode { get; set; }
        public string Modifier1 { get; set; }
        public string Modifier2 { get; set; }
        public string Modifier3 { get; set; }
        public string Modifier4 { get; set; }
        public int FKServFuncCatMCModeOfServiceId { get; set; }

        [DisplayName("ModeOfServCode")]
        public string ModeOfServiceCode { get; set; }
        public int? PKModeOfServiceLKPId { get; set; }
        [DisplayName("ModeOfServDescr")]
        public string ModeOfServiceDescription { get; set; }

        [DisplayName("ServFuncCatCode")]
        public string ServiceFunctionCategoryCode { get; set; }
        public int? PKServiceFunctionCategoryLKPId { get; set; }
        [DisplayName("ServFuncCatDesc")]
        public string ServiceFunctionCategoryDescription { get; set; }

        public string MCModeOfServiceCode { get; set; }
        public int? PKMCModeOfServiceLKPId { get; set; }
        public string MCModeOfServiceDescription { get; set; }

        public DateTime? CreatedDate { get; set; }
        public string CreatedBy { get; set; }
        public DateTime? ModifiedDate { get; set; }
        public string ModifiedBy { get; set; }
        public bool? IsValid { get; set; }

        public int? LookupTableId { get; set; }

        public List<ModeOfServiceLKP> ModeOfServiceLKPList { get { return this.listOfModeOfServiceLKP; } set { this.listOfModeOfServiceLKP = value; } }
        public List<MCModeOfServiceLKP> MCModeOfServiceLKPList { get { return this.listOfMCModeOfServiceLKP; } set { this.listOfMCModeOfServiceLKP = value; } }
        public List<ServiceFunctionCategoryLKP> ServiceFunctionCategoryLKPList { get { return this.listOfServiceFunctionCategoryLKP; } set { this.listOfServiceFunctionCategoryLKP = value; } }
    }

But the break point int the method GetMCMSSFCrosswalkList() is not even hitting just when the Page getting loaded its breaking at the @Html.DropDownListFor, PKModeOfServiceLKPId, I am not sure why is it breaking. I am little bit new to MVC, can anybody please help me, all I have to do is to load the list of these three objects in three different dropdowns and select the items of those dropdowns depending upon the Primary Keys we get.
I really need some help, any support would be very very helpful - thanks in advance.

Thanks,

Abdul Aleem

"There is already enough hatred in the world lets spread love, compassion and affection."
AnswerRe: An exception of type 'System.ArgumentNullException' occurred in System.Web.Mvc.dll but was not handled in user code Pin
Richard Deeming26-Jul-18 1:45
mveRichard Deeming26-Jul-18 1:45 
QuestionWhere should I post my Angular 6 questions? Pin
jkirkerx23-Jul-18 7:01
professionaljkirkerx23-Jul-18 7:01 
AnswerRe: Where should I post my Angular 6 questions? Pin
Vincent Maverick Durano30-Jul-18 11:53
professionalVincent Maverick Durano30-Jul-18 11:53 
GeneralRe: Where should I post my Angular 6 questions? Pin
jkirkerx30-Jul-18 13:18
professionaljkirkerx30-Jul-18 13:18 
GeneralRe: Where should I post my Angular 6 questions? Pin
Vincent Maverick Durano31-Jul-18 4:01
professionalVincent Maverick Durano31-Jul-18 4:01 
QuestionUnable to send data from view to controller in Asp.Net MVC Pin
harish kashyap0114-Jul-18 8:05
Memberharish kashyap0114-Jul-18 8:05 
AnswerRe: Unable to send data from view to controller in Asp.Net MVC Pin
Bryian Tan14-Jul-18 8:34
professionalBryian Tan14-Jul-18 8:34 
Question.Net Core 2.1 and MVC, playing around with Angular 6 Pin
jkirkerx13-Jul-18 12:21
professionaljkirkerx13-Jul-18 12:21 
AnswerRe: .Net Core 2.1 and MVC, playing around with Angular 6 Pin
Nathan Minier16-Jul-18 1:35
professionalNathan Minier16-Jul-18 1:35 
GeneralRe: .Net Core 2.1 and MVC, playing around with Angular 6 Pin
jkirkerx16-Jul-18 6:43
professionaljkirkerx16-Jul-18 6:43 
AnswerRe: .Net Core 2.1 and Angular 6, styles and fonts Pin
jkirkerx17-Jul-18 12:46
professionaljkirkerx17-Jul-18 12:46 
GeneralRe: .Net Core 2.1 and Angular 6, styles and fonts Pin
jkirkerx17-Jul-18 13:44
professionaljkirkerx17-Jul-18 13:44 
QuestionConditionally Loading Partial View in a Page using Javascript Pin
indian14313-Jul-18 8:10
Memberindian14313-Jul-18 8:10 
AnswerRe: Conditionally Loading Partial View in a Page using Javascript Pin
jkirkerx13-Jul-18 12:13
professionaljkirkerx13-Jul-18 12:13 
GeneralRe: Conditionally Loading Partial View in a Page using Javascript Pin
indian14313-Jul-18 13:40
Memberindian14313-Jul-18 13:40 
GeneralRe: Conditionally Loading Partial View in a Page using Javascript Pin
jkirkerx16-Jul-18 6:37
professionaljkirkerx16-Jul-18 6:37 
GeneralRe: Conditionally Loading Partial View in a Page using Javascript Pin
indian14318-Jul-18 8:25
Memberindian14318-Jul-18 8:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.