Your best source of information and news about vista, windows and secrets on the internet

Vista ARTICLES TOP 50 Spyware Virus Vista SOFT Vista HELP

ASP.NET

You are currently browsing the articles from MS Windows Vista Compatible Software matching the category ASP.NET.

EventValidation Error

This killed me for a while. I had an ASPX (Master) page that includes some headers and footers from legacy ASP pages (reusability, maintainability). Those ASP pages were so badly designed to embed multiple forms and each forms within that does HTTP POST. So messy that I even thought of rewriting those whole headers and footers but I can’t since that will leave us with 2 sets to maintain.

When I started using the headers and footers in the ContentPlaceholder in my Master Pages it kept complaining about this error,

Invalid postback or callback argument.  Event validation is enabled using <pages enableEventValidation=”true”/> in configuration or <%@ Page EnableEventValidation=”true” %> in a page.  For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them.  If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.

After looking around for help there was nothing that lead me to a solution. Accidentally I found out by myself that it was because of the embedded <form>s that it complained. After working around with those forms to make sure that only one <form> get rendered on the final ASPX the problem got resolved. Hope it does help some of you who might be looking for a solution to this error.

Written by askars on July 17th, 2007 with 1 comment.
Read more articles on Misc and howto and ASP.NET and .Net and Tips and Tricks.

Overloading Web Methods

It’s been a while since I got a chance to blog. Work and life was so busy to do anything other than those. Anyway, I’m back to my blogging habit and I hope to contribute the useful ones. To begin with,

How do you overload a web method?

You know you can leverage the OO concept with the web methods as well but once you try it out you’ll realize that it is not a straight forward ride. You have to tweak some of the header settings to let that happen. Here are the ones you have to tweak,

  • WebServiceBinding
  • MessageName

You have to make the WebServiceBinding conforms to WsiProfiles.None. And then you have to specify a Message Name so that you can distinguish between the overloaded methods in a descriptive way.

Here is an example,

[WebServiceBinding(ConformsTo = WsiProfiles.None)]
[WebMethod(MessageName = “Method1″, Description = “Description for Method1″)]

public string Method1(string input)

{    // implementation here    }

 

[WebServiceBinding(ConformsTo = WsiProfiles.None)]
[WebMethod(MessageName = “Method2″, Description = “Description for Method2″)]

public string Method2(string input)

{    // implementation here    }

tags: , , , , , ,

Written by askars on June 16th, 2007 with no comments.
Read more articles on .NET Framework 2.0 and Code Samples and howto and ASP.NET.

No older articles

Newer articles »