p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > ASP.NET and ASP > ASP.NET 3.5 > BOOK: Professional ASP.NET 3.5 AJAX ISBN: 9780470392171
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional ASP.NET 3.5 AJAX ISBN: 9780470392171
This is the forum to discuss the Wrox book Professional ASP.NET 3.5 AJAX by Bill Evjen, Matt Gibbs, Dan Wahlin ; ISBN: 9780470392171

Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET 3.5 AJAX ISBN: 9780470392171 section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 22nd, 2009, 04:25 PM
Registered User
Points: 8, Level: 1
Points: 8, Level: 1 Points: 8, Level: 1 Points: 8, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Question Creating a Simple Web Page with AJAX 1st example

Coded the 1st example and can't get past the error on Public string HelloWorld()

I keep getting a compile error "The type or namespace name 'String' cpould not be found (are you missing a using directive or an assebly reference?)

I code VB. What am I missing?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old April 22nd, 2009, 04:37 PM
Registered User
Points: 9, Level: 1
Points: 9, Level: 1 Points: 9, Level: 1 Points: 9, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2008
Location: Huntley, IL
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Skype™ to namyaf
Default

Without seeing your code and if you are using VB, you'll probably want something like the following:

Code:
Public Function HelloWorld() As String
   Return "Hello World"
End Function
Also, you may be doing a lot of converting because I think most of the book, if not all, uses C#.

-bob
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #3 (permalink)  
Old April 23rd, 2009, 09:17 AM
Registered User
Points: 8, Level: 1
Points: 8, Level: 1 Points: 8, Level: 1 Points: 8, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Creating a Simple Web Page with AJAX 1st example

I coded it C# as in the book.

using System.Web.Services;
[
WebService(Namespace = "http://tempuri.org/")]
[
WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
// [System.Web.Script.Services.ScriptService]
publicclassWebService : System.Web.Services.WebService
{
[
WebMethod]
publicstring HelloWorld() {
return"Hello Ajax World!";
}

}

I am now getting a different error:

The following operations are supported. For a formal definition, please review the Service Description. This web service is using http://tempuri.org/ as its default namespace.

Recommendation: Change the default namespace before the XML Web service is made public.

Each XML Web service needs a unique namespace in order for client applications to distinguish it from other services on the Web. http://tempuri.org/ is available for XML Web services that are under development, but published XML Web services should use a more permanent namespace.
Your XML Web service should be identified by a namespace that you control. For example, you can use your company's Internet domain name as part of the namespace. Although many XML Web service namespaces look like URLs, they need not point to actual resources on the Web. (XML Web service namespaces are URIs.)
For XML Web services creating using ASP.NET, the default namespace can be changed using the WebService attribute's Namespace property. The WebService attribute is an attribute applied to the class that contains the XML Web service methods. Below is a code example that sets the namespace to "http://microsoft.com/webservices/":
C#
[WebService(Namespace="http://microsoft.com/webservices/")]public class MyWebService { // implementation}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #4 (permalink)  
Old April 24th, 2009, 09:59 AM
Registered User
Points: 9, Level: 1
Points: 9, Level: 1 Points: 9, Level: 1 Points: 9, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2008
Location: Huntley, IL
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Skype™ to namyaf
Default

I think what you are doing is running the web service and not the Default.aspx page. So, in Visual Studio, right-click on the Default.aspx page and select "Set As Start Page" and then run your project in Visual Studio.

Also, what you list in your post is not an error. This is a testing feature in Visual Studio to test your web service.

Let me know if this helps!

Bob
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
1st Book, 1st exercise, 1st disaster homedeeth BOOK: Beginning ActionScript 2.0 0 July 14th, 2008 08:30 AM
creating a web page with multiple search criteria ktsis ASP.NET 1.0 and 1.1 Basics 2 May 19th, 2006 07:01 AM
New Ajax article: Creating an Ajax Search W jminatel BOOK: Professional JavaScript for Web Developers ISBN: 978-0-7645-7908-0 1 May 11th, 2006 04:45 PM
new Ajax article: Creating an Ajax Search Widget jminatel Ajax 0 May 11th, 2006 03:50 PM
creating pdf of web page on the fly ghari ASP.NET 1.0 and 1.1 Basics 1 December 12th, 2005 04:27 PM



All times are GMT -4. The time now is 12:17 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc