On Mon, Oct 18, 2010 at 2:09 PM, Anthony <[email protected]> wrote:
> Is it possible to have a button submit to another page using get?
>
> I have an asp.net page with many button, textboxes...but  when you clkick
> the search button i want it to submit textboxKeywords to another page using
> get ?
>
> I know i can postback to another URL using <asp:ImageButton
> PostBackUrl="~/search.aspx" ImageUrl="/searchbutton.jpg"  ID="ImageButton1"
> runat="server" /> but how do change method to GET and specify which field to
> send?
>
> Bascially when you click the search button i want it to redirect to
> search.aspx?query=<query>
>
> I am assuming that this must be done in code behind?

Well, consider that your entire page is probably within a form. So,
according to HTML you can't havev one form inside another, and
according to Webforms, you can't even have two <form runat="servers">
...

So, all this means is your search box needs to be in it is own
non-asp.net form, just:

<form method="/search" action="get">
 ...
</form>

It's been a while since I've written "ImageButton", but I'm pretty
sure it will perform the submit on any form it is inside of. Give it a
crack, and let me know if it doesn't work. It should (or some minor
variant).


> Is your website being IntelliXperienced?  | www.yougoingmyway.com ?
> regards
> Anthony (*12QWERNB*)
>
> Is your website being IntelliXperienced?

-- 
silky

http://dnoondt.wordpress.com/

"Every morning when I wake up, I experience an exquisite joy — the joy
of being this signature."

Reply via email to