Go Back   CodingForums.com > :: Server side development > ASP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-17-2012, 08:21 AM   PM User | #1
buddyfoeva
New to the CF scene

 
Join Date: Apr 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
buddyfoeva is an unknown quantity at this point
Android Asp problem

Ok I am trying to make an app for android that accesses a website. on the website there is an option to view a schedule. that schedule is in asp. I am trying to get the data from the asp file into the android calendar. I am not quite sure how to go about doing that. any help? here is the asp file. Any help is appreciated.

i added only the data that should really be important as the whole was too long


<script type="text/javascript">
//<![CDATA[
var displayedScheduleDate = '04-16-2012';var currentWeek = 12;var scheduleTimestamp = new Date('04/17/2012 1:54:33'); $('#scheduleFooter').html(formatTime(scheduleTimestamp)); $(document).ready(function(){ lastUpdatedEmailAddy = 'buddyfoeva1@hotmail.com';});$(document).ready(function() {$('#lnkSubmit').hide();});//]]>
</script>
</form>

<script type="text/javascript">
var showAvail = false;
var showActual = false;
var menuActive = false;
var lastUpdatedEmailAddy;
var winID = 213199781;
var userID = 2711346;
var userFullName = "Buddy Harrison";
var selectedWeek;
var omnitureSuiteId = "walmartstoresmywalmartprod,walmartstorewalmartstoremywalmartsched";

$(document).ready(function() {
hideAvailability();

selectedWeek = currentWeek;
showSchedules();

$('#btnShowAvail').click(function () { toggleAvailability(); return false; });
$('#btnHideAvail').click(function () { toggleAvailability(); return false; });
//showExceptionCalendar();


$('#txtEmail, #txtEmail2').val(lastUpdatedEmailAddy);
});

function toggleSendButton() {
if($('[id$=chkAccept]').get(0).checked) {
$('#lnkSubmit').show();
}
else {
$('#lnkSubmit').hide();
}
}


function updateTab(week) {
$('#pnlWeek' + selectedWeek).hide();
$("#scheduleTab" + selectedWeek).removeClass("walSchHeaderTabs_cur");
selectedWeek = week;
$('#pnlWeek' + selectedWeek).show();
$("#scheduleTab" + selectedWeek).addClass("walSchHeaderTabs_cur");


//Code to capture stat for yesterday here...
if(currentWeek != selectedWeek)
{
var s=s_gi(omnitureSuiteId); s.tl(this, 'o', 'OTW Full Tab Click ' + getOmnitureWeekText(selectedWeek));
}
}

function getOmnitureWeekText(weekNumber)
{
var ret = '';
switch( weekNumber - currentWeek )
{
case -2:
ret = 'Two Weeks Ago';
break;
case -1:
ret = 'Last Week';
break;
case 0:
ret = 'Current Week';
break;
case 1:
ret = 'Next Week';
break;
case 2:
ret = 'Two Weeks Ahead';
break;
default:
}
return ret;
}




function showAvailability() {
//$(".workbar").hide();
$(".availbar").show();
$(".rightColHeader").css("background-color", "#337321");
//$(".rightColHeader div.w").hide();
$(".rightColHeader div.avH").show();
//$(".ActualsDetails").hide();
$(".AvailDetails").show();
}

function hideAvailability() {
$(".availbar").show();
$(".availbar").hide();
//$(".workbar").show();
//var iB = "#" + ((showActual) ? "003896" : "FFFFFF");
$(".rightColHeader").css("background-color", "#FFFFFF");
$(".rightColHeader div.avH").hide();
//$(".rightColHeader div.w").show();
$(".AvailDetails").hide();
//$(".ActualsDetails").show();
}



function toggleAvailability() {

showAvail = $('#btnShowAvail').css('display') != 'none';
if (showAvail) {
showAvailability();
$('#btnShowAvail').hide();
$('#btnHideAvail').show();
}
else {
hideAvailability();
$('#btnShowAvail').show();
$('#btnHideAvail').hide();
}
}

function showSchedules() {
$(".walSchHeader div a:lt(2)").show();
$("#timeSchedule").show();
$("#hTabHolder").show();
$(".walSchFooter").show();
$("#schIcon").hide();
$("#availIcon").show();
//Handle the problem where current week is not selected when coming back from exceptions.
updateTab(selectedWeek);
}

function hideSchedules() {
$("#timeSchedule").hide();
$("#hTabHolder").hide();
$(".walSchFooter").hide();
$(".walSchHeader div a:lt(2)").hide();
}

function showExceptionCalendar() {

$("#timeExceptions").show();
$(".assocInfo").show();
$("#availIcon").hide();
$("#schIcon").show();


var s=s_gi(omnitureSuiteId); s.tl(this, 'o', 'OTW Full Tab Click Exception Calendar');

}

function hideExceptionCalendar() {
$("#timeExceptions").hide();
$(".assocInfo").hide();
}

