Well the error implies that you are referencing an object that is not
there... perhaps btnNext ?  You might check your objects and be sure
that you have the runat=server tags in all objects.

Ronda


On Mon, 24 Jan 2005 05:15:14 +0000 (GMT), santosh poojari
<[EMAIL PROTECTED]> wrote:
> 
> Hi,
> I have called one function on
> <asp:RadioButtonList id="rbYesNo" runat="server" 
> OnSelectedIndexChanged="OnSelected_YesNo" AutoPostBack="True"> Yes No
> 
> public void OnSelected_YesNo(object sender,System.EventArgs e)
> 
> {
> 
> RadioButtonList rbClicklist;
> 
> Response.Write("OnRadioBtnClick");
> 
> int cntCheck=0;
> 
> for(int iIter=0;iIter<DataGrid1.Items.Count;iIter++)
> 
> {
> 
> DataGridItem objItem= DataGrid1.Items[iIter];
> 
> rbClicklist=((RadioButtonList)objItem.FindControl("rbYesNo"));
> 
> string rbClickValue=rbClicklist.SelectedIndex.ToString();
> 
> if(rbClickValue=="1" || rbClickValue=="0")
> 
> {
> 
> cntCheck=cntCheck+1;
> 
> }
> 
> }
> 
> //Button2.Enabled=false;
> 
> if(cntCheck==DataGrid1.Items.Count)
> 
> {
> 
> Button btnNext=new Button();
> 
> btnNext=(Button)DataGrid1.FindControl("button1");
> 
> btnNext.Enabled=true;
> 
> }
> <FooterTemplate>
> <asp:button id="button1" runat="server" Enabled="false"..........
> 
> I get a runtime error for this line
> 
> btnNext.Enabled=true;
> Object reference does not set to an instance of an object..
> 
> Required help on above Error---
> 
> 
> Santosh
> 
> Charles Carroll <[EMAIL PROTECTED]> wrote:
> You need to use OnItemDataBound()  and use DataGridID.findcontrol() on
> that event.
> 
> It does not exist until the data is filled in to control.
> 
> Others will be able to elaborate. I wanted to point you in right direction.
> 
> On Sat, 22 Jan 2005 14:46:56 +0000 (GMT), santosh poojari
> <[EMAIL PROTECTED]> wrote:
> >  Hi All,
> >  I have disabled the button in Datagrid and i want to make it enabled during
> > run time such as
> >  public void Datagrid1_OnSelectedChanged( object sender ,System.  )
> >  {
> >
> >  ((Button)DataGrid1.FindControl("btnNext")).enabled=true;
> >  }
> >  I have tried this doing but it throws a runtime error
> >  "Object Reference does not contain instance of Button.
> >
> >  please comment,
> >  San
> >
> >  Yahoo! India Matrimony: Find your life partneronline.
> >
> >  [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 the Yahoo! Terms of Service.
> 
> ---------------------------------
> 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 the Yahoo! Terms of Service.
> 
> Yahoo! India Matrimony: Find your life partneronline.
> 
> [Non-text portions of this message have been removed]
> 
> Yahoo! Groups Links
> 
> 
> 
> 
> 


-- 
Ronda Pederson
MVP ASP.Net


 
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