This question is locked. New answers and comments are not allowed.
hello all,
In mobile application when i click on Logout button and Login with new user list should bind with new data not with the old data.
Below is the sample code
<li>
<div id="btnLoginSubmit" type="button" data-role="button" data-bind="click: Login" data-click="Login" class="submit-btn">Log In</div>
</li>
<div style="float:right;color:white;" >
<a data-align="right" data-rel="drawer" data-click="Logout" data-role="button" class="back-btn" id="btnLogout" >Logout</a>
</div>
function Logout(e){
app.navigate("#vwLogin");
}
if (data != null) {
userData = data[0];
app.navigate("#tabstrip-openwo");
}
else {
alert("Invalid Username/Password...");
}
}
In mobile application when i click on Logout button and Login with new user list should bind with new data not with the old data.
Below is the sample code
<li>
<div id="btnLoginSubmit" type="button" data-role="button" data-bind="click: Login" data-click="Login" class="submit-btn">Log In</div>
</li>
<div style="float:right;color:white;" >
<a data-align="right" data-rel="drawer" data-click="Logout" data-role="button" class="back-btn" id="btnLogout" >Logout</a>
</div>
function Logout(e){
app.navigate("#vwLogin");
}
function Login(e) {
UserName = $("#txtUserName").val();
Password = $("#txtPassword").val();
if (UserName != "" && Password != null) {
app.showLoading();
$.ajax({
type: 'GET',
contentType: "application/json; charset=utf-8",
url: ServiceURL + "/Login", //Service URL
data: {Email:UserName,password:Password}, //Passing parameters
dataType: "jsonp",
success: OnLoginSuccess,
error: OnLoginError
});
app.hideLoading();
}
else {
alert("User name and Password are required.");
}
function OnLoginSuccess(data, status) {UserName = $("#txtUserName").val();
Password = $("#txtPassword").val();
if (UserName != "" && Password != null) {
app.showLoading();
$.ajax({
type: 'GET',
contentType: "application/json; charset=utf-8",
url: ServiceURL + "/Login", //Service URL
data: {Email:UserName,password:Password}, //Passing parameters
dataType: "jsonp",
success: OnLoginSuccess,
error: OnLoginError
});
app.hideLoading();
}
else {
alert("User name and Password are required.");
}
if (data != null) {
userData = data[0];
app.navigate("#tabstrip-openwo");
}
else {
alert("Invalid Username/Password...");
}
}