Hi,
 
I don't know what is __EVENTTARGET (please note there are two
underscores, not one before the word), but somehow I used it for a
unique situation I ran into and its helping me a lot. But I want to know
what is it and how reliable is my code for this situation.
 
I have a datagrid, I made enableviewstate = FALSE (datagrid on diet),
did custom paging, sorting etc.  I have two buttoncolumns too in the
datagrid.
 
But I was unable to fire the ItemCommand event or do sorting as I need
to bind the grid before page_load. But for my situation I should not
bind datagrid for postback of other controls on the page.
 
DEAN, if you remember, once we talked about this and you said you need
to bind the grid or for my particular situation you said to use the
following code:
 
String btnClicked = Request.Form.GetKey(3);
If(btnClicked.StartsWith("DataGrid1")
BindGrid();
 
I hope you remember this issue.
 
But when my page layout changed and had many other controls, the above
code failed.
 
So I was banging my head about this, and surprisingly I noticed that, if
the event occurred because of a control in the Datagrid, the
__EVENTTARGET is NOT NULL and if the event has occurred by a control
that is not inside the datagrid then __EVENTTARGET is NULL.
 
If(Request.Form["__EVENTTARGET"] != "")
BindGrid();
 
So I used this, and its working absolutely fine.  Is there really a
relation between DataGrid and __EVENTTARGET  and __EVENTTARGET exists
only DataGrid related events ?  
 
So can I rely on this condition and model my datagrid?
 
Raj.
 
 


[Non-text portions of this message have been removed]



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
     [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
 

Reply via email to