Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 301
  • Last Modified:

Adding a Web Reference to Inline code

I'm not sure if I'm phrasing this right, but for reasons not in my control I need to convert a VB.NET code-behind project to straight inline aspx code. Where all the code is inline in the page like classic ASP. My problem is that my project has two web references added to it. In VS.Net I just added them by using the gui and typing in the url for each. How do you add those to an inline page code?  

Any links or sample code in the right direction would be great.

Thank you.
0
greddin
Asked:
greddin
  • 3
  • 3
1 Solution
 
Bob LearnedCommented:
<%@ Import Namespace="System.IO" %>

Bob
0
 
greddinAuthor Commented:
Can you be a little more specific Bob?

How do I add the web references to inline code?
0
 
greddinAuthor Commented:
I'm wondering if I can just cut and paste the constructor from the generated proxy class and add it to the top of my web form?

0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
Bob LearnedCommented:
I am sorry for being too brief.  

This applies to ASP.NET 1.1 (2003):
Since the System.IO is part of the .NET framework, all you need to do is add that reference to the top of the page file.  If you were trying to add a reference to an external library, you would need to copy that DLL to the bin folder.  

I am not sure about where the file gets copied for ASP.NET 2.0, but the directive at the top of the file is still the same.

Bob
0
 
greddinAuthor Commented:
Yes, this is ASP 1.1, but I don't understand what the System.IO namespace has to do with a web reference.

In the webform can you give me a snippet of syntax so I can understand this better?

Thank you,
-Greg
0
 
Bob LearnedCommented:
(Smackin' head--d'oh)  Web reference, web reference, web reference...  I thought you meant DLL reference.  No where did I see web reference to a web service.

Here is a document that describes the process pretty good:

http://docs.msdnaa.net/ark_new3.0/cd3/content/Books%5CAcademico%5CMicrosoft%20course%20-%20Chapter%2013.doc

The IDE does a lot of magic when you add a web reference, and I haven't thought about the steps outside of that context.  You need to generate some code, using wsdl and other utilities.  

This is not an easy question to answer in the context outside of the IDE, so be patient with me.

Bob
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now