Click here to Skip to main content
15,881,172 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: What is better solutions for complex application and databases Pin
F-ES Sitecore9-Aug-17 0:00
professionalF-ES Sitecore9-Aug-17 0:00 
QuestionGetting Route Values in Controller Pin
Farhad Eft7-Aug-17 7:20
Farhad Eft7-Aug-17 7:20 
AnswerRe: Getting Route Values in Controller Pin
Richard Deeming7-Aug-17 10:21
mveRichard Deeming7-Aug-17 10:21 
GeneralRe: Getting Route Values in Controller Pin
Farhad Eft7-Aug-17 13:19
Farhad Eft7-Aug-17 13:19 
Questiontrying to call a WebApi method along with new Page when button clicked using jQuery Pin
indian14331-Jul-17 15:26
indian14331-Jul-17 15:26 
AnswerRe: trying to call a WebApi method along with new Page when button clicked using jQuery Pin
Richard Deeming1-Aug-17 0:50
mveRichard Deeming1-Aug-17 0:50 
GeneralRe: trying to call a WebApi method along with new Page when button clicked using jQuery Pin
indian1431-Aug-17 7:01
indian1431-Aug-17 7:01 
GeneralRe: trying to call a WebApi method along with new Page when button clicked using jQuery Pin
Richard Deeming1-Aug-17 7:24
mveRichard Deeming1-Aug-17 7:24 
Option 1:
You call the API, and then navigate to the new page when you've finished.

NB: Any changes you make to the current page when the AJAX call returns will be discarded.
JavaScript
loadEmployee: function (employeeID) {
    return $.get("/BSCSecurityAddressBookWeb/api/EmployeeAPI/Get");
}

...

$("#btnEmployee").click(function (event) {
    event.preventDefault();
    Employee.loadEmployee().done(function(){
        location.assign('/BSCSecurityAddressBookWeb/Employee/');
    });
});


Option 2:
You navigate to the new page, and then call then API from that page.
JavaScript
$("#btnEmployee").click(function (event) {
    event.preventDefault();
    location.assign('/BSCSecurityAddressBookWeb/Employee/');
});

New page:
JavaScript
loadEmployee: function(employeeID){
    $.get("/BSCSecurityAddressBookWeb/api/EmployeeAPI/Get").then(function(data){
        ...
    });
}

...

$(function(){
    Employee.loadEmployee();
});




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


GeneralRe: trying to call a WebApi method along with new Page when button clicked using jQuery Pin
indian1431-Aug-17 13:23
indian1431-Aug-17 13:23 
QuestionI would like to develope new project from scratch. I would like to use ASP.NET MVC 5.0, EntityFramework and SQL Server. Pin
Lad Kunal30-Jul-17 20:14
Lad Kunal30-Jul-17 20:14 
AnswerRe: I would like to develope new project from scratch. I would like to use ASP.NET MVC 5.0, EntityFramework and SQL Server. Pin
Richard MacCutchan30-Jul-17 20:42
mveRichard MacCutchan30-Jul-17 20:42 
AnswerRe: I would like to develope new project from scratch. I would like to use ASP.NET MVC 5.0, EntityFramework and SQL Server. Pin
indian1432-Aug-17 6:57
indian1432-Aug-17 6:57 
QuestionError message: The operation cannot be completed because the DbContext has been disposed Pin
indian14327-Jul-17 11:39
indian14327-Jul-17 11:39 
AnswerRe: Error message: The operation cannot be completed because the DbContext has been disposed Pin
Richard Deeming28-Jul-17 1:31
mveRichard Deeming28-Jul-17 1:31 
AnswerRe: Error message: The operation cannot be completed because the DbContext has been disposed Pin
Nathan Minier28-Jul-17 1:36
professionalNathan Minier28-Jul-17 1:36 
QuestionUnable to use RequiredValidator control to validate RadioButtonList in Repeater? Pin
samflex26-Jul-17 14:25
samflex26-Jul-17 14:25 
AnswerRe: Unable to use RequiredValidator control to validate RadioButtonList in Repeater? Pin
F-ES Sitecore26-Jul-17 22:45
professionalF-ES Sitecore26-Jul-17 22:45 
GeneralRe: Unable to use RequiredValidator control to validate RadioButtonList in Repeater? (SOLVE) Pin
samflex27-Jul-17 3:05
samflex27-Jul-17 3:05 
QuestionFew questions about web api versioning in core Pin
Mou_kol26-Jul-17 1:38
Mou_kol26-Jul-17 1:38 
QuestionEnable/Disable div based on RadiobuttonList Pin
samflex25-Jul-17 5:41
samflex25-Jul-17 5:41 
AnswerRe: Enable/Disable div based on RadiobuttonList Pin
F-ES Sitecore25-Jul-17 6:30
professionalF-ES Sitecore25-Jul-17 6:30 
AnswerRe: Enable/Disable div based on RadiobuttonList Pin
Richard Deeming25-Jul-17 6:50
mveRichard Deeming25-Jul-17 6:50 
GeneralRe: Enable/Disable div based on RadiobuttonList (SOLVED) Pin
samflex25-Jul-17 9:32
samflex25-Jul-17 9:32 
QuestionVisual Studio & Asp.Net in Web Forms Bad Design view Pin
zequion23-Jul-17 2:23
professionalzequion23-Jul-17 2:23 
QuestionTable resizing in MVC bootstrap Pin
Member 1075459521-Jul-17 7:31
Member 1075459521-Jul-17 7:31 

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.