AJAX :: Find All Timers With Javascript?

Sep 10, 2010

i have some timers on my page, i don't know how many or how they are named. so i tried to find them by the type, but it's always undefined!?

View 5 Replies


Similar Messages:

Ajax - Call An ASMX Webservice In Javascript Without Resetting Authentication Timers

Nov 23, 2010

Pinging back to a webservice in ajax from the client keeps the user's session alive, I don't want this to happen. More extensive summary For a website we're developing, we need the client to ping back (in js) to a webservice (ASMX) on the server (IIS7.5). This happens to let the server know that the user is still on the site, and hasn't browsed away to another site. This is as our customer wants to let users lock records, but if they browse away to other sites, then let other people take over those locked records. Perhaps the distinction between the client being on the site but inactive and on another site seems unimportant, but that's kinda irrelevant, I don't get to write the UI spec, I just have to make it work.

My problem is this, the ping stops the user from being timed out on the server through the standard forms authentication timeout mechanism. Not surprising as there is that 30 second ping in the background keeping the session alive. Even though we want to know if the user is still on the site, we want the normal forms authentication timeout mechanism to be honoured. I thought I might be able to fix this by removing the ASP.NET_SessionId and .ASPXAUTH cookies in the XMLHttpRequest that is the server ping, but I can't figure out how to do this. This is how my web service & method are defined:

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ScriptService]
public class PingWS : WebService
{
[WebMethod]
public void SessionActive(string sessionID)
{
// does stuff here
}
This is how I'm calling it in js (request is over HTTPS, :
$.ajax({
type: "POST",
url: "PingWS.asmx/SessionActive",
data: 'sessionID=' + aspSessionID + '}',
beforeSend: function (xhr) {
xhr.setRequestHeader('Cookie', '');
xhr.setRequestHeader('Cookie', 'ASP.NET_SessionId=aaa; .ASPXAUTH=bbb;');
},
dataType: "json"
});

I was trying with the setRequestHeader, but that just appends to the header rather than overwrites the header, and IIS is happy to ignore that junk I added. I'm thinking maybe I should be trying to do this at the server end, someone take PingWS.asmx out of the loop so that it doesn't keep the session active, but I'm not sure how to do this. Although the title of the question is focused on clearing the cookie in the header, I'd be super happy if anyone points out that I'm being really stupid and there is actually a much better way of trying to do what I'm doing.

I'm thinking at this stage maybe I need to add something to the webmethod that says how long this particular page has been inactive, and use that knowledge to timeout manually. That actually sounds pretty easy, so I think I'll do that for now. I'm still convinced that there must be an easy way to do what I originally wanted to do though. Update I'm thinking I'm pretty screwed in terms of cookie manipulation here as both the .ASPXAUTH and ASP.NETSessionId cookie are HttpOnly, which means the browser takes them out of your hands, you can't access them via the document.cookies object. So I would say that leaves me with:

Updating my SessionAlive webmethod to track each request so I can tell how long the user has been sitting idle on a page and timeout if needs be Marking the .asmx page somehow on the server end so that it's taken out of the normal authentication/session tracking flow I know how to do 1. so I'll start there but 2. seems much cleaner to me.

View 3 Replies

Javascript - Web Based Chat, Using Ajax Timers , Will It Perform For Large Number Of Users

Jan 25, 2010

as all we know that we can create very simple chat using ajax timer & web service , it runs well for few users .

i want to leaverage same idea for site where 5000+ users will be there in chat room , messages are stored in queue hold in memory * dispatched as user request that is through java script timers calling page method or service ,

how well it will perform ? i know GTalk implements XMPP protocol(jabber) for the web chat
seems it will be difficult to got XMPP way ?

View 1 Replies

AJAX :: Cannot Have Functional Timers In Both Master Page And Content Page?

May 22, 2010

The following is an edited version Let me describe what I have observed and I hope some Ajax guru can shed some light on this. The master page has a timer (Timer1) and a content page also has a timer (Timer2). When Timer1's interval is shorter than Timer2, Timer1 works and Timer2 does not (i.e. Timer1's Tick handler is called periodically, but Timer2's tick handler is never called). If Timer2's inerval is shorter, it seems Timer1's handler is invoked by Timer2(i.e. Timer1's interval appears to be shortened to exactly the same as Timer2). Both of these timer controls are in their separate UpdatePanels.

View 2 Replies

AJAX :: How To Find Javascript Method Returns Null

Feb 15, 2011

[Code]....

If I use $get, it does work as the expected functionality for $get. It is only $find that does not work.
Can anyone explain the problem?

View 5 Replies

AJAX :: Use JavaScript To Find Out If The Accordion Is Expanded Or Collapsed

Apr 14, 2010

I am using vb.net/asp.net 2005.

I have an accordian in my nested gridview that has the defaul selectedindex=-1 (meaning its collapsed).

In order to change the expand icon I need to find out using javascript what the selectedindex value of the accordian is when it loads, does anyone know how to do this?

View 2 Replies

AJAX :: How To Find HTML Editor In DataList By Javascript

Jan 8, 2010

i can access html editor by sever side , but i want to access it by client side ,

how i can access the ajax HTML Editor (Find it) By Java script in datalist ?

View 2 Replies

C# - System.Timers.Timer Not Working Every 5 Minutes?

Nov 16, 2010

I have a method which must be run every 5minutes in order to show latest data in gridview.

I was experimenting with System.Timers.Timer and the following is my code:

[code]...

the problem is that after 5minutes it is not going to t_Elapsed. Note this should keep being done at all times not just for once.

View 4 Replies

Web Forms :: Use 4 Dynamically Created Timers On Single Page For Incrementing 4 Different Variables (int)?

Mar 24, 2011

how to use 4 dynamically created timers on a single page for incrementing 4 different variables(int).

View 3 Replies

How To Find Textbox Value From .net To Javascript

Jun 15, 2010

i have a textbox in asp.net form.... if i entered numbers not like 7 or 8 or 9, then script function should be araised with alert message.... how to achieve this.... that 7 or 8 or 9 are first digits in my texbox.

View 1 Replies

IIS Can't Find JavaScript And CSS Files

Aug 6, 2010

I've been working on this for a while and was wondering if anyone has run into the issue of error 404 on IIS. More specifically, when I type in http://localhost/test/test.aspx, the page runs, but the referenced files (JS and CSS) are not being used.

View 3 Replies

Find Linkbutton Id In Javascript?

Jun 26, 2010

my linkbutton is in datalist, this datalist is in panel, this panel is in ajax updatepanelif linkbutton is not selected then need to alert a message...

View 2 Replies

To Find Check Box Id In Javascript?

Dec 15, 2010

how to find check box id and use the :checked selector to determine if it is checked in javascript.i am not getting checkbox id in javascript

View 1 Replies

In JavaScript How To Find The Height And Width

Jul 23, 2010

i am having a .aspx and masterpage page. in masterpage i am loading aspx page . in aspx page design i am using generating table structure using code-behind server in javascript how to find the height and width .

View 1 Replies

How To Find Source Of Submit Using JavaScript

Apr 1, 2010

I have a form in which i have written onSubmit calling a javascript function. in that javascript function how can i check that who was the event generater ( i mean on which button click this even raised)..

Note: onsubmit function call is in form tag..

i am using JavaScript and asp.net

My code is like this:

[code]...

i dont want to change any functionality.. i have got a dropdownlist which is causing postback.. i want that when this dropdownlist raise post back either i should know that its raised by dropdownlist or that function should not be called by dropdownlist's postback

View 3 Replies

Javascript - Find Out The Value Of Textbox To Script?

Jun 15, 2010

from my textbox, i need to get the first digit entered into that, and check whther it is 7 or 8 or 9.. using getelementbyid, how can i get this.... how can check whether first digit is 7 or 8 or 9 in the textbox

View 2 Replies

Web Forms :: How To Find The Div That Is Inside A Iframe Using Javascript

Mar 29, 2011

i am using a iframe.iframe have a div that is declared runat="server".i wnat to find this iframe div and wnat to amke them empty using javascript....

how can i do this......

View 2 Replies

How To Find Masterpage Height And Width Using JavaScript

Jul 22, 2010

How to find Masterpage offsetheight and offsetwidth using javascript ?

View 1 Replies

How To Find The Parent Of TreeView Node In JavaScript

Mar 21, 2010

How to find the parent of an ASP.NET TreeView node in JavaScript?

View 1 Replies

Web Forms :: Find Value By Javascript When Control Is In ItemTemplate?

Jan 9, 2010

I am Working on VS 2008,

I have 1 problem ,

How to find value by Javascript when control is in ItemTemplate

How to find "imgdiv" by Javascript

eg

<asp:TemplateField Visible="false">

View 9 Replies

Find The Balance Between Javascript (jQuery) And Code Behind

Jun 3, 2010

How do you currently find the balance between javascript and code behind. I have recently come across some extremely bad (in my eyes) legacy code that lends itself to chaos (someHugeJavafile.js) which contains a lot of the logic used in many of the pages.

Let's say for example that you have a Form that you need to complete.
1. Personal Details
2. Address Information
3. Little bit more about yourself

You don't want to overload the person with all the fields at once, so you decide to split it up into steps.

Do you create separate pages for Personal Details, Address Information and a Little bit more about yourself.
Do you create controls for each and hide and show them on a postback or using some update panel?
Do you use jQuery and do some checking to ensure that the person has completed the required fields for the step and show the new "section" by using .show()?

View 2 Replies

Find Hiddenfield In Javascript But It Is Showing Undefined Value?

Nov 10, 2010

i want to find hiddenfield in my javascript but it is showing undefined value.myscript is,

<script type="text/javascript">
var i = document.getElementById('HiddenField4').value;
while (i < cn) {

[code]...

View 5 Replies

Unable To Find Any Documentation On This Library (using JavaScript With .dll's)?

Sep 3, 2010

I love the demos of ASTreeView. I'd like to use this in my project, which is completely local and currently only uses HTML, JavaScript, and CSS - i.e. no ASP.net or anything dealing with servers...

Is it possible for me to use this? There is a .dll and a .js included in the package, but I have no clue where to start since this isn't a ASP.net project for me. I can't find any documentation on this library.

View 1 Replies

Find The Type Of Html Controls In Javascript?

Aug 9, 2010

How to find the control type in javasccript?. Say if i have an ASP.NET LinkButton and i wanna find control type from the javascript. How can i do that. I tried using typeof(), but it giving me an object back. and i tried

var control = document.getElementById(Id);//Id is the ClientId of the Linkbutton alert(control.type);//this is empty.

View 3 Replies

Find Javascript Code Inside String?

Apr 26, 2010

I am developing a web application that will allow the customer to enter a personalized message, which will then be converted to HTML. Well, the problem is that I can not allow the insertion of Javascript code. So I need a method that filters the text, searching for and remove it. I think the regular expressions to solve my problem, but I'm having difficulty building.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved