Click here to Skip to main content
15,888,401 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionHi friends. Help me Pin
G Nathan28-Feb-08 2:59
G Nathan28-Feb-08 2:59 
GeneralRe: Hi friends. Help me Pin
eyeseetee28-Feb-08 3:11
eyeseetee28-Feb-08 3:11 
GeneralRe: Hi friends. Help me Pin
Vasudevan Deepak Kumar28-Feb-08 4:05
Vasudevan Deepak Kumar28-Feb-08 4:05 
QuestionHow to avoid button call event on page refresh Pin
Nagraj Naik28-Feb-08 2:44
Nagraj Naik28-Feb-08 2:44 
AnswerRe: How to avoid button call event on page refresh Pin
eyeseetee28-Feb-08 3:17
eyeseetee28-Feb-08 3:17 
GeneralRe: How to avoid button call event on page refresh Pin
ChrisKo28-Feb-08 5:27
ChrisKo28-Feb-08 5:27 
GeneralRe: How to avoid button call event on page refresh Pin
Not Active28-Feb-08 12:18
mentorNot Active28-Feb-08 12:18 
GeneralRe: How to avoid button call event on page refresh Pin
ChrisKo28-Feb-08 12:41
ChrisKo28-Feb-08 12:41 
You are doing an unnecessary comparison that can be easily avoided. I haven't actually looked at the IL, but the compiler might be smart enough to ignore that comparison. That is not the main reason for avoiding that type of code though.

The main reason is because it's quiet easy to do this by mistake:
if(Page.IsPostBack = true )

And then you've got things happening that you never expected and it's easy to miss this simple istype for hours.

I agree that Page could be omitted, but as you mentioned, it makes the code more explicit in intent. It's possible that someone new to ASP.NET development takes over maintenance on this project and doesn't know that the Page object is available to him.

I guess I shouldn't have said code horror, but it's something that should be avoided.
QuestionOnClick or OnFocus event handler for textbox Pin
Muhammad Gouda27-Feb-08 23:02
Muhammad Gouda27-Feb-08 23:02 
GeneralRe: OnClick or OnFocus event handler for textbox Pin
Christian Graus27-Feb-08 23:08
protectorChristian Graus27-Feb-08 23:08 
GeneralRe: OnClick or OnFocus event handler for textbox Pin
Muhammad Gouda27-Feb-08 23:30
Muhammad Gouda27-Feb-08 23:30 
GeneralRe: OnClick or OnFocus event handler for textbox Pin
Christian Graus28-Feb-08 9:46
protectorChristian Graus28-Feb-08 9:46 
GeneralRe: OnClick or OnFocus event handler for textbox Pin
ChrisKo28-Feb-08 5:24
ChrisKo28-Feb-08 5:24 
GeneralIE Back Button DataGrid Pin
smsmfe27-Feb-08 22:46
smsmfe27-Feb-08 22:46 
GeneralRe: IE Back Button DataGrid Pin
Christian Graus27-Feb-08 22:56
protectorChristian Graus27-Feb-08 22:56 
GeneralRe: IE Back Button DataGrid [modified] Pin
smsmfe12-Mar-08 3:17
smsmfe12-Mar-08 3:17 
GeneralSend SMS By WebApplication Or Web Site [modified] Pin
kimo code27-Feb-08 21:51
kimo code27-Feb-08 21:51 
GeneralRe: Send SMS By WebApplication Or Web Site Pin
Christian Graus27-Feb-08 21:58
protectorChristian Graus27-Feb-08 21:58 
GeneralRe: Send SMS By WebApplication Or Web Site Pin
kimo code27-Feb-08 22:07
kimo code27-Feb-08 22:07 
GeneralRe: Send SMS By WebApplication Or Web Site Pin
Christian Graus27-Feb-08 22:21
protectorChristian Graus27-Feb-08 22:21 
GeneralRe: Send SMS By WebApplication Or Web Site Pin
kimo code27-Feb-08 22:26
kimo code27-Feb-08 22:26 
GeneralRe: Send SMS By WebApplication Or Web Site Pin
J4amieC27-Feb-08 22:31
J4amieC27-Feb-08 22:31 
GeneralRe: Send SMS By WebApplication Or Web Site Pin
kimo code27-Feb-08 22:45
kimo code27-Feb-08 22:45 
GeneralRe: Send SMS By WebApplication Or Web Site Pin
Christian Graus27-Feb-08 22:34
protectorChristian Graus27-Feb-08 22:34 
GeneralRe: Send SMS By WebApplication Or Web Site Pin
Vasudevan Deepak Kumar28-Feb-08 4:06
Vasudevan Deepak Kumar28-Feb-08 4:06 

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.