connecting webservice using js/client side (not MS AJAX)

Hi all

I have a dynamic button, that on submit need to call webservice

I want to use

style="behavior:url(Script/webservice.htc)"

1. how can I add dynamic style when creating it?

SubmitRequestTextBox.ID = "SubmitRequestTextBox";

SubmitRequestTextBox.Text ="Submit";

SubmitRequestTextBox.Attributes.Add("OnClick", "GetWS()");

 

2.if I can't, I tried to put it in a div

<div style="behavior:url(Script/webservice.htc)" >

but I get an error msg

Error 4 Validation (CSS 2.0): 'behavior' is not a known CSS property name. \

 

thanks


0
urania
12/9/2008 11:19:40 AM
asp.net.getting-started 91979 articles. 3 followers. Follow

8 Replies
549 Views

Similar Articles

[PageSpeed] 59

Re 1): Can't you just do SubmitRequestTextBox.Style.Add("behaviour","url(Script/webservice.htc"); ?


If this answered your question, please mark as an answer so others will know too.

http://wyerarch.blogspot.com
0
Wyerarch
12/9/2008 12:27:43 PM

I did

I get an error msg

js runtime error

"service is undefine"

 

============

the error is in this function

I took from MSDN

http://msdn.microsoft.com/en-us/library/ms531034%28VS.85%29.aspx

function init()

{

service.useService(
"../GetAnswerFromDB.asmx?WSDL","GetAnswerFromDB");

iCallID = service.GetAnswerFromDB.callService("GetAnswer","5","6");

}

0
urania
12/9/2008 12:38:53 PM

In the example you have given "service" is the id of the div. In your example, I presume you need to reference the id of SubmitRequestTextBox?: i.e:

SubmitRequestTextBox.useService("../GetAnswerFromDB.asmx?WSDL","GetAnswerFromDB");

iCallID = SubmitRequestTextBox.GetAnswerFromDB.callService("GetAnswer","5","6");

I've never done webservices this way, but it seems a logical thing to try!


If this answered your question, please mark as an answer so others will know too.

http://wyerarch.blogspot.com
0
Wyerarch
12/9/2008 1:11:58 PM

Hi al

I have 2 problem

1. I doonno why it didn't work from the buttin. I get an error that ir doesn't know the buttin even though when I do "viewsource" I see the button with the correct id.

2.in the meanwhile I used div. seems the WS works, couse I put a breakpoint in it. the problem is I don't get the results from the WS.

when I use F10 I see the function in the WS return the correct results but I donno how to get them back to the client side..

thanks

==========

some code-parts taken from

http://msdn.microsoft.com/en-us/library/ms531033%28VS.85%29.aspx

function init()

{

// Establish the friendly name "MyMath" for the WebServiceURL

service.useService("GetAnswerFromDB.asmx?WSDL","GetAnswerFromDB");

 

// The following uses a callback handler named "mathResults"

iCallID = service.GetAnswerFromDB.callService(mathResults, "GetAnswer","5","6");

}

function mathResults(result)

{

// if there is an error, and the call came from the call() in init()

if(result.error)

{

// Pull the error information from the event.result.errorDetail properties

var xfaultcode = result.errorDetail.code;

var xfaultstring = result.errorDetail.string;

var xfaultsoap = result.errorDetail.raw;

// Add code to handle specific error codes here

}

// if there was no error

else

{

// Show the arithmetic

alert( result.value);

}

}

0
urania
12/10/2008 9:29:30 AM

Are you saying that the code that you are trying to use is that above?


If this answered your question, please mark as an answer so others will know too.

http://wyerarch.blogspot.com
0
Wyerarch
12/10/2008 9:42:16 AM
Is is based on the code above, but I am using my WS
0
urania
12/10/2008 9:53:40 AM

Well, if it is based on the example above, are you receiving the javascript alert? i.e. the result is displayed in a javascript popup?

If that is working, then to place it somewhere on the screen, do something like document.getElementById("targetIdOfATextField").value = result.value; to output the result into a textbox for example.

James.


If this answered your question, please mark as an answer so others will know too.

http://wyerarch.blogspot.com
0
Wyerarch
12/10/2008 12:05:53 PM

Hi James

my problem is that I don't see js alert

seems as even if the WS is working(I see it when I debug)

the js result function is not being called

thanks

0
urania
12/10/2008 1:00:38 PM
Reply:

Similar Artilces:

Using AJAX and client side scripting with .NET objects?
I'm wanting to use client-side scripting and AJAX with some drop down boxes.  I can't seem to do this with server-side .NET objects... changing the runat tag doesn't do anything either.  How can I expose .NET server objects so that they are affected by java script and AJAX? Depends on what, exactly, you're trying to do with them.  If you just need access to the html properties (e.g. selectedValue), then you simply grab them as if they were their html equivilants (select element) in javascript.  If you want to pass custom properties back and forth (or any .Net property ...

Connect MS SQL Server via Internret using TCP/IP in the client side
Can anyone show me the steps to connect MS SQL Server via Internet using TCP/IP protocol in the client side ? and How can I set the PB5 (Use native drive if possible) to connect this database. Please describe in details. Thanks Johnny Please reply to newsgroup directly or click the following email address. mailto://johnny@clarionsec.com Johnny, Here's what must be configured at the server: MS SQL Server is listening with the TCP/IP NetLib The server is connected to the Internet via a dial-up connection or router A firewall is not blocking SQL Server's TCP port ...

How to prevent SQL Native Client from using Server Side Cursor when connecting to MS SQL 2000
Hi. I am now trying to connect to MS SQL 2000 using SQLNCLI10 / SQLNCLI as Provider. I can connect to the database successfully but I observe that the sql native client generates sp_cursoropen, sp_cursorfetch etc even for a very simple select statement embedded in PowerScript. I think this will greatly impact the performance. I have found that the select statement becomes a single statement batch (no more sp_cursoropen etc) in the profiler trace if the database is changed to MS SQL 2008. How can I avoid it ? Add some setting to ProviderString in...

When To Use Client Side vs Server Side vs AJAX
Before AJAX, it was fairly clear to me where to draw the line between functionality best performed server-side vs client-side.  For example, database access and data processing is done on the server, and basic field validation and other UI stuff is done on the client.  But now with AJAX implemented through Atlas, the line is blured.  I know what can be done... but what is the optimal way to design a web application using Atlas (in terms of what functionality should be implemented server-side versus client-side versus Ajax)?  What is the prev...

When to use client side varidation and server side varidation in .net?
In .net or classic web application we can varidate user data either on client isde or server side. How to select which side varidate to be used? Thanks! Generally, I use both client and server validation. I make sure the input is in the correct format and reasonably valid on the client, then I verify the data on the server. The extent of validation also depends on the type of data that I need to validate.Here are a few references:Validating ASP.NET Server ControlsIntroduction to Validating User Input in Web FormsClient-Side Validation for ASP.NET Server ControlsSecurity Checklist...

How to use client-side script(javascript) in DNA using .Net Remoting
Hi all,     It was known that SAO and Singleton object about .Net Remoting. When I Create an object in server side and hosting in IIS's virtual directory,I want to use javascript asynchronous invoking the remote object by HTTP channel, 80 port and SOAP formatter just like XMLHTTP invoking web service. My code as following, <script> objXmlDoc = new ActiveXObject("Msxml2.DOMDocument"); objHttp = new ActiveXObject("Msxml2.XMLHTTP"); strEnvelope = ?? objHttp.onreadystatechange = function() { ...... }   szUrl = "http://ServerNa...

how do i get selectedValue of drop down list server side if i am populating it using client side javascript?
 Hi All.I am populating a drop down list client side using: The drop down list is populated based on a selection of another drop down list. ddlList.options[i] = new Option(1,2); as an exampleThe populating is done as i need it to. However, a button click event i am trying to get the selectedValue of the ddlList. However, it doesn't give me it. It only gives me the selectedValue of the drop down list on first rendering. Any ideas on how i can get it?   Could You paste some code? That would be helpful. Thanks S@ss (Shashi Shekhar Singh)My BlogPlease mark a post as ANSWER ...

How do I get started with AJAX.Net?
Hi All, I'm a seasoned asp.net developer but have not yet ventured into atlas et al.  I prefer books, but will take whatever I can get if it's good and will get me going. Any recommendations? Thx in advance. Jeff try here first http://ajax.asp.net/downloads/default.aspx?tabid=47 then learn from sample and docJames Wu (MIB426).NET is only way to goMCP, MCSE, MCDBA, MCSD, MCAD I find the materials online display features and implementations but are lacking architectural depth, and am seeking more comprehensive resources. By architectural depth, I mean that I cannot watch ...

Developed C#.net WebService 1.1 for Client C#.net 1.1. Getting error "Server was unable to process the Request" Pls Help
Hi., I developed Microsoft C#.net Web Services2003 for the Client Application C#.net 2003. When it runs in 5 machines it gives good performance and has no errors. But if i run the same application in about 80 client machines. Getting error "Server was unable to process the request". I use Sql Server 2005 as my database. I get error even when i login at a time for about 25 users. Tried modifying machine.config too. But went unsuccessful. Live Server is 2003 using IIS 6.0 I use very expensive data handling.  Its very urgent pls help. Have to post in Live Server. Thank u., ...

call webservice using javascript without using AJAX and webservice.htc?
HI,how can i call a webservice without using AJAX and Webservice.htc, using any protocols?Thanks.X you could skip using an AJAX framework and issue an xmlHttpRequest directlyhttp://en.wikipedia.org/wiki/XMLHttpRequestMike Banavige~~~~~~~~~~~~Need a site code sample in a different language? Try converting it with: http://converter.telerik.com/ Hi, thanks mbanavige.well, is there any disadvantage of using xmlhttprequest?and one more question can AJAX also work on other web servers than IIS like Apache? and is AJAX compatible with all browsers other than IE?how can i call a web servi...

getting IP address of the client using the webservice?
Hi,     I want to get the IP address of the client system whoever accessing my webservice? how can i do that using my webservice? Thanks in Advance, Rajak.  Try this :   string IP= HttpContext.Current.Request.UserHostAddress; Regards,Anas Ghanem.Note:Please Don't hesitate to click "Report Abuse" link if you noticed something wrong on the forums (like duplicate ,Off-topic,offensive,or any post that violates the website "TERMS OF USE"). -- Thanks! Hi Anas,    Thanks for your reply. It works. I want to know one more t...

Returning a gridview to the client side using a webservice
Here's what I'm trying to do.I build a web page with a gridview on it and the gridview is databound to a datatable. Using Javascript and Scriptmanager I call a webservice that adds a new row to my datatable and rebinding the gridview with my new dataset and retuning the HTML of the gridview to my page and refreshing my gridview with the new HTML. Everything works great so far.If I click on on of the items on my new row (such as a button) that does a postback .Net screams because it can't find a reference to this new button on that row. I understand why it's doing that, it&...

How i use Database Server Connection Client Side?
Hi. I need to use (share) Database server connection to client, i see some information, but it's confuse for me. (http://edn.embarcadero.com/br/print/38682 - Using server connections). Where i get "ServerConnection" sub-property? Where have to set it? Thank you. Download Bob Swart's white paper at http://www.embarcadero-info.com/in_action/radstudio/db.html. It provides a detailed explanation. -- Bill Todd (TeamB) Thank you for the reply, this paper have many usefull information, but don't answer my question at all. My problem is that. I have a mult...

how to consume a .net webservice using java client ?
Hi experts, I really need your help. I have create one .net webservice , it is really simple , the code is shown below .   [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [ToolboxItem(false)] // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. // [System.Web.Script.Services.ScriptService] public class Service1 : System.Web.Services.WebService { [WebMethod] public string HelloWorld() { ...

Web resources about - connecting webservice using js/client side (not MS AJAX) - asp.net.getting-started

Connecting rod - Wikipedia, the free encyclopedia
In a reciprocating piston engine , the connecting rod or conrod connects the piston to the crank or crankshaft . Together with the crank, they ...

COVER BOY: Dec. 15 Issue of ‘Time’ Features Mark Zuckerberg on Connecting the World
The cover of the Dec. 15 issue of Time features a familiar face — that of Facebook co-founder and CEO Mark Zuckerberg , the star of a long feature ...

Digital Media Wire - connecting people & knowledge —
dmwnews : Anomaly, the ambitious graphic novel by Brittenham and Haberlin, features augmented reality. http://bit.ly/Iwrxjr Already optioned ...

Connecting People to Brands and Products on Mobile
People come to Facebook not only to connect with friends and family but also with products and brands. Here's how we're making it easier to list ...

Papa John’s Connecting with 200,000 Fans on Facebook
More brands are engaging with Facebook’s 150 million users through Facebook advertising solutions and the Facebook Platform, patterns of best ...

Home - WHLT 22 Connecting the Pine Belt Fan
Facebook is a social utility that connects people with friends and others who work, study and live around them. People use Facebook to keep up ...

US IT Staffing Recruiters Group - Connecting Ideas !
US IT Recruiter's Groups: IT Technical Recruitment. Its all about connecting to new Ideas !

Clowdy - Connecting Creatives with Music, Film & Photos on the App Store on iTunes
Get Clowdy - Connecting Creatives with Music, Film & Photos on the App Store. See screenshots and ratings, and read customer reviews.

Connecting a Relay to Arduino - Flickr - Photo Sharing!
Simple circuit to connect a 5V relay to one of the digital output pins of the Arduino. I drew this after a few threads showed up on the Arduino ...

Evidence Connecting Scott Roeder to Operation Rescue Found in Roder's Car - YouTube
Rachel Maddow unveils video evidence from KMBC TV in Kansas City of a note found in Scott Roeder's car at the time of his arrest for the murder ...

Resources last updated: 11/29/2015 9:22:25 PM