Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / July 2007

Tip: Looking for answers? Try searching our database.

WebService fails inside ASP 2.0 website

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sergey Poberezovskiy - 13 Jul 2007 09:18 GMT
In my ASP.Net 2.0 website I defined base page type in web config as follows:
<pages MaintainScrollPositionOnPostback="true" pageBaseType="base_Page" />
It all works fine for the pages.

Now I am adding webservices to the site - I use the same business objects
and authentication/authorization.

The code behind the webservice is trivial:

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class MyService : System.Web.Services.WebService
{}

The problem is that when webservice is initiated, the compiler is trying to
inherit my webservice from base_Page class - and obviously fails with the
following error:
"The MaintainScrollPositionOnPostback page directive cannot be set without
an htmlform."

The whole website compiles without any errors - I only receive this error
when I attempt to call the service...

How can I prevent my asmx webservice to attempt inheriting from base_Page
which inherits from System.Web.UI.Page - as I specifically defined my
webservice type????

Any help is greatly appreciated.
Teemu Keiski - 13 Jul 2007 11:15 GMT
Hi,

issue occurs when you try to open the asmx in web browser since it is the
test page which asp.net runs behind the scenes, it does not have server-side
form only but when you use HTTP POST with the test form

You'll find the file which is run by ASP.NET by looking at
DefaultWsdlHelpGenerator.aspx on
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG

Simple way to get past this is to set MaintainScrollPositionOnPostBack on
page directives directly.

Signature

Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net

> In my ASP.Net 2.0 website I defined base page type in web config as
> follows:
[quoted text clipped - 26 lines]
>
> Any help is greatly appreciated.
Sergey Poberezovskiy - 16 Jul 2007 01:26 GMT
Thank you Teemu - it was it - it also occurs when I try to (web) reference
the service from another project.
As per your other post, I had to remove page-specific code from the site
web.config - and them I could reference the service.

> Hi,
>
[quoted text clipped - 39 lines]
> >
> > Any help is greatly appreciated.
Teemu Keiski - 13 Jul 2007 11:21 GMT
To add, if you use web service with the direct call to the web method, it
works just fine. E.g it is basically the test page which blows up, not the
service itself. You can confirm this by turning the
maintainScrollPositionOnPostBack in web.config to false and run the test.
Take the URL of the web service call (the newly opened window). Then put it
back to true in web.config and reopen that URL, you'll note the service
works just fine.

Teemu

"Teemu Keiski" <joteke@aspalliance.com> wrote in message news:...
> Hi,
>
[quoted text clipped - 41 lines]
>>
>> Any help is greatly appreciated.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.