Click here to Skip to main content
15,902,900 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: need help wit creating dynamic links Pin
neodeaths3-Oct-06 2:31
neodeaths3-Oct-06 2:31 
Questionget information of a web page that use frame Pin
aligatojohn1-Oct-06 22:41
aligatojohn1-Oct-06 22:41 
QuestionCan logon page be skipped if form authentication is used? Pin
Arjune1-Oct-06 22:10
Arjune1-Oct-06 22:10 
AnswerRe: Can logon page be skipped if form authentication is used? Pin
nguyenvhn1-Oct-06 22:27
nguyenvhn1-Oct-06 22:27 
GeneralRe: Can logon page be skipped if form authentication is used? Pin
sanju02762-Oct-06 7:27
sanju02762-Oct-06 7:27 
Questionbiult a tree with database Pin
ptvce1-Oct-06 22:09
ptvce1-Oct-06 22:09 
AnswerRe: biult a tree with database Pin
minhpc_bk2-Oct-06 0:56
minhpc_bk2-Oct-06 0:56 
QuestionPostback twice for a button click? Pin
pedestrian7971-Oct-06 21:20
pedestrian7971-Oct-06 21:20 
I have a simple VB ASP.NET 2.0 page with a Button and a Label.
The Label text is "0". For each click of the button (btnAdd), it should
increment the Label text by 1.

The code:
Protected Sub btnAdd_Click(...) Handles btnAdd.Click<br />
   Trace.Warn("Before add: " & lblCounter.Text)<br />
   lblCounter.Text = (Int32.Parse(lblCounter.Text) + 1).ToString<br />
   Trace.Warn("After add: " & lblCounter.Text)<br />
End Sub<br />


However, each time I click the button, the label always increase by 2 instead of the expected 1. What's the problem area?

I tried to debug using Trace.
I get the following result from the trace:

Begin Raise PostBackEvent
Before add: 0
After add: 1
Before add: 1
After add: 2
End Raise PostBackEvent

Is this signifies PostBack event is being run twice per button click?
How to solve it?

Thanks for your assistance.
Wink | ;)

Pedestrian, Penang.

AnswerRe: Postback twice for a button click? Pin
lavanya_satheesh2-Oct-06 2:16
lavanya_satheesh2-Oct-06 2:16 
GeneralRe: Postback twice for a button click? Pin
pedestrian7972-Oct-06 3:29
pedestrian7972-Oct-06 3:29 
AnswerRe: Postback twice for a button click? Pin
munklefish2-Oct-06 2:36
munklefish2-Oct-06 2:36 
GeneralRe: Postback twice for a button click? Pin
pedestrian7972-Oct-06 3:34
pedestrian7972-Oct-06 3:34 
AnswerRe: Postback twice for a button click? Pin
Paddy Boyd2-Oct-06 2:43
Paddy Boyd2-Oct-06 2:43 
GeneralRe: Postback twice for a button click? Pin
pedestrian7972-Oct-06 3:39
pedestrian7972-Oct-06 3:39 
Questiondesign layout a form Pin
ptvce1-Oct-06 21:12
ptvce1-Oct-06 21:12 
QuestionJavaScript / AJAX Pin
Amit Kumar G1-Oct-06 12:56
Amit Kumar G1-Oct-06 12:56 
AnswerRe: JavaScript / AJAX Pin
Guffa1-Oct-06 13:19
Guffa1-Oct-06 13:19 
QuestionComposite User Controls or Templates Pin
Leightym1-Oct-06 6:56
Leightym1-Oct-06 6:56 
Questionajax and img Pin
cmarmr1-Oct-06 6:49
cmarmr1-Oct-06 6:49 
AnswerRe: ajax and img Pin
Guffa1-Oct-06 8:11
Guffa1-Oct-06 8:11 
AnswerRe: ajax and img Pin
morteza572-Oct-06 12:25
morteza572-Oct-06 12:25 
QuestionPasswords Pin
TheEagle1-Oct-06 5:51
TheEagle1-Oct-06 5:51 
AnswerRe: Passwords Pin
sanju02761-Oct-06 6:40
sanju02761-Oct-06 6:40 
GeneralRe: Passwords Pin
TheEagle1-Oct-06 17:39
TheEagle1-Oct-06 17:39 
Questionhow to take web form textbox in array Pin
omi981-Oct-06 4:35
omi981-Oct-06 4:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.