Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3393574
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T04:04:00+00:00 2026-05-18T04:04:00+00:00

I have written a sample web service, which consist of certain .aspx pages. I

  • 0

I have written a sample web service, which consist of certain .aspx pages. I have written a code to consume webmethods from that web service.

Now, is it possible to load the aspx page which is a part of the web service from the calling web application i.e. from another aspx page which is outside the web service.

How this scenario is;

1. I have one web application running with a page say Page1.aspx in browser.
2. I have created a web service which is having an aspx page say Page2.aspx.
3. There is a button on Page1.aspx.
4. Now, when client click on the button, is it possible to load Page2.aspx, which is not a part of web application, but the web service.

Please help me out in this scenario. I searched on google, but not getting proper fix.

Sample code which I have written;
Web Service Method;

           [WebMethod]
           public string WelcomeUser(String _userName)
           {
               return "You are Welcome : " + _userName;
           }

Consumer web application;
Default.aspx is the startup page. Its load event is like;

           WebRequest request  = WebRequest.Create("http://localhost:1741/HelloWorldConsumer/gen.aspx");
           //If required by the server, set the credentials.
            request.Credentials = CredentialCache.DefaultCredentials;
           //Get the response.
            HttpWebResponse response  = (HttpWebResponse)request.GetResponse();


            // Get the stream containing content returned by the server.
            Stream dataStream  = response.GetResponseStream();
            // Open the stream using a StreamReader for easy access.
            StreamReader reader = new StreamReader(dataStream);
           //Read the content.
            String responseFromServer  = reader.ReadToEnd();

            Test.InnerHtml = responseFromServer;
            //Cleanup the streams and the response.
            reader.Close();
            dataStream.Close();
            response.Close();

Gen.aspx is the one who communicates with web service. Its page load is;

         HelloWorld.Service _objHello = new HelloWorld.Service();
        _objHello.WelcomeUser("Guest");

What I am trying to do is, get response obtained in Gen.aspx and pass it to default.aspx page.
Can anyone help me to achieve this?

Thanks in advance.

Regards,
Vijay

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T04:04:01+00:00Added an answer on May 18, 2026 at 4:04 am

    When you say aspx page being part of web service – what do you mean by that? Assuming that its a normal page that when invoked via HTTP GE/POST, responds with HTTP response with some content type (html, xml etc), you can use WebRequest (or more specifically HttpWebRequest) call. See this article for quick start.

    Besides you have another helper class called WebClient that may help you in this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written a simple WCF web service in C# which returns records from
I have written this code which accesses the Delete method on Web Service x,
I have written a simple HelloWorld web service. Which takes an ArrayList as parameter.
I have a REST web-service interface that calls-down to a service layer which orchestrates
I have a prototype application (RESTful web service database front-end) that is written using
I have written a simple WCF web service which is configured programmaticaly. It exposes
I have written a simple web Application which is running(on Tomcat Server) fine on
Below I have written a sample program that I have written to learn about
I have written grammar for a language (sample code below) //this is a procedure
I have written simple code to get content from xml file to php. $xml

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.