Click here to Skip to main content
15,888,301 members
Home / Discussions / ASP.NET
   

ASP.NET

 
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 
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 
Hi,

I have a Web Api Get implemented in the following way
        public object Get()
        {

            dynamic model = null;

            using (AppDevSecEntities ctx = new AppDevSecEntities())
            {
                BSCCrystalReportsViewerEntities ctx2 = new BSCCrystalReportsViewerEntities();

                string maxLanId = ctx.UserLists.OrderByDescending(x => x.LastName).First().WindowsUserName;
                var tempUserJobs = (from c in ctx.UserJobs orderby c.SupervisorUserName select c).Where(x => x.WindowsUserName == maxLanId);
                DataTable UserJobs = Common.ConvertToDataTable<UserJob>(tempUserJobs);

                model =
                    new
                    {
                        SingleEmployee = ctx.spGetShortSingleEmployee(maxLanId).FirstOrDefault(),
                        Departments = (from c in ctx.Departments orderby c.DepartmentName select c).ToList<Department>(),

                        Locations = (from c in ctx.Locations orderby c.LocationName select c).ToList<Location>(),
                        Supervisors = (from c in ctx.Supervisors orderby c.LastName, c.FirstName select c).ToList<Supervisor>(),
                        Managers = (from c in ctx.Managers orderby c.LastName, c.FirstName select c).ToList<Manager>(),
                        Directors = (from c in ctx.Directors orderby c.LastName, c.FirstName select c).ToList<Director>(),
                        Applications = (from c in ctx.Applications orderby c.ApplicationName select c).ToList<Application>(),
                        ApplicationGroups = (from c in ctx.ApplicationGroups orderby c.ApplicationGroupName select c).ToList<ApplicationGroup>(),
                        ApplicationSecurityRoles = (from c in ctx.ApplicationSecurityRoles orderby c.ApplicationSecurityRoleName select c).ToList<ApplicationSecurityRole>(),<br />
                        UserJobs
                    };
            }

            return model;
        }

I have jquery call to get this in the Employee.js file as below
    loadEmployee: function (employeeID) {
        $.get("/api/EmployeeAPI/Get").then(function (data) {

            var list = $("#ddlApplicationGroup");
            var selectedValue = list.val();

            list.empty();

            $.each(data.ApplicationGroups, function (index, applicationgroup) {
                $("<option>").attr("value", applicationgroup.ApplicationGroupID).text(applicationgroup.ApplicationGroupName).appendTo(list);
            });

            if ((selectedValue == null) || (selectedValue == undefined)) {
                list.prepend("<option value='-1' selected='selected'>Select value</option>");
                list[0].selectedIndex = 0;
            }
            else {
                list.val(selectedValue);
            }

        });
    }

Now I want to bind UserJobs with a table in the cshtml, the table id is: tableDisplay, the condition is I want to loop through the rows and columns with the Column and Row index rather instead of Column Names. Can anybody please help me in this regards?

As I am not supposed to know the Column names or create this table as general table to fit for all the DataTable, I am trying to loop and read through the table and assign the value to cells.
Here I am trying but failing
            var a = data.UserJobs;
            var columns = a.api.columns();

            a.columns().every(function () {
                alert(a[0].val();<br />
            });

            $.each(a, function (bb) {               
                alert(a[bb][0]);              
            });

Any help is going to be very very helpful, thanks in advance.

Thanks,

Abdul Aleem

"There is already enough hatred in the world lets spread love, compassion and affection."

-- modified 30-May-17 16:38pm.
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 
Questionadd small delete button or image to the options of select Pin
indian14326-May-17 13:51
indian14326-May-17 13:51 
QuestionNeed some help in implementing Partial View Pin
indian14323-May-17 13:44
indian14323-May-17 13:44 
AnswerRe: Need some help in implementing Partial View Pin
jkirkerx24-May-17 12:33
professionaljkirkerx24-May-17 12:33 
GeneralRe: Need some help in implementing Partial View Pin
indian14324-May-17 13:26
indian14324-May-17 13:26 
GeneralRe: Need some help in implementing Partial View Pin
jkirkerx25-May-17 10:08
professionaljkirkerx25-May-17 10:08 
Questioncell_double click even on grid view Pin
Mayank Kumar23-May-17 0:14
Mayank Kumar23-May-17 0:14 

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.