Showing posts with label return. Show all posts
Showing posts with label return. Show all posts

Wednesday, March 28, 2012

Why it always return to the original place?

<asp:ScriptManager ID="ScriptManager1" runat="server" />
<cc1:DragPanelExtender ID="DragPanelExtender1" runat="server" TargetControlID="Panel1"
DragHandleID="Panel2">
</cc1:DragPanelExtender>
<asp:Panel ID="Panel1" runat="server" Height="300" Width="200">
<asp:Panel ID="Panel2" runat="server" Height="25" Width="200" BackColor="Black">
</asp:Panel>
Test</asp:Panel>

I would like the Panel1 can be dragged and stay the place where I drop it.

How to do that?

I believe the body of the page has to have been assigned some sort of physical dimension:

http://forums.asp.net/p/1150327/1874846.aspx

See point #23 and Listing 6 of this article:

http://aspalliance.com/1450_Working_with_DragPanel_AJAX_Control.4


Many thanks for replying.

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.

Monday, March 26, 2012

With all the webservices, what is the right way to handle security?

We need tell webservice what to return, if a webservice is a general one, we need pass paramters to it to tell what data it should return. I don't think it is a good idea to expose the parameters to clients. So I am think I will put some parameters for a webserice to session state. then give a GUID to webservice, with the GUID, the webservice can get the parameters from session state. But I found my webservice can not read the variable from session state. (they are on same site).

This really depends on the specific web service. If you are dealing with something that returns very public data (e.g. a weather service), then security is not much of a concern. But if your web service has the potential to fo bad things on the client, or return confidential data, you clearly have to be careful. Authentication is one way to deal with this.

David


Sorry, I forgot to address your other question. In order to use session, you need to use this attribute on the method:

[WebMethod(EnableSession = true)]


thanks.

I just need some guide from you, so I don't spend time on wrong direction.

As the EnableSession, I posted in another post. It doesn't work. The reason is I need put that on GetData, but GetData can not be override.

Please give me some idea, I really need it.