C# - Use JQuery To Retrieve Single Value From Another Domain?

Apr 21, 2010

I'm doing some work for a charity that's having a fund drive. Whenever someone makes a pledge, their pledge amount is logged to SQL Server. They'd like to have the pledge total posted across a couple of other websites, so I thought, "a-ha! this is an opportune time to learn about web services!" I assumed I could set up a web service that returns the pledge total as a string, and then dump some jquery code on the external sites that would call the web service.

It's about nine hours later, and I'm still trying to figure this stuff out. It sounds like JSONP is the only way to do cross-domain requests, but even after reviewing a bunch of tutorials, I'm not sure how to make my .NET page return the right value, and now I'm wondering if there isn't a better way of doing this altogether. Can anyone provide a totally simplified code sample?

TL;DR: I need to return a single value to a bunch of pages using jquery or javascript from another web server.

View 2 Replies


Similar Messages:

JQuery :: Retrieve Part Of An HTML From Pages That Is Located In Other Domain Using AJAX?

Nov 29, 2010

If I want to retrieve part of an HTML from pages that is located in other domain using AJAX, how do i do it securely ?

View 1 Replies

Single Sign On Across Many Domain Without Cookies?

Feb 16, 2011

m using visual studio 2008.my requirement is to implement single sign on across many domains without using cookies. is this possible?for example, i have 3 domains (hosted in 3 different systems).[URL]i implemented single sign on with cookies, if the sites are hosted in single system then it is working. but it doesnt work if cookies are disabled.i tried all made all possible google searches, but couldnt find anything useful.

View 2 Replies

C# - How To Create A Single Webapplication As A Sub Domain For Many Companies

Jan 18, 2010

i am working on a project that you can subscribe with your company name and you can use all features of site specificly to your company. for example company abcd can get its own url from our website like

www.test.com/abcd/productlist.aspx

company efgh can also login with its own url and see its product list.

www.test.com/efgh/productlist.aspx

I am thinking on the approach that will use Global.ascx file to distinguish companies, i will write code to extract company name from url in global.ascx for every valid request and in all the pages i will put this.form.action = request.rawurl.

View 3 Replies

Configuration :: Single Domain Multiple Applications?

Feb 17, 2011

We are having a project which is for various online application systems for an educational institute. (Asp.Net 2.0 Web Site)

initially we developed all applications in single project with proper folder structure. but now we want to make each application as separate product.

all applications share single authentication(Obviusly this is single project) want to keep that way only.

I want to split project in smaller projects but want to keep shared authentication so how should i orgnise this project in IDE.

Also i need guidence on hosting such project

i should make small projects within single solution file. and at the time of publish amke single virtual directory to host the root project(login.aspx etc) and in subdirectories i should host other projects. so this way SSO(single sign on) across applications is possible ..

View 2 Replies

C# - .NET Cross-Sub-Domain Single Sign-On Cookies

Oct 28, 2010

I have a Single Sign-on solution which is working great in our test environment. It uses Cross-Sub-Domain cookies to share the authentication ticket between 2 web applications. Sign-on is done only on one of the applications and on the second site the user is authenticated by the cookie created by the first site.The problem is that when I roll it into the production environment the single sign-on no longer works. I'm looking for any ideas on why this might be. More details below:1) Both apps are implemented using ASP.NET MVC2

[code]...

View 1 Replies

C# - Use A Guid For Implementing Single Sign On The Same Domain?

Aug 23, 2010

How can I use a Guid for implementing single sign on the same domain? I can't use sessions as the different web apps would open in new windows hence loosing the session.

Technology used: ASP.net 3.5, MVC2 architecture, C#.

View 1 Replies

Configuration :: Want To Host Two Web Applications In Single Application Domain?

Aug 30, 2010

to host two web applications in single application domain? For example two web applications web1 and web2 being hosted in single application domain.

View 3 Replies

Security :: Multiple Form Authentication In A Single Domain?

Nov 8, 2010

