Wednesday, March 21, 2012

Html button in .ascx

I have started to use Google AdSense, but the Google-search part of this which is a piece of html code that I've put into a user control don't work properly. I can add a search string, but when I press the search button I'm returned to the originating page and not to google. The same thing occurs with a similar PayPal script.

Is there a problem due to that this is html and not controls? Should I add a runat server? (when you get the html it says that you shouldn't modify it in any way).

/RaymondThe situation to me seems a bit vague, can you explain more and clarify more please ?

regards
by default, all ASP.net form post back to themselves. This behavior will be changable in .NET 2.0.

if you need to post to another server, you should add another set of form tags OUTSIDE of the .net runat=server form.

That "regular" form can be pointed at a different server.

This of course means that your idea to put this into a usercontrol wont work as usercontrols must exist INSIDE the runat=server form.
Hmmm...OK, this must be the problem.

Is there any workaround (while waiting for 2.0)?

/Raymond
This is exactly what you need:

Posting form data from ASP.NET page to another URL

regards

No comments:

Post a Comment