Submit button not working on a method="get" form after DataBind

M

martyn_wynne

Hi,

I have found a odd one, my submit button is not submitting on a
method="get" form after using any form of DataBind?

Has anyone struck this problem before?

here is snipits of the code as an example

<form id="frmUserSearch" method="get" runat="server">
<asp:DropDownList ID="listBrokers"
Runat="server"
DataSource="<%# dvBrokers%>"
DataTextField="BrokerName"
DataValueField="BrokerID" />
<input type="submit" name="search" value="search">
</form>


private void Page_Load(object sender, System.EventArgs e)
{
Brokers brokers = Methods.GetBrokers(login);
dvBrokers = new DataView(brokers.Broker, "", "BrokerName",
DataViewRowState.CurrentRows);
//listBrokers.DataBind();<- including this is the problem
listBrokers.Items.Insert(0, new ListItem("", ""));
}
 
G

Guest

You are circumventing .NET, so it is understandable once you understand how
..NET works.

When you add a server side button to a form, .NET writes out some JavaScript
to capture the form submit and send it to the proper event handler on your
form. If you switch to GET, you are potentially interfering with this
process. If you truly desire a GET, you will have to handle more of the
coding yourself.


---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 
M

martyn_wynne

Hmm, I've into it further, and DataBind seems to be a read herring. If
i limited the numbers of brokers to around 90 it worked! It appears it
is the length of the ViewState, so you are right in a way. Using GET,
it still tries to send the ViewState in the query string an the Browser
(IE) must refuse to submit when the Querystring is just too long.
Having
enableViewState="False" in the page declaration solved this. So it is
possible if you want to be bothered working with out viewstate.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top