Showing posts with label cant. Show all posts
Showing posts with label cant. Show all posts

Wednesday, March 28, 2012

Why my web services cant accept parameter?

When my javascript call the echoString(s) in the following code, it return nothing

<%@dotnet.itags.org. WebService Language="C#" Class="WebService" %>

using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;

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

[WebMethod]
public string echoString(string s) {
return s;
}

}

The strange things are my .NET program works fine with the code above and my javascript client program doesn't work with the code above but works fine with other people's web services. EX:

http://www.mssoapinterop.org/asmx/simple.asmx?op=echoString

What is wrong with my code? Thank you!!!!!!!!!

asdpai:

what is wrong with my code?

nothing, code is correct. Decorate youre WebService with theSystem.Web.Script.Services.ScriptService() and the WebMethode with the ScriptMethod() attribute eg.

<%@. WebService Language="C#" Class="WebService" %>

using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
usingSystem.Web.Script.Services;

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

[ScriptMethode()]
[WebMethod]
public string echoString(string s) {
return s;
}

}

Hope that coul help.

why now i cant use the namespace Sys.Data

How i can create a datatable in javascript to pass to a webmethod now if the namespace Sys.Data is removed?

Thanks

Just add the Preview version.

Why web robots cant request aspx pages in Ajax project ?

When Icreate aspx pages in Ajaxproject googlebot, yahoo-slurp and other crawlers can’t see these pages.

I’vecreated two test sites to show the problem:

Pagewithout Ajax:http://test.cky.pl/noajax/Default.aspx

Page with Ajax:http://test.cky.pl/ajax/Default.aspx

In browserI can see both of these pages. But when I try to saw what web robot can seewhen it requests my page (I was using this page and other tools (result wasthis same):http://www.smart-it-consulting.com/internet/google/googlebot-spoofer/index.htm

For Ajax page I was gettingerror massage:Invalid URL or serverdoes not respond, HTTP return code: 500

For normalaspx page everything is ok.

If someone couldshow me solution for this problem and could explain me why robots can’t requestAjax pages Iwould be very thankful.

Have you found a solution for this yet? I also noticed the same problem. If you point the W3C link validator at an AJAX site, it just says HTTP 500 internal server error. You get the same problem if you use an link checking package such as Xenu. If you view the page in your browser, it's fine.

This concerns me as I'm heavily involved in SEO - will Googlebot see the same and not index the site...


OK, found a workaround. Add this to Page.Init:

if (Request.Browser.Crawler ==true || Request.Browser.W3CDomVersion.ToString() !="1.0" || Request.Browser.Type.ToString().Contains("Opera")){ ScriptManager1.EnablePartialRendering =false;}else{ ScriptManager1.EnablePartialRendering =true;}

Thanks a lot, it's helps.

Monday, March 26, 2012

Willing to bet money that you cant figure this out!

I am working on this app... I have an iframe (hidden) in the app, and an image (also hidden) that eventually gets put into the iframe for printing.

My javascript is thus...

var img = "ctl00_ContentPlaceHolder1_cpnImage";
var daframe = document.getElementById("cpnframe");

document.getElementById("cpnframe").width = document.getElementById(img).width + "px";
document.getElementById("cpnframe").height = document.getElementById(img).height + "px";

frames[daframe].location.href = document.getElementById(img).src;
frames[daframe].focus();
setTimeout('frames[daframe].print()',10);

Now, when I run this on a regular HTML page, it works fine...

In my asp.net page, I get javascript errors stating that frames.cpnframe has no properties.

What gives?

What does the iframe look like in the HTML code generated by the ASP page compared to the HTML code in the regular HTML page where it works?


I believe it's in how you are referencing the frames. This article explains how to access frames properly.

http://www.quirksmode.org/js/frameintro.html


The iframe is the same either way. It not server side. I have looked at the page source on both and they are identical...

Very strange!