Showing posts with label load. Show all posts
Showing posts with label load. Show all posts

Monday, March 26, 2012

Visual Basic Examples Echo Name on web and in documentation down load does not work

I have done a clean reinstall of Visual Studio 2005, the SP1, The vs2005 Vista Update (Home Premium Vista), and IE 7.00..

One of the four Simple Web Service examples in the documentation download did not work, and as Mr. Murphy acknowledges, it's the one I am interested in.

I made sure not to touch any code .. just install and then debug..

http://localhost:49160/aspDocumentation/Samples/Sys.Net.SimpleWebService/vb/SimpleWebService.aspx

did not echo

This example also does on work on theasp website.

http://localhost:49160/aspDocumentation/Samples/Sys.Net.PageMethod/vb/PageMethod.aspx

did echo

http://localhost:49160/aspDocumentation/Samples/Sys.Net.SimpleWebService/cs/SimpleWebService.aspx

did echo

http://localhost:49160/aspDocumentation/Samples/Sys.Net.PageMethod/cs/PageMethod.aspx

did echo

Thanks!




Hi,

Can you tell me which documentation are you referring to?

Look forward to your reply.


http://ajax.asp.net/docs/tutorials/ExposingWebServicesToAJAXTutorial.aspx

Simple Echo works in C# but not in VB


Can you be more specific about your vb sample doesn't work? And how is it related to Vista?

It will be better if you canshow me a sample.


1. Go tohttp://www.asp.net

2. Click on AJAX.

3. You are now at the page titled:

"AJAX: The Official Microsoft ASP.NET AJAX Site

4. Click on "Docs"

5. Click on "Open The Online Documentation"

6. On The ASP.Net AJAX Roadmap page go to the fifth section titled "Web Services" and click

on the second item "Exposing Web Services To A Client Script"

7. On the top right side of the page select C# as the "Preferred Sample Language"

8. Go to the middle of the page to the paragraph that is titled:

Exposing Web Services to Client Script in an ASP.NET Web Page

9. At the bottom of the paragraph are two buttons, a run it button and a script button.

10. Click on Orange Button "Run It"

11. Enter your name and click on echo

12. close the "Simple Web Service" window

13. You have returned to the Exposing Web Services to Client Script in an ASP.NET Web Page

14. On the top right side of the page select Preferred Sample Language and select Visual Basic

15. Click on the same "run it" option that you did in step 10.

16. Enter your name and click on echo

17. Nothing happens.. Why?


Thanks for your clear explanation.

Now I've noticed it too, and I copy and paste the vb source code into a local project, it works.

And this sample should already give you an idea of how to expose webservice to client side.


You must be doing something in your local project setup, or your config file, or something.. why doesnt it work on the web?

In addition, when you download the "tutorial" the example, like the web, it does not work. Why?

If Microsoft has a "official" AJAX tutorial, one would think their examples would work. At least I think they should work..

Why does the C# example work and the VB example not work?

Could you locate the group that put together this "example" and tell them it doesnt work?

Thanks


Thanks for your feedback. I have checked the document and I found thatthe service entry registered in the ScriptManager has a invalid path.

<asp:ScriptManager runat="server" ID="scriptManager">
<Services>
<asp:ServiceReference path="SimpleWebService_VB.asmx" /> <%--should be SimpleWebService.asmx--%>
</Services>
</asp:ScriptManager>

To feedback this document issue in a formal way, could you go to our Connect portal site and submit it? http://connect.microsoft.com/ Every feedback submitted will be evaluated carefully by our engineers and document writers. They will let you know their comments further through that portal. It would be great if you can also paste the link to the submitted feedback here, so that other community members can see it as well.

Saturday, March 24, 2012

Want to let datagrid load after page_load (AJAX)

Hello,

I have a datagrid that gets its data from a stored procedure (executed using a data adapter). It is quite slow, so I want the page to load everything first, display it to the user, and then show a 'loading' message in the div where the datagrid resides while the data for it is being fetched. How can I do this using AJAX?

Regards,

Ahmed Zainal

If you put the grid in a panel (Panel A) and have a second panel (Panel B) with a loading gif.

Put a refresh button in with the grid in Panel A. Put both panels in an update panel.

In on page load do not load anything into the grid and set Panel A visibility to false and set Panel B visibility to true.

Create a method that handles the refresh buton on click event server side and add the code to populate the grid in it.

Wire up the update panel to show the loading gif panel when it does a partial page post back and hide it again when the postback response is recieved.

In javascript fire the on click event for the refresh button in the page on load event.

Hope that makes some sense. If not I can try and put some code togethrt for you tonight after work as an example?


Richard,

Thank you for your prompt response! Just one thing. when you say:

"In javascript fire the on click event for the refresh button in the page on load event."

How do I call the refresh on click event in javascript?


For a button declared as:
<asp:ButtonID="Button_Refresh"runat="server"OnClick="Button_Refresh_OnClickEventHandler"/>
JavaScript:
window.onload = init();
function init() {
__doPostBack('<%= Button_Refresh.ClientID %>','');
}
I think that should do it.

Try this http://dotnetslackers.com/articles/ajax/ASPNETAjaxGridAndPager.aspx

Hello

Sorry for the late reply. Internet was down on our lan since this morning!


I found a different method using an ajax timer. I set the interval to 1 millisecond and it calls the timer.tick event straight after the page loads. In the code, I set the enabled property of the timer to false so that it does not keep ticking. I also use an AJAX updateprogress control which displays the loading gif. This works great but I get another problem. I have another AJAX control that uses next and previous buttons to display news articles. If I click on one of these buttons while the datagrid is loading, the datagrid starts loading again but never binds!

Thank you and I really appreciate your help!



Hi

This could be anything, try implementing queuing. Some link below that might help:

Genral tips (Queuing half way down):http://www.codeproject.com/Ajax/aspnetajaxtips.asp

Async calling:http://forums.asp.net/p/1068907/1553801.aspx#1553801

Queuing class:http://www.cmarshall.net/MySoftware/ajax/index.html

Hope one of these helps.

Wednesday, March 21, 2012

Web service class undefined on Client load

Having tested a simple atlas web method call from the client which is fired by calling a javascript function on a button client side click event -it works perfectly.

The problem is I need this function called when the page loads, however whenever calling this function from either the body onload client side event or by using the RegisterStratupScript on the server side page load method, I get a javascript error refering to the web service class name as being undefined.

In theory this should work, Am I missing something regarding my understanding of the atlas lifecycle perhaps?

Please help!
Thanks

Dynamic script references (included in the References section of the ScriptManager) are not available until after page loading. To use these, you need to hook the Load event of the Application object. Declaratively, you can do this with:

<application>

<load>

<invokeMethod method="MyMethodName" />

</load>

</application>

Alternatively, you can statically include the service with a <script> tag.


A simpler syntax to do this is to have:

<application load="OnApplicationLoad" />

This goes into your <components>. So you would have something like this:

<script type="text/xml-script">
<page xmlns:script="http://schemas.microsoft.com/xml-script/2005">
<references>
</references>
<components>
<application load="OnApplicationLoad" />
</components>
</page>
</script>

David


BTW, I should mention that there is yet an easier way: just name your method pageLoad and it will be automatically called without having to be registered. See theAtlas docs for some examples.

David