Click here to Skip to main content
15,878,945 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Question regarding asp.net web forms Pin
Member 1324809013-Jun-17 1:13
Member 1324809013-Jun-17 1:13 
QuestionObjectDataSource Pin
pollilop7-Jun-17 5:10
pollilop7-Jun-17 5:10 
AnswerRe: ObjectDataSource Pin
Richard Deeming7-Jun-17 6:12
mveRichard Deeming7-Jun-17 6:12 
GeneralRe: ObjectDataSource Pin
pollilop11-Jun-17 22:35
pollilop11-Jun-17 22:35 
SuggestionRe: ObjectDataSource Pin
Yoqueuris13-Jun-17 5:04
Yoqueuris13-Jun-17 5:04 
Questioni have writen c# code to render google map from server side at runtime. but when i execute this code, map is not getting displayed on browser. can any one please tell me what is a error or what changes i need to do. Pin
Member 107737173-Jun-17 20:32
Member 107737173-Jun-17 20:32 
AnswerRe: i have writen c# code to render google map from server side at runtime. but when i execute this code, map is not getting displayed on browser. can any one please tell me what is a error or what changes i need to do. Pin
Richard Deeming5-Jun-17 8:37
mveRichard Deeming5-Jun-17 8:37 
QuestionUsing Base Model in Shared View Pin
Farhad Eft2-Jun-17 23:16
Farhad Eft2-Jun-17 23:16 
Hi,

I would like to have a Base Model and use it in my _Shared view. I followed some examples online and did the following but I was unable to make it work:

_Layout view:

@model Portal.Models.BaseViewModel

Hi, @Model.FirstName


Base Model:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Portal.Models
{
    public class BaseViewModel
    {
        public String FirstName { get; set; }
    }
}


Base Controller:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Portal.Models;

namespace Portal.Controllers
{
    public class BaseController : Controller
    {
        public BaseController()
        {
            BaseViewModel baseModel = new BaseViewModel()
            {
                FirstName = "John"
            };
        }
    }
}


Dashboard Controller:

public class DashboardController : BaseController


When I run the application, I get the following error for @Model.FirstName:
System.NullReferenceException: 'Object reference not set to an instance of an object.'


Am I missing something?

Thank you for your time and consideration.
AnswerRe: Using Base Model in Shared View Pin
User 41802543-Jun-17 3:40
User 41802543-Jun-17 3:40 
GeneralRe: Using Base Model in Shared View Pin
Farhad Eft3-Jun-17 5:39
Farhad Eft3-Jun-17 5:39 
QuestionHow codeproject registration page showing client timezone as selected in dropdown Pin
Mou_kol2-Jun-17 0:07
Mou_kol2-Jun-17 0:07 
AnswerRe: How codeproject registration page showing client timezone as selected in dropdown Pin
Richard Deeming2-Jun-17 1:14
mveRichard Deeming2-Jun-17 1:14 
GeneralRe: How codeproject registration page showing client timezone as selected in dropdown Pin
Mou_kol2-Jun-17 2:29
Mou_kol2-Jun-17 2:29 
QuestionNeed some help in binding DataTable that's returning from Web Api with an Html table using jquery Pin
indian14330-May-17 8:08
indian14330-May-17 8:08 
Questiontrouble sending message to the view from controller Pin
Hamiltonian1327-May-17 22:40
Hamiltonian1327-May-17 22:40 
AnswerRe: trouble sending message to the view from controller Pin
F-ES Sitecore29-May-17 22:47
professionalF-ES Sitecore29-May-17 22:47 
GeneralRe: trouble sending message to the view from controller Pin
Hamiltonian1330-May-17 7:23
Hamiltonian1330-May-17 7:23 
GeneralRe: trouble sending message to the view from controller Pin
F-ES Sitecore30-May-17 22:13
professionalF-ES Sitecore30-May-17 22:13 
AnswerRe: trouble sending message to the view from controller Pin
John C Rayan31-May-17 1:56
professionalJohn C Rayan31-May-17 1:56 
GeneralRe: trouble sending message to the view from controller Pin
Hamiltonian1331-May-17 9:16
Hamiltonian1331-May-17 9:16 
GeneralRe: trouble sending message to the view from controller Pin
John C Rayan31-May-17 22:17
professionalJohn C Rayan31-May-17 22:17 
GeneralRe: trouble sending message to the view from controller Pin
F-ES Sitecore1-Jun-17 0:41
professionalF-ES Sitecore1-Jun-17 0:41 
GeneralRe: trouble sending message to the view from controller Pin
John C Rayan1-Jun-17 22:05
professionalJohn C Rayan1-Jun-17 22:05 
GeneralRe: trouble sending message to the view from controller Pin
Hamiltonian139-Jun-17 6:28
Hamiltonian139-Jun-17 6:28 
GeneralRe: trouble sending message to the view from controller Pin
John C Rayan16-Jun-17 2:48
professionalJohn C Rayan16-Jun-17 2:48 

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.