function showExceptionToolTip(e, elemId) {

if (!menuActive) {
var posX = 0;
var posY = 0;
var e = (!e) ? window.event : e;

if (e.pageX || e.pageY) {
posX = e.pageX;
posY = e.pageY;
}
else if (e.clientX || e.clientY) {
posX = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
posY = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;
}

var iDiv = document.createElement("div");
with (iDiv) {
className = "tooltip";
style.top = posY + "px";
style.left = (posX + 5) + "px";
innerHTML = '<div class="sttt">&nbsp;</div><div class="sttm">' + $('#' + elemId).html() + '</div><div class="sttb"></div>';
}

document.body.insertBefore(iDiv, document.body.firstChild);
repositionDiv(posX, posY);
menuActive = true;
}
}

function repositionDiv() {
if (arguments[0] + $("div.tooltip").width() > document.documentElement.clientWidth) {
$("div.tooltip").css("left", arguments[0] - $("div.tooltip").width());
}

if (arguments[1] + $("div.tooltip").height() > document.documentElement.clientHeight) {
$("div.tooltip").css("top", document.documentElement.clientHeight - $("div.tooltip").height());
}
}

function hideExceptionToolTip() {
$("div.tooltip").remove();
menuActive = false;
}

function printSchedule() {
window.open('printableSchedule.aspx?w=213199781&d=04-16-2012&p=' + selectedWeek, '', 'width=615,height=455,scrollbars=yes');
}

function showFeedback() {
window.open('technicalsurvey.aspx', '', 'width=520,height=460,scrollbars=yes');
}

var popupStatus = 0;

function loadPopup(popupToShow) {
if (popupStatus == 0) {
if (popupToShow == 'email') {
$(".help").hide();
$(".emailLayout").show();
}
else if (popupToShow == 'help') {
$(".emailLayout").hide();
$(".help").show();
}
this.centerPopup();

$("#backgroundPopup").css({
"opacity": "0.7"
});
$("#backgroundPopup").fadeIn("slow");
$("#popupContact").fadeIn("slow");
this.popupStatus = 1;
}
}

function disablePopup() {
if (this.popupStatus == 1) {
$(".help").hide();
$(".emailLayout").hide();
$("#backgroundPopup").fadeOut("slow");
$("#popupContact").hide();
setTimeout('emailReset()', 1000);
this.popupStatus = 0;
}
}

function centerPopup() {
var popupHeight = $("#popupContact").height();
var popupWidth = $("#popupContact").width();

$("#popupContact").css({
"position": "absolute",
"top": (document.documentElement.clientHeight / 2) - (popupHeight / 2),
"left": (document.documentElement.clientWidth / 2) - (popupWidth / 2)
});

$("#backgroundPopup").css({
"height": document.documentElement.clientHeight,
"width": document.documentElement.clientWidth
});
}


function emailReset() {
$("#divEmailError").fadeOut(1000);
$("#contactArea").show();
$("#confirmArea").hide();
$('#txtEmail').val(lastUpdatedEmailAddy);
$('#txtEmail2').val(lastUpdatedEmailAddy);
$("span.ackErr").fadeOut(1000);


if (!this.lastUpdatedEmailAddy == '') {
$("#contactArea b").html(lastUpdatedEmailAddy);
$('[id$=divAddress]').show();
$('[id$=divNoAddress]').hide();
}
else {
$('[id$=divAddress]').hide();
$('[id$=divNoAddress]').show();
}
}

// function hideConfirmEmailAddy() {
// $("#divEmailError").hide();
// $("#hideEmailAddyLink").hide();
// $("#confirmEmailAddyLink").show();
// $(".confirmEmailAddy").hide();
// centerPopup('email');
// $('#txtEmail').val(lastUpdatedEmailAddy);
// $('#txtEmail2').val('');
// }

// function showConfirmEmailAddy() {
// $("#confirmEmailAddyLink").hide();
// $("#hideEmailAddyLink").show();
// $(".confirmEmailAddy").show();
// centerPopup('email');
// $('#txtEmail').val('');
// $('#txtEmail2').val('');
// }

function confirmEmail() {
var validEmailReg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
var iTest = false;
if ($('.confirmEmailAddy').get(0)) {
iTest = true
}

if (iTest && $('#txtEmail').val() == "") {
$("#divEmailError").html('You have not entered an email address!');
$("#divEmailError").show();
return false;
}
else if (iTest && $('#txtEmail2').val() == "") {
$("#divEmailError").html('You have not confirmed the email address!');
$("#divEmailError").show();
return false;
var s = new String();
}
else if (iTest && $('#txtEmail').val().toLowerCase() != $('#txtEmail2').val().toLowerCase()) {
$("#divEmailError").html('The email address and confirmed email address do not match!');
$("#divEmailError").show();
return false;
}
else if (iTest && (!validEmailReg.test($('#txtEmail').val()) || !validEmailReg.test($('#txtEmail2').val()))) {
$("#divEmailError").html('You have not entered a valid email address!');
$("#divEmailError").show();
return false;
}
else {
var w = parseInt(winID);



var toEmail = '';
if (iTest) {
toEmail = $('#txtEmail').val()
}
else {
toEmail = lastUpdatedEmailAddy;
}

var iTitle = 'Walmart Schedule for Walmart Week #' + selectedWeek + ' for ' + userFullName;

var parms = {
"setPrimary": false,
"optInForMyWalmartNotifications": ($("#elemOkToOptIn").get(0) != null && $("#elemOkToOptIn").attr('checked')),
"optInForScheduleNotifications": ($("#elemOkToSendSchChanges").get(0) != null && $("#elemOkToSendSchChanges").attr('checked')),
"emailAddress": toEmail,
"userID": userID,
"displayedScheduleDate": displayedScheduleDate,
"scheduleValidString": formatTime(scheduleTimestamp),
"weekToPrint": selectedWeek
};


jsonString = JSON.stringify(parms);
$.ajax({
type: "POST",
url: "/_resources/Services/UserSchedules/UserSchedule.asmx/EmailAssociateSchedule",
data: jsonString,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(msg) {
$("#contactArea").hide();
$("#confirmArea").show();
$("#confirmArea").html("The schedule has been emailed to: <b>" + toEmail + "</b>");
//Omniture code to notify success of email.
var s=s_gi(omnitureSuiteId); s.tl(this, 'o', 'OTW Full Tab Click Email Schedule');
setTimeout('disablePopup()', 3000);
setTimeout('emailReset()', 4000);
},
error: function(xhr, msg) { alert('An error occurred while sending the email. Please try again.'); }
});
}
}

</script>
<script type="text/javascript">
//Send start for showing current tab when page loads.
//By the way, apparently this won't work in document.ready. I tried.
var s = s_gi(omnitureSuiteId); s.tl(this, 'o', 'OTW Full Tab Click Current Week');
</script>
</body>
</html>
buddyfoeva is offline   Reply With Quote
Old 04-17-2012, 09:11 PM   PM User | #2
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,210
Thanks: 59
Thanked 3,996 Times in 3,965 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
Point 1: You said "ASP code", but your apparently mean "ASP.NET' Be aware they aren't the same thing.

Point 2: You don't seem to be showing any ASP.NET code. So how can we guess where the problem in said code might be?
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote
Old 04-18-2012, 12:57 PM   PM User | #3
alykins
Senior Coder

 
alykins's Avatar
 
Join Date: Apr 2011
Posts: 1,608
Thanks: 37
Thanked 183 Times in 182 Posts
alykins will become famous soon enough
Point 3: Although you *can* do .net on android- keeping it native Java is better- what you need to do is figure out how/what they are doing in their code behind to make the calendar "work" and then do that as an activity on the android
__________________

I code C hash-tag .Net
Reference: W3C W3CWiki .Net Lib
Validate: html CSS
Debug: Chrome FireFox IE
alykins is offline   Reply With Quote
Old 04-18-2012, 08:07 PM   PM User | #4
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,210
Thanks: 59
Thanked 3,996 Times in 3,965 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
Alykins: I don't think he is doing any .NET on Android. I think the ASP.NET code is all on the server. I think he is simply using AJAX to pull info from an ASP.NET server. I see no evidence at all of any ASP.NET code in what he posted, which presumably is the code he is using on the Android device. I do see evidence of jQuery, but that shouldn't cause problems.

Look here:
Code:
$.ajax({
type: "POST",
url: "/_resources/Services/UserSchedules/UserSchedule.asmx
/EmailAssociateSchedule",
...
See? Just using jQuery AJAX to post a request to the ASP.NET page(s).
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote
Old 04-18-2012, 08:45 PM   PM User | #5
alykins
Senior Coder

 
alykins's Avatar
 
Join Date: Apr 2011
Posts: 1,608
Thanks: 37
Thanked 183 Times in 182 Posts
alykins will become famous soon enough
if he is making an android app though (i do android coding) he needs to do some java- jquery won't work on an android as an app... if he is serving up to a mobile device via androids browser different story- but yes i see now the service request- I guess question bounces to OP- what are you trying to do? and what is not working as it should?
__________________

I code C hash-tag .Net
Reference: W3C W3CWiki .Net Lib
Validate: html CSS
Debug: Chrome FireFox IE
alykins is offline   Reply With Quote
Old 07-19-2012, 01:03 AM   PM User | #6
masudalnahid
New to the CF scene

 
Join Date: Jul 2012
Location: Bangladesh
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
masudalnahid is an unknown quantity at this point
if you have android apps problem plz come here solve your problem http://http://blogermasud.blogspot.com
masudalnahid is offline   Reply With Quote
Reply

Bookmarks

Tags
android, asp

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:49 PM.


Advertisement
Log in to turn off these ads.