473,408 Members | 2,477 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Reference in .aspx file causes server error

Hi there,
I have a Web Application that uses a reference to a localhost
web service. If however, I try to insert C# code blocks into the .aspx file
I get an error when the application runs because localhost is unknown.
Anyone know how to use a reference in a code block?
Jun 27 '08 #1
4 1024
On Jun 4, 4:44*pm, "Waldy" <some...@microsoft.comwrote:
Hi there,
* * * * * * *I have a Web Application that uses a reference to a localhost
web service. *If however, I try to insert C# code blocks into the .aspx file
I get an error when the application runs because localhost is unknown.
Anyone know how to use a reference in a code block?
did u check the webservice first? .
Jun 27 '08 #2

"Geek" <ka*********@gmail.comwrote in message
news:41**********************************@z16g2000 prn.googlegroups.com...
On Jun 4, 4:44 pm, "Waldy" <some...@microsoft.comwrote:
>did u check the webservice first? .
Yes, the web service is fine. It works in the code behind file, but not in
a code block. Is this a known limitation of ASP.Net?


Jun 27 '08 #3
I noticed that the Web Service reference does not colour the class name in
the code block like it does in the code behind file. I appears as though
the code blocks are not in the project namespace. If I add the namespace to
the reference like so,

MyNameSpace.localhost.TheWebService

the class name part becomes coloured, but it now crashes with a different
error:

Cannot create/shadow copy 'LogCall' when that file already exists
Jun 27 '08 #4
The cannot create/shadow copy ... error message was a red herring. It went
away after I did a Clean and Rebuild.
So to sum up, if you need to access a web service in an .aspx code block,
you need to qualify the webservice name with the namespace name where the
reference has been added.
Jun 27 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: mnmnm1951 | last post by:
I am working with Sharepoint Services and am trying to add the fileversion Metadata to the Versions.aspx page using the example from the SDK. I have not done much with hashtables but it all looks...
6
by: Binoy | last post by:
Hello, I am getting this error once in a while from my web sites. When I will refresh web browser, it goes off and sites are working fine. Directory structures and file names are as below- ...
5
by: Greg Collins [MVP] | last post by:
I have an ASP.NET page that uses a tag: <asp:Xml id="foo" runat="server" DocumentSource="rss.xml" TransformSource="rss20.xsl" /> This creates a Web page from an XML file that was generated by...
1
by: Guadala Harry | last post by:
Suppose two different servers (two different physical machines - no clustering or farming going on here) on the same network: 1: Web Server (2003/IIS6) 2: SQL Server .... and an ASP.NET Web...
11
by: Jerome | last post by:
I keep getting this error!? It seems like the code can't find the control? Here's my code: --------------------------- <%@ Page Language="VB" ContentType="text/html" %> <%@ import...
7
by: Andrew Mercer | last post by:
I am getting the above error when attempt to set the src, height and width of an iframe in C# code. I am using this as an attempt to dynamically alter the image displayed in the iframe tag of an...
8
by: Charlie J | last post by:
I have a real stumper. I added a server side table to a home page that has two other server side tables on it that have been working great. In Visual Studio everything works great. When I put...
3
by: SAL | last post by:
I am getting the following ERROR in my WebApp on line 30: Server Error in '/TestWebApp' Application. -------------------------------------------------------------------------------- Object...
6
by: David Lozzi | last post by:
Hello there, I'm getting the following error System.NullReferenceException: Object reference not set to an instance of an object. at shopping_bag.GetBagTotals()
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.