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

Wednesday, March 28, 2012

Control ID Changed and GetElemntByID Return NUll

I have this code

<asp:UpdatePanel ID="UpdatePanel3" runat="server">
<ContentTemplate>
<asp:TextBox ID="TxURL" runat="server"></asp:TextBox>
<asp:Button ID="Test" runat="server" Text="Button" OnClick="Test_Onclick" />
</ContentTemplate>
</asp:UpdatePanel>

I try to run this script

var TextControl= document.getElementByID("TxURL")

or

var TextControl = $get("TxURL")

but return value is NULL.

so How, to get Item in Client with the orignal Name. not the generated Name

Thanks.

U may be using Master Pages or UserControl thats why the client id of the control are not the same which u give to the control on the design time

try to run this script

var TextControl= document.getElementByID("<%= TxURL.ClientID %>")

or

var TextControl = $get("<%= TxURL.ClientID %>")

Wednesday, March 21, 2012

Concurrency and EnableSession

Hi all.
I'm writing a web service to return data to a web page that use ajax to manage it.

I use the property EnableSession in WebMethod to enable the session and manage my authenticated user.

The problem is that my web service doesn't handle concurrent request and queue them.


Is there a way to make them concurrently?!

Thanks in advance.
Stefano

It is probably my two requests try to access to the same session object and cannot do it.

But this is what i wanna do!

Is there a workaround??

Thanks
Stefano


Solved it myself.

I created a application variable hashtable in wich i store SessionId and the id of the current logged in user.
In every web method i pass one new parameter that is SessionId.

Bye!
Stefano

complex return type

Hi all,

I have a WS that takes in simple parameters (decimal) and returns a complex type (custom object). I have tested the WS through a regular .aspx page and it works fine.

Now when I invoke through Atlas Javascript, I dont get any errors but my OnComplete method never gets called. Any ideas? How can I debug? I checked the IIS logs and it shows the post being made to the WS.

TIA!

Is this the same scenario as in your other post? Using fiddler can be very helpful to debug such issues. Also, make sure you have an onError handler registered in addition to your onComplete.

David


Yes, what it boiled down to was if I passed in a decimal type, for some reason the WS wouldnt work. I had to change Decimal to double and it worked.

What is fiddler and where do I get it?


Fiddler is an excellent tool that lets you look at http requests/responses so you can see what's going over the wire. You can get it fromhttp://www.fiddlertool.com/.
Would I install it server side/ client side or both?

Client side. It works by registering itself as an http proxy in the browser. It works automatically with IE, and can also work with Firefox with some manual configuration.