Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
Hi,
 
In my application i have Search button for Search Order. When i enter the Order no and order type and click submit button then it shows the documents for that order no.But,The Problem with the application is when i click the Search button simultaneously it replicates the data.I want to avoid the replication of the data on multiple button click.
 
Thanks,
Umesh Tayade
 
<Button Content="Search"  Margin="5,0,0,0" Height="21" Width="100" Grid.Row="0" Grid.Column="9" HorizontalAlignment="Left" VerticalAlignment="Center" Style="{StaticResource grayButton}" x:Name="btnSearch" Click="btnSearch_Click"/>
 

private void btnSearch_Click(object sender, RoutedEventArgs e)
{
   if (IsValid() && isLineValid)
   {
      if (null != multiDocViewModelConnector.ViewState && multiDocViewModelConnector.ViewState.FilterDescripter != null)
                    multiDocViewModelConnector.ViewState.FilterDescripter.Clear();
      __searchCriteria();
   }
  }
Posted 22-Jun-11 3:48am
Edited 22-Jun-11 3:58am
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 6

Try this
 
<asp:Button runat="server" ID="BtnSubmit"
 
  OnClientClick="this.disabled = true; this.value = 'Submitting...';"
 UseSubmitBehavior="false"
 
  OnClick="BtnSubmit_Click"
 Text="Click Me Once!" />
 
Cheers,
Balaji
  Permalink  
Comments
thatraja at 16-Jul-11 23:09pm
   
5!
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Here is one Simple Solution... Just Try It..
 
--> Inside btnSearch_Click Event Mention
btnSearch.Enabled = false
--> Use One more Button "Clear"
--> And Inside btnClear_Click Event Mention
btnSearch.Enabled = true
  Permalink  
Comments
Member 4550493 at 23-Jun-11 5:09am
   
Hi All, Thanks for replying but i want the solution for silverlight because OnClientClick event is not available foe Button control in silverlight.Also, I hav tried for IsEnabled=True and IsEnabled=False property but its not working.Please provide solution for silverlight as i have provide my code with this Question.As you have mentioned to do IsEnabled=false in SearchButton Click Event and Enable it on clear button click Event but thats not the perfect solution because it is not compulsory to click clear button after clicking the Search button.beacause he can enter the different order no.Waiting for Reply.
Thanks,
Umesh Tayade
thatraja at 16-Jul-11 23:09pm
   
What's wrong with these answers, Don't know why downvotes for these, Counter 5!
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Use a regular HTML button, including a Runat="server" and an 'OnServerClick' event designation - like this:
 
<INPUT id="Button1" onclick="document.form1.Button1.disabled=true;" type="button" value="Submit - Insert Data" name="Button1" runat="server" onserverclick="doInsert">
 
Then, in the very last line of the 'doInsert' subroutine, add this line
 
Button1.enabled="True"
.
  Permalink  
Comments
JV9999 at 22-Jun-11 9:37am
   
This does not prevent double clicking, because there still can be a large time window in which the button can be double clicked and believe me: users are able to do that without any problem.
 
Even worse is that you are giving an HTML example while the author requests a Silverlight solution.
thatraja at 16-Jul-11 23:09pm
   
What's wrong with these answers, Don't know why downvotes for these, Counter 5!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 195
1 ProgramFOX 130
2 Maciej Los 105
3 Sergey Alexandrovich Kryukov 105
4 Afzaal Ahmad Zeeshan 82
0 OriginalGriff 6,564
1 Sergey Alexandrovich Kryukov 6,048
2 DamithSL 5,228
3 Manas Bhardwaj 4,717
4 Maciej Los 4,150


Advertise | Privacy | Mobile
Web04 | 2.8.1411022.1 | Last Updated 22 Jun 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100