Click here to Skip to main content
15,868,141 members
Home / Discussions / Web Development
   

Web Development

 
QuestionSending HTML email using mailto Pin
peaceful_warrior20-Jan-09 18:35
peaceful_warrior20-Jan-09 18:35 
AnswerRe: Sending HTML email using mailto Pin
Aman Bhullar20-Jan-09 21:51
Aman Bhullar20-Jan-09 21:51 
QuestionCapture an object in ASP Pin
Anoop Unnikrishnan20-Jan-09 17:06
Anoop Unnikrishnan20-Jan-09 17:06 
QuestionCircumventing IE Navigation Controls Pin
Roger Wright20-Jan-09 16:53
professionalRoger Wright20-Jan-09 16:53 
QuestionHow to Display Repeater control Items like table with rows and columns??? Pin
Charmy320-Jan-09 9:28
Charmy320-Jan-09 9:28 
AnswerRe: How to Display Repeater control Items like table with rows and columns??? Pin
Abhishek Sur20-Jan-09 10:41
professionalAbhishek Sur20-Jan-09 10:41 
QuestionVirtual Pin
BRIMID19-Jan-09 11:12
BRIMID19-Jan-09 11:12 
QuestionComplex c# javascript to web sevice call question Pin
m1k3314118-Jan-09 15:45
m1k3314118-Jan-09 15:45 
I have the following web service

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.Web.Script.Services.ScriptService]
public class Test : System.Web.Services.WebService {

    [WebMethod(true)]
    public void Calc(int value)
    {
        int ii = 0;

        SessionHandler.Session = Session;
        SessionHandler.MyInt = value;

        while (ii < 20)
        {
            SessionHandler.MyInt = value * ii;
            System.Threading.Thread.Sleep(1000);
            ii++;
        }
    }

    [WebMethod(true)]
    public int GetResult()
    {
        int returnVal = 0;
        
        returnVal = SessionHandler.MyInt;

        return returnVal;
    }
}


I have the following javascript

function Calculate() {
    var size = document.getElementById("size").value;
    var watch = document.getElementById("watch").checked;

    myInterval = setInterval("ShowResult()", 500);
    Test.Calc(size, Demo);
}

function Demo(result) {
    ShowResult(result);
}

function ShowResult(result) {
    Test.GetResult(DisplayResult);
}

function DisplayResult(result) {
    var disp = document.getElementById("result");

    disp.value = result;
}


The sessionhandler is simply the following

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

public static class SessionHandler
{
    private static String myInt = "myint";
    private static System.Web.SessionState.HttpSessionState _session;

    public static int MyInt
    {
        get { return (int)SessionHandler._session[SessionHandler.myInt]; }
        set { SessionHandler._session[SessionHandler.myInt] = value; }
    }

    public static System.Web.SessionState.HttpSessionState Session
    {
        get { return _session; }
        set { SessionHandler._session = value; }
    }
}


I have an ASP page that uses the javascript to call a web service. The web service manipulates a calculation. The javascript polls the webservice using an interval to monitor the calculation as it takes place. It does this by use of a session variable. The first time the aspx page runs (it's simply 2 textboxes, a checkbox and a button) and the button is clicked, I can watch the value in the results textbox climb as the calculation takes place. If, when the calculation is done, I click the button again, the intervals that call the web service appear to take place, but the web service function is not actually called until the first calculation (Calc) is finished (after the new button click). This means that after the first page load and run through of watching the calculation, I can not watch the calculation perform again.

My goal is to be able to use a webservice to watch a calculation take place on server side from the client. I do not want an postbacks as that would defeat the purpose of the web service. Can anyone help provide any insight?
QuestionAdding custom button to IE Pin
Haim Nachum18-Jan-09 10:00
Haim Nachum18-Jan-09 10:00 
AnswerRe: Adding custom button to IE Pin
Not Active19-Jan-09 5:22
mentorNot Active19-Jan-09 5:22 
Questionemail server Pin
JimmyRopes18-Jan-09 9:46
professionalJimmyRopes18-Jan-09 9:46 
AnswerRe: email server Pin
Aman Bhullar18-Jan-09 18:28
Aman Bhullar18-Jan-09 18:28 
GeneralRe: email server Pin
JimmyRopes19-Jan-09 1:34
professionalJimmyRopes19-Jan-09 1:34 
AnswerRe: email server Pin
Jörgen Andersson19-Jan-09 4:24
professionalJörgen Andersson19-Jan-09 4:24 
GeneralRe: email server Pin
JimmyRopes19-Jan-09 4:34
professionalJimmyRopes19-Jan-09 4:34 
GeneralRe: email server Pin
Jörgen Andersson19-Jan-09 5:00
professionalJörgen Andersson19-Jan-09 5:00 
GeneralRe: email server Pin
JimmyRopes19-Jan-09 6:55
professionalJimmyRopes19-Jan-09 6:55 
GeneralRe: email server Pin
Jörgen Andersson19-Jan-09 10:08
professionalJörgen Andersson19-Jan-09 10:08 
GeneralRe: email server Pin
JimmyRopes19-Jan-09 10:55
professionalJimmyRopes19-Jan-09 10:55 
GeneralRe: email server Pin
Roger Wright20-Jan-09 16:59
professionalRoger Wright20-Jan-09 16:59 
GeneralRe: email server Pin
JimmyRopes21-Jan-09 14:47
professionalJimmyRopes21-Jan-09 14:47 
QuestionSetting Access Rights in Virtual Folder Pin
Brendan Vogt16-Jan-09 8:34
Brendan Vogt16-Jan-09 8:34 
AnswerRe: Setting Access Rights in Virtual Folder Pin
Jon Rista16-Jan-09 9:26
Jon Rista16-Jan-09 9:26 
QuestionRe: Setting Access Rights in Virtual Folder Pin
Brendan Vogt16-Jan-09 20:13
Brendan Vogt16-Jan-09 20:13 
AnswerRe: Setting Access Rights in Virtual Folder Pin
Jon Rista16-Jan-09 20:22
Jon Rista16-Jan-09 20:22 

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.