|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Repeater.Itemcommand not firinglooking for a solution but couldn't find any that works for me. Here's the code I'm using: -- .aspx .... <asp:Repeater id="rptPostaPrim" runat="server"> </asp:Repeater> </form> -- </body> codebehind file Page_Load { if (!IsPostBack) { //DataBind Repeater } } InitilizeComponent this.rptPostaPrim += new System.Web.UI.WebControls.RepeaterCommandEventHandler(this.rptPostaPrim_ItemCommand); protected void rptPostaPrim_ItemCommand(object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e) { //Do something } So, rptPostaPrim_ItemCommand method does not execute... Page and Repeater have viewstate enabled. Any ideas anyone??? The correct syntax for adding an event handler to the repeater ItemCommand
event is: this.rptPostaPrim.ItemCommand += new System.Web.UI.WebControls.RepeaterCommandEventHandler(this.rptPostaPrim_ItemCommand); Show quoteHide quote "ilovr***@gmail.com" wrote: > I have a problem with ItemCommand event - it just wont fire. I've been > looking for a solution but couldn't find any that works for me. > > Here's the code I'm using: > > -- .aspx > > .... > <asp:Repeater id="rptPostaPrim" runat="server"> > </asp:Repeater> > </form> > -- </body> > > codebehind file > > Page_Load > { > if (!IsPostBack) > { > //DataBind Repeater > } > } > > InitilizeComponent > this.rptPostaPrim += new > System.Web.UI.WebControls.RepeaterCommandEventHandler(this.rptPostaPrim_ItemCommand); > > > protected void rptPostaPrim_ItemCommand(object source, > System.Web.UI.WebControls.RepeaterCommandEventArgs e) > { > //Do something > } > > So, rptPostaPrim_ItemCommand method does not execute... Page and > Repeater have viewstate enabled. Any ideas anyone??? > > Sorry, but that was just my typing error while writing this post. If
that syntax was in code it would trigger compiler error... I managed to trigger that event only when I put DataBinding out of 'if (!IsPostBack)'. But I don't want to bind twice... Phillip Williams wrote: Show quoteHide quote > The correct syntax for adding an event handler to the repeater ItemCommand > event is: > this.rptPostaPrim.ItemCommand += new > System.Web.UI.WebControls.RepeaterCommandEventHandler(this.rptPostaPrim_ItemCommand); > > -- > HTH, > Phillip Williams > http://www.societopia.net > http://www.webswapp.com > > I managed to trigger that event only when I put DataBinding out of 'if is viewstate enabled? Sounds like it is not> (!IsPostBack)'. But I don't want to bind twice... weird. I managed to get it working by puting Item, Header and Footer
templates definition in .aspx file. Until now I've loaded templates in code-behind file. So, anyone knows is this a bug or ... ???
Datagrid only shows the header
Wizard Control - Referencing buttons in <StepNavigationTemplate> Master Page problem masterpages: body event handler <customErrors mode="Off"/> ERROR Walking thr DataReader Can RDLC Reports be used with Oracle data sources? Membership roles question Textbox Select Text GridView KeepInEdit Mode problem |
|||||||||||||||||||||||