Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display webpage after HTTP POST to a webmethod

Status
Not open for further replies.
Jun 1, 2004
18
GB
Hi,

I have created a webservice with a web method that inserts data into a database...

[WebMethod]
public ????? addRequest(string title, string initial, string surname)
{
.... do a bit of SQL ...
return ????? ;
}

I'm accessing this service via a form in a web page using an HTTP POST.

What I want is, once the data has been added, to go to a static web page that says something along the lines of:

"Nice one fella! Your request has been added. Click here to go back to home page."

...or...

"Unlucky! Something went wrong. Click here to have another bash."

So how do I do this? I've been looking at serialising the HTML in the page, returning a link to a page etc but can't find the way.

Is using a webservice the wrong approcach here? If so, what is the correct one?

Thanks for your help!
Sam
 
It's a pretty interesting article but not quite what I'm looking for.

I need synchronous access that results in either a redirection or HTML content that is dependent on the sucess of the SQL statement.

I also specifically want to used HTML files that are already stored on a server: I _don't_ want to build the HTML programmatically.

Any other tips?
 

Right - well. This post has been dead for a while but I'm interested.

The reason the post went quiet is because you've confuzzled it. I tend to find that if you say something that needs a little bit in-brain translation because you've not quite put it right your thread dies.

I've deicided to make a point of ressurecting posts like this and asking for a bit of clarificatio - so:


A WebService is generally involved in broadcasting a service to the world as a whole (or hole, these days). At the very least it is designed to send data from one server to another . If you are working on the same server and trying to implement this then just use a good old class - no service involved.

Now - if you ARE trying to use this from one server to another - that's a different kettle of fish. Then I'd need to know exactly what you're trying to do.

A web service is best accessed from within a really good editor that takes all the hastle out of it. Just create your service, add a web reference to your service in a project and haway you go. I use something very similar for inserting records into a company-wide hit counter (we manager the statistics of all our clients centrally - good for marketing ;) )

If you solved this problem - please tell us how.
If you still need help - enlighten us on what you need.


Yet another unchecked rambling brought to you by:
Oddball
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top