Description
VertexFX Web trader has its own stand alone login page, that is used to login to your trading account. What if you want to have your own login page, with your unique design, and may be to be within your website main page, instead of being stand alone page.
However, we provide VertexFX Web Trader login page template, that you can improve as you want in your website.
Basically, to use a login Web template you should change urlStr and urlDefaultPageStr variables in the sample below to the corresponding server host.
You should call Login method to be authenticated before enter to web Trader. The below sample illustrates how you can develop custom login page
Sample
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<htmlxmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Login Page </title>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript" >
$(document).ready(function () {
// change urlStr and urlDefaultPageStr according to host server
var urlStr = "http://webtrader.hybridsolutions.com/publicweb/webservice.svc" ;
var urlDefaultPageStr = "http://webtrader.hybridsolutions.com/publicweb/Default.aspx";
$.support.cors = true;
function onSuccessResult(response) {
try {
response = eval('(' + response + ')')
if (response.UserId == -1 || response.UserId == -207) {
$("#resultData").html("Invalid username or password".fontcolor("red"));
}
else if (response.UserId == -231) {
$("#resultData").html("You must have at least one account".fontcolor("red"));
}
else if (response == null || response == "" || response.UserId < 0) {
$("#resultData").html("Error while login.Please try later".fontcolor("red"));
}
else if (response.UserId > 0) {
window.location = urlDefaultPageStr;
}
else {
$("#resultData").html("Invalid username or password".fontcolor("red"));
}
}
catch (exception) { }
}
function onErrorResult(result) {
alert('Service call faild : ' + result.status + ' ' + result.statusText);
}
$("#btnLogin").click(function () {
$.ajax({
type: "GET",
url: urlStr + "/Login",
dataType: "jsonp",
data: { "username": $("#txtusername").val(), "password": $("#txtpassword").val() },
success: onSuccessResult,
error: onErrorResult
});
});
});
</script>
</head>
<body>
<center><table cellpadding='2' cellspacing='0' border='0' id='ap_table' style="width:200px" >
<tr><td bgcolor="blue"><table cellpadding='0'cellspacing='0'border='0'width='180px'><tr><td bgcolor="blue" align=center style="padding:2;padding-bottom:4"><b><font size="-1" color="white" face="verdana,arial"><b> Enter your login and password</b></font></th></tr>
<tr><td bgcolor="white" style="padding:5"><br>
<center><table>
<tr><td><font face="Tahoma" size=-1>Login:</td><td><input type="text" id="txtusername" style="width:150px"></td></tr>
<tr><td><font face="Tahoma" size=-1>Password:</td><td><input type="password" id="txtpassword" style="width:150px"></td></tr>
<tr><td><font face="Tahoma" size=-1> </td><td><font face="Tahoma" size=-1><input style="width:80px" id="btnLogin" type="submit" value="Enter"></td></tr>
<tr><td colspan=2><font face="Tahoma,arial" size=-1><div id="resultData"> </div></td></tr>
</table></center>
</td></tr></table></td></tr></table>
</body>
</html>
Related Topics
Back to VertexFX Help Index
Back to Home Index
To have the full ISV Development API KIT, register as ISV first.
|