We are upgrading the asp.net 2.0 web application to asp.net 4.0. The application contain three main modules (sub application) like End User, Franchise and Admin with separate web.config, asp.net form Authentication, login page and running with single domain. the URL like,mydomain.com/login.aspxmydomain.com/franchise/login.aspxmydomain.com/admin/login.aspx In asp.net 2.0, working fine with 3 sub applications with separate form authentication under a single domain name and also we can working with all threes in same time. After the up gradation process (ASP.NET 2.0 to 4.0),We didn't run all three applications in same times and also form authentication crossed.

View 2 Replies

JQuery :: Data Size While Making Cross Domain JSONP Call Using JQuery .ajax() Method

Dec 21, 2010

I am developing web application and in application i need to make call of jQuery using .ajax(); method with datatype is set jsonp. Now all works well with limited data but problem start to occur when data size is increasing......

View 7 Replies

C# - How To Implement Multiple Login/logout-domains, Single Main Domain In Forms Authentication

Jan 25, 2011

i want to have several domains A, B, C where a user can enter his username and password to login to a common main domain D.

So the user goes to A, B or C, enters his username and password, clicks the "login" button, and is then on the main domain D in a logged in/authenticated state. Then the user does the things he wants to do, and then clicks the logout-button and is then returned to the original domain that he came from, be it A, B or C.

What is the best way to do this?

I currently use forms authentication in ASP.NET 4.0 (C#).

View 1 Replies

Web Forms :: Single DataList - Retrieve Data From Three Table

Apr 5, 2012

With a single datalist control, I need to retrieve the data from three table..

View 1 Replies

JQuery :: How To Save And Retrieve Date In Database Using Jquery Ajex .net ,JSOn,XML,HTML

Oct 13, 2010

how to save and retrive date in database using jquery ajex asp.net ,JSOn,XML

View 2 Replies

Web Forms :: Retrieve And Display Single Video From Database Using ID In QueryString

May 7, 2015

In the following code, I need to modify the Handler so that the records or results that display are based on a QueryString value. Currently all of the records in the table display on the page but I want records to display based on the passing a querystring value based on the field, id. I have tried to alter the code without much success.

Public Class FileVB : Implements IHttpHandler

Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
Dim id As Integer = Integer.Parse(context.Request.QueryString("id"))
Dim bytes As Byte()
Dim contentType As String
Dim strConnString As String = ConfigurationManager.ConnectionStrings("fitnesConnectionString").ConnectionString
Dim name As String
Using con As New SqlConnection(strConnString)
Using cmd As New SqlCommand()

[CODE]..

View 1 Replies

State Management :: Store And Retrieve Multiple Values In A Single Session Variable?

Aug 24, 2010

I want to store employee name,designation and department in session variable and retrieve in another page how to do this.

View 2 Replies

Configuration :: How Many App Domain Created When Multiple Instance Of Multiple Application Is Running On Single

Jan 12, 2011

below written question :

1.) What is the name of the OS process in which App Domain resides.

2.)if suppose There are Three Windows application hosted on a same envoirment and two instance is working for each application at a Time, means now total instance are six .what will happen among the below written cases :

a.) There will be six different app domain in a single OS process

b.) There will three app domain(one for each application) in a single OS process and some Parallel thread will be executed in each app domain for another instance.

c.) There will be Three OS process corresponding to each application.

3.) If eveything will remain same except there are three web application in place of windows in point 2, will there be any change in functioning.

View 1 Replies

Web Forms :: Send Forgot Password Email To Multiple Domain Email Addresses Using Single Program

Mar 31, 2013

i have code for forgot password using gmail account. But i want to send password for multiple domains like yahoo,rediffmail and more.

View 1 Replies

JQuery :: Post Request To Different Domain?

Feb 8, 2011

I developed a website in ASP.NET with huge Database, Now i have another website in HTML & PHP. I want to make user login authentication from HTML website which will authenticate the login details from the old website's Database.

Database used is SQL Server 2005.

I Created t HttpHandler to authenticate the user in old website.

I want to make a JQuery request from HTML website to old website which will authenticate login details and will redirect to the user to new page according to user type.

View 3 Replies

JQuery And Cross Domain With Jsonp?

Mar 29, 2011

I am trying out jsonp with jQuery. I found many examples on the web and I believe my code is correct, but its still not working for me.

My web service:

using System.Web;
using System.Web.Script.Services;
using System.Web.Services;
using System.Web.Script.Serialization;..........

Firebug shows this is a success, but I am getting null from the alert. I have my webservice in iis7 locally and I am testing through my debug in my client project.

I need to get cross-domain working.

View 2 Replies

JavaScript - Cross Domain Requests Using JQuery?

Sep 1, 2010

This is a followup question to the one here

Here's briefly what I am trying to do. The File server creates a text file to indicate an end of the process. On a webpage on the Web Server, I loop every x seconds and make an ajax request to find out if the test file exists (ajax request to [URL]

I've tried the following approaches so far:

Trigger a web method from the client side that creates a HttpContext object to verify if the text file exists. But this is too strenous on the server and I started getting all kinds of exceptions in the Event Viewer.

View 3 Replies

How To Call Cross Domain WebService / WCF In JQuery

Nov 15, 2010

UPDATE1:

here is what i am getting when i copy and paste the service url in the IE browser:

[Code]....

View 5 Replies

JQuery :: Getting Current URL In Cross-domain Iframe?

Feb 17, 2011

Is there any way to get an iframe current URL after it had been changed when the user has clicked a linked inside the iframe. I am talking about cross-domain iframe. If not, is their any web browser control for ASP.net that can give me the URL of that the user is currently browsing?

View 2 Replies

Passing Cookies With Jquery Ajax Request From A Different Domain?

Jun 9, 2010

I'm building a greasemonkey script to make posting to craigslist a lot easier for our clients.

Basically the flow is this:

User logs into our system (established authentication cookies with asp.net)User navigates to a section on our site called "CraigsList". If they have the greasemonkey script installed it automatically opens up craigslist in a new tab.

The greasemonkey script then does a request back to our site at [URL] to retrieve a list of available items to be posted to craigslist.

This is where it fails because the request to [URL] is not including any of the authentication cookies. I'm not sure if it doesn't include the cookies because the request originates from [URL] and not [URL] or what. I know it's an authentication issue because looking at it in fiddler it returns a 302 and redirects to the login page.

Here is my request:

[code]....

View 1 Replies

Javascript - JQuery Ajax Cross Domain Call And Permission

Feb 4, 2010

I have this polling script to check if a text file is created on the server. Works great locally, but fails when the file is on a different domain. How would i rewrite this for cross domain support?

$.ajax({
url: 'http://blah.mydomain.com/test.txt',
type: "GET",
success: function(result) {
//Success!
window.location.replace(Successful.aspx');
},
error: function(request, status, error) {
setTimeout("VerifyStatus(" + pollingInterval + ")");
}
});

EDIT: I ended up using YQL to solve the cross domain issue and although it works, YQL is really slow that's adding quite a bit of performance overhead. Can anyone suggest a better solution for cross domain JQuery calls?

View 3 Replies

Jquery - Why Same Domain Ajax Request Adding Jsonp Callback Parameter

Feb 25, 2011

I have a simple script making a request to the server:

var DTO = { 'path': path };
var url = 'default.aspx/Get';
var test;
$('#getInstance').click(function () {
$.ajax({
url: url,
type: 'POST',
dataType: 'json',
data: JSON.stringify(DTO),
contentType: 'application/json; charset=utf-8',
success: function (msg) {
test = msg;
},
error: function (jqXHR, textStatus, errorThrown) {
alert(textStatus);
alert(errorThrown);
}
});
});

This works fine as in it connects to the server and gets the data back, with one simple problem. It is treating this request as a cross domain request, therefore using jsonp. The server code is here:

[WebMethod]
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public static MyObject Get(string path)
{
MyObject foo = new MyObject();
return foo;
}

Normally this would not be a problem, except that I am accessing a WebMethod, and it doesnt have the capability to return a jsonp response (meaning it has no way to attach the callback function to the response. Now, if this was a manual response, I could hack it up and attach the parameter, but I am taking advantage of the built-in serialization, so no way to mess around with the response. [URL]

Let me just stress the fact that this code works. The only problem is jQuery treating this request as cross domain. But Why? UPDATE: Well, after many more hours and more testing I have narrowed this issue down to it being a bug in jquery 1.5.1. I did some testing with older versions (all 1.4 versions) and I had no problem, the request was made using JSON, and the response was received successfully. What could be the change they made that would consider this request a CORS?

View 2 Replies







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