Solved

Click twice for dataload into listbox

Posted on 2009-05-20
10
236 Views
Last Modified: 2013-12-17
I have a gridview which when I click the gridview edit button it loads some values into a listbox.

My problem is that I have to click the edit button twice for this to happen. Is there a reason for this.

I am using c# and asp.net
0
Comment
Question by:Mr_Shaw
  • 6
  • 2
  • 2
10 Comments
 
LVL 20

Accepted Solution

by:
informaniac earned 250 total points
ID: 24432625
Make sure u have checked for the IsPostBack Condition in page load where you might have written code to bind the grid.
0
 

Author Comment

by:Mr_Shaw
ID: 24432667
I am not sure what you mean

page_load and the code benhind the grid and two seperate sections
0
 
LVL 20

Expert Comment

by:informaniac
ID: 24432874
Where have u written code to bind the grid? in  Page load
0
 

Author Comment

by:Mr_Shaw
ID: 24433044
I have tried running my code both inside  and outside of

if (Page.IsPostBack)
        {
}
0
 

Author Comment

by:Mr_Shaw
ID: 24433255
Everything seems to be acting on the previous click.

for example to value selected in the 1st click was one
the value selected in the 2nd click was two.

When I click for the second time the 1st clicks values is processed. ahhhhhhhh
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 11

Assisted Solution

by:srikanthreddyn143
srikanthreddyn143 earned 250 total points
ID: 24433269
Move the focus out of gridview in click event
0
 

Author Comment

by:Mr_Shaw
ID: 24433307
what do you mean by move the focus.... do you think you could give me an example?
0
 
LVL 11

Expert Comment

by:srikanthreddyn143
ID: 24433448
When Edit button is clicked, Make the focus move to any other control like txtboxx1.focus()
0
 

Author Comment

by:Mr_Shaw
ID: 24433478
I'm really sorry to have to say this... but changing the focus does not help.

My code is always one click behind what I am actually doing,

Everything seems to be acting on the previous click.

for example to value selected in the 1st click was one
the value selected in the 2nd click was two.

When I click for the second time the 1st clicks values is processed. ahhhhhhhh
0
 

Author Closing Comment

by:Mr_Shaw
ID: 31583546
thanks for the help....

It ended up being the way I ordered my code.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now