The TargetControlID of 'ModalPopupExtender1' is not valid. A control with ID 'Button2' could not be found.

 help.. i dont know what to do with this error... i've been using this on my other pages and it works fine.. but when i copy the code to new page... i get this error... but the button exists and recognized...

here is my code...

 

<ajaxToolkit:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0">
<ajaxToolkit:TabPanel ID="TabPanel1" runat="server" HeaderText="Receiving Report Info"
Width="100%">
<ContentTemplate>
<div>
testtab
</div>
</ContentTemplate>
</ajaxToolkit:TabPanel>
<ajaxToolkit:TabPanel ID="TabPanel2" runat="server" HeaderText="Receiving Report Details"
Width="100%">
<ContentTemplate>
<br />
<div class="TabToolBar">
<asp:Button ID="Button2" runat="server" Text="Button" />

<asp:Button ID="btnAddMaterial" runat="server" CssClass="Button" Text="Add Item" />
</div>
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GridView2" runat="server" GridLines="None" AutoGenerateColumns="False"
AllowPaging="True" ShowFooter="True" CssClass="TabGrd">
<FooterStyle CssClass="GrdFooter" />
<RowStyle CssClass="GrdRows" />
<PagerStyle CssClass="GrdPaging" />
<SelectedRowStyle CssClass="GrdSelected" />
<HeaderStyle CssClass="GrdHeader" />
<EditRowStyle CssClass=" " />
<AlternatingRowStyle CssClass="GrdAltRows" />
<Columns>
<asp:CommandField ButtonType="Image" CancelImageUrl="~/App_Images/cancel.png" DeleteImageUrl="~/App_Images/del.png"
EditImageUrl="~/App_Images/edit_select.png" ShowEditButton="True" ShowDeleteButton="True"
SelectImageUrl="~/App_Images/select.png" UpdateImageUrl="~/App_Images/save.png" />
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="lblRRDetailsID" runat="server" Text='<%#Bind("RRDetailsID") %>' Width=""></asp:Label>
</ItemTemplate>
<FooterStyle CssClass="HiddenColumn" />
<HeaderStyle CssClass="HiddenColumn" />
<ItemStyle CssClass="HiddenColumn" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="lblRRID" runat="server" Text='<%#Bind("RRID") %>' Width=""></asp:Label>
</ItemTemplate>
<FooterStyle CssClass="HiddenColumn" />
<HeaderStyle CssClass="HiddenColumn" />
<ItemStyle CssClass="HiddenColumn" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Item No.">
<ItemTemplate>
<asp:Label ID="lblIndex" runat="server" Text='' Width="10%"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Material Description">
<ItemTemplate>
<asp:Label ID="lblMaterialName" runat="server" Text='<%#Bind("MaterialName") %>'
Width="90%"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Unit">
<ItemTemplate>
<asp:Label ID="lblUnit" runat="server" Text='<%#Bind("Unit") %>' Width="90%"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Quantity">
<ItemStyle HorizontalAlign="center" />
<ItemTemplate>
<asp:Label ID="lblQuantity" runat="server" Text='<%#String.Format("{0:N}", Eval("Quantity")) %>'
Width="50px"></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtQuantity" runat="server" Text='<%#Bind("Quantity") %>' Width="50px"></asp:TextBox>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Remarks">
<ItemTemplate>
<asp:Label ID="lblRemarks" runat="server" Text='<%#Bind("Remarks") %>' Width="100%"></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtRemarks" runat="server" Text='<%#Bind("Remarks") %>' Width="90%"></asp:TextBox>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="lblPrevQty" runat="server" Text='<%#Bind("PrevQty") %>' Width=""></asp:Label>
</ItemTemplate>
<FooterStyle CssClass="HiddenColumn" />
<HeaderStyle CssClass="HiddenColumn" />
<ItemStyle CssClass="HiddenColumn" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="lblPODetailsID" runat="server" Text='<%#Bind("PODetailsID") %>' Width=""></asp:Label>
</ItemTemplate>
<FooterStyle CssClass="HiddenColumn" />
<HeaderStyle CssClass="HiddenColumn" />
<ItemStyle CssClass="HiddenColumn" />
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajaxToolkit:TabPanel>
</ajaxToolkit:TabContainer>
<div class="ToolBarRight">
<asp:Button ID="btnEditUpdate" runat="server" class="Button" Text="Edit RR" />
<asp:Button ID="btnDeleteCancel" runat="server" class="Button" Text="Delete RR" />
<asp:Button ID="btnBackToList" runat="server" class="Button" Text="Back To RR List" />
<asp:Button ID="btnApproveRR" runat="server" class="Button" Text="Approve RR" />
<asp:Button ID="btnCancelRR" runat="server" class="Button" Text="Cancel RR" />
</div>
<div>
<asp:Panel ID="Panel1" runat="server" CssClass="modalPopup">
<div>
<br />
<asp:Label ID="Label1" runat="server" Text="P.O. # "></asp:Label>
<asp:Label ID="lblPOCode" runat="server"></asp:Label>
<br />
<br />
<asp:Label ID="Label2" runat="server" Text="Check the materials to be added"></asp:Label>
<br />
<asp:UpdatePanel ID="UpdatePanel3" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GridView3" runat="server" CellPadding="0" GridLines="None" AutoGenerateColumns="False"
DataKeyNames="PODetailsID, MaterialID" AllowPaging="True" ShowFooter="True" CssClass="ModalGrd">
<AlternatingRowStyle CssClass="GrdAltRows" />
<EmptyDataTemplate>
<table class="ModalGrd" cellpadding="0" cellspacing="0">
<tr>
<td class="GrdHeader" width="10px">
 
</td>
<td class="GrdHeader">
Item ID
</td>
<td class="GrdHeader">
PR Code
</td>
<td class="GrdHeader">
Material Code
</td>
<td class="GrdHeader">
Material Name
</td>
<td class="GrdHeader">
Unit
</td>
<td class="GrdHeader">
Quantity
</td>
<td class="GrdHeader">
 
</td>
</tr>
<tr class="GrdRows">
<td colspan="8">
<asp:Label ID="lblEmpty" runat="server">No Record Exists.</asp:Label>
</td>
</tr>
<tr>
<td class="GrdFooter" colspan="8">
</td>
</tr>
</table>
</EmptyDataTemplate>
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="chkSelect" runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="PODetailsID">
<ControlStyle Width="70%" CssClass="HiddenColumn" />
<FooterStyle CssClass="HiddenColumn" />
<HeaderStyle CssClass="HiddenColumn" />
<ItemStyle CssClass="HiddenColumn" />
<ItemTemplate>
<asp:Label ID="lblPODetailsID" runat="server" Text='<%#String.Format("{0:N}", Eval("PODetailsID")) %>'
Width="90%"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="POID" HeaderText="POID" SortExpression="POID">
<ControlStyle Width="70%" CssClass="HiddenColumn" />
<FooterStyle CssClass="HiddenColumn" />
<HeaderStyle CssClass="HiddenColumn" />
<ItemStyle CssClass="HiddenColumn" />
</asp:BoundField>
<asp:BoundField DataField="PRDetailsID" HeaderText="PRDetailsID" SortExpression="PRDetailsID">
<ControlStyle Width="70%" CssClass="HiddenColumn" />
<FooterStyle CssClass="HiddenColumn" />
<HeaderStyle CssClass="HiddenColumn" />
<ItemStyle CssClass="HiddenColumn" />
</asp:BoundField>
<asp:BoundField DataField="MaterialID" HeaderText="Item ID" SortExpression="MaterialID">
<ControlStyle Width="70%" />
<FooterStyle CssClass="HiddenColumn" />
<HeaderStyle CssClass="HiddenColumn" />
<ItemStyle CssClass="HiddenColumn" />
</asp:BoundField>
<asp:TemplateField HeaderText="Item No.">
<ItemTemplate>
<asp:Label ID="lblIndex" runat="server" Text='' Width=""></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="PRCode" HeaderText="PRCode" SortExpression="PRCode">
<ControlStyle Width="90%" />
</asp:BoundField>
<asp:BoundField DataField="MaterialCode" HeaderText="MaterialCode" SortExpression="MaterialCode">
<ControlStyle Width="90%" />
</asp:BoundField>
<asp:BoundField DataField="MaterialName" HeaderText="Material Name" SortExpression="MaterialName">
<ControlStyle Width="90%" />
</asp:BoundField>
<asp:BoundField DataField="Unit" HeaderText="Unit" SortExpression="Unit">
<ControlStyle Width="90%" />
</asp:BoundField>
<asp:TemplateField HeaderText="Quantity">
<ItemStyle HorizontalAlign="Right" />
<ItemTemplate>
<asp:Label ID="lblQuantity" runat="server" Text='<%#String.Format("{0:N}", Eval("Quantity")) %>'
Width="90%"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Quantity Remaining">
<ItemStyle HorizontalAlign="Right" />
<ItemTemplate>
<asp:Label ID="lblQuantityRemain" runat="server" Text='' Width="90%"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Unit Cost">
<ItemStyle HorizontalAlign="Right" />
<ItemTemplate>
<asp:Label ID="lblUnitCost" runat="server" Text='<%#String.Format("{0:N}", Eval("UnitCost")) %>'
Width="90%"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="QuantityIncluded">
<ControlStyle Width="70%" CssClass="HiddenColumn" />
<FooterStyle CssClass="HiddenColumn" />
<HeaderStyle CssClass="HiddenColumn" />
<ItemStyle CssClass="HiddenColumn" />
<ItemTemplate>
<asp:Label ID="lblQuantityIncluded" runat="server" Text='<%#String.Format("{0:N}", Eval("QuantityIncluded")) %>'
Width="90%"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<EditRowStyle CssClass="GrdEdit" />
<EmptyDataTemplate>
<asp:Label ID="lblEmpty" runat="server">No Record Exists.</asp:Label>
</EmptyDataTemplate>
<FooterStyle CssClass="GrdFooter" />
<HeaderStyle CssClass="GrdHeader" VerticalAlign="Middle" />
<PagerStyle CssClass="GrdPaging" />
<RowStyle CssClass="GrdRows" />
<SelectedRowStyle CssClass="GrdSelected" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<asp:Button ID="AddItemButton" runat="server" CssClass="Button" Text="Add Items" />
<asp:Button ID="CancelButton" runat="server" CssClass="Button" Text="Cancel" />
</div>
</asp:Panel>
<ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="Button2"
PopupControlID="Panel1" BackgroundCssClass="modalBackground" DropShadow="True"
DynamicServicePath="" Enabled="True">
</ajaxToolkit:ModalPopupExtender>
</div>

  
Protected Sub GridView1_SelectedIndexChanging(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewSelectEventArgs) Handles GridView1.SelectedIndexChanging
Dim rrcode = CType(GridView1.Rows(e.NewSelectedIndex).FindControl("lblRRCode"), Label).Text
Dim rrid = CType(GridView1.Rows(e.NewSelectedIndex).FindControl("lblRRID"), Label).Text
Dim poid = CType(GridView1.Rows(e.NewSelectedIndex).FindControl("lblPOID"), Label).Text
'UpdatePanel1.Update()
lblHeader.Text = "Receiving Report - Details"
MultiView1.SetActiveView(View2)
lblRRCode.Text = rrcode
lblRRID.Text = rrid
lblPO.Text = poid
TabContainer1.ActiveTab = TabPanel1
FormView1.DefaultMode = FormViewMode.ReadOnly
GridView2.Columns(0).Visible = False
BindFormView()
Dim lblRRNo = CType(FormView1.Row.FindControl("lblRRNo"), Label)
lblRRNo.Text = lblRRCode.Text
BindRRDetails()
End Sub
 --- d:\E\AjaxControlToolkit_AjaxTk\Orcas\AjaxControlToolkit\ModalPopup\ModalPopupExtender.cs
00000000  push        edi 
00000001  push        esi 
00000002  push        ebx 
00000003  push        ebp 
00000004  mov         esi,ecx
00000006  mov         ebx,edx
00000008  cmp         dword ptr ds:[03B7935Ch],0
0000000f  je          00000016
00000011  call        738CC657
00000016  lea         ecx,[esi+5Ch]
00000019  cmp         ecx,dword ptr [ecx]
0000001b  call        72D132A0
00000020  mov         edi,eax
00000022  test        edi,edi
00000024  je          0000003E
00000026  mov         edi,esi
00000028  lea         ecx,[esi+5Ch]
0000002b  cmp         ecx,dword ptr [ecx]
0000002d  call        72D1334C
00000032  mov         ebp,eax
00000034  mov         edx,ebp
00000036  mov         ecx,edi
00000038  call        dword ptr ds:[06864454h]
0000003e  mov         edx,ebx
00000040  mov         ecx,esi
00000042  call        FFFFFB88
00000047  nop                              --->>>error stops here
00000048  pop         ebp 
00000049  pop         ebx 
0000004a  pop         esi 
0000004b  pop         edi 
0000004c  ret      

Regards,
Mhaey

Please remember to click “Mark as Answer” on the post that helps you.. =)
0
darkcat02
7/15/2008 1:57:56 AM
asp.net.ajax_control_toolkit 17816 articles. 1 followers. Follow

2 Replies
1530 Views

Similar Articles

[PageSpeed] 25
Get it on Google Play
Get it on Apple App Store

 

 the button u are giving as target control id must be in same updatepanel, not in another update panel or outside.

then it will work

 u can use eithr

AddItemButton or CancelButton in ur case
Button2 is not inside any update panel

Do remember to mark this as Answer if this fix your problem

Thanks & Regards
BinuKumar S
0
binukumar
7/16/2008 1:29:53 AM

binukumar:

 

 the button u are giving as target control id must be in same updatepanel, not in another update panel or outside.

then it will work

 u can use eithr

AddItemButton or CancelButton in ur case
Button2 is not inside any update panel

 

 

AddItemButton and CancelButton is used in a modalpopup which is in the modalpopupextender's popupcontrolid "panel1".. i cannot used that.. because it has different function...

ive already used this kind of code in my other pages... and they worked... its JUST IN ONE PAGE.. that IT WONT WORK... same function... same flow... same code where the button is... but i just cant figured out why this error came out....

 

even if i removed the update panel... it just wont work..... 


Regards,
Mhaey

Please remember to click “Mark as Answer” on the post that helps you.. =)
0
darkcat02
7/16/2008 2:52:53 AM
Reply:

Similar Artilces:

''''''''''''''''''''
Name: haznen Email: haznenatyahoodotcom Product: Gran Paradiso Alpha 8 Summary: '''''''''''''''''''' Comments: '''''''''''''''''''''''''''''''''''' Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20061204 UGES/1.7.2.0 GranParadiso/3.0a1 From URL: http://www.mozilla.org/projects/granparadiso/ Note to readers: Hendrix gives...

error: The TargetControlID of '' is not valid. A control with ID 'txtDate' could not be found.
I want to dynamically create webcontrols (depending on the status of another webcontrol). The code snippet for creating dynamically the webcontrols is hereunder. But when running the code I get the message The TargetControlID of '' is not valid. A control with ID 'txtDate' could not be found.. What am I doing wrong here? Thanks for the help. protected void Page_Load(object sender, EventArgs e) { Label lblDate = new Label(); TextBox txtDate = new TextBox(); ImageButton imgCalendar = new ImageButton(); AjaxControlToolkit.CalendarExtender extender = new AjaxControlToolkit.CalendarE...

'''''
Name: mario Email: ramar17atfastwebnetdotit Product: Gran Paradiso Alpha 2 Summary: ''''' Comments: K: Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a2) Gecko/20070206 GranParadiso/3.0a2 ...

Cast from type ''''DBNull'''' to type ''''String'''' is not valid.
How do I avoid getting this error: Cast from type ''''DBNull'''' to type ''''String'''' is not valid. I am trying to get values from the database into a form for updating using a Datareader, SQL is set to allow nulls for certain fields as they are not required but the only way I can get the form to display is by adding a space in SQL. Is there another way around this? Check if it is equal to DBNull.Value first and if it is, don't do the cast.Stanley Tan theSpoke Blog Where in the code does it need to go? I am using the following and it's the profile that isn't always requi...

'do' won't 'do' if '/'
Greetings to All from Au, Have a NetWare Perl 5.8.4 and wanted to tweak File\Spec\NW.pm to try and standardise on '/' separators. If I run a test script (t/uni/lower.t) with an unmodified NW.pm, it calls t/uni/case.pl, that, in case.pl, (when the path separators are '\'), the $file is '..\lib\unicore\To\Lower.pl' and the following code portion works, with $simple getting a returned table: sub casetest { my ($base, $spec, $func) = @_; my $file = File::Spec->catfile(File::Spec->catdir(File::Spec->updir, "lib", &qu...

'''
Name: L Lachowsky Email: e2brutus_10atyahoodotcom Product: Firefox Summary: ''' Comments: why duddn this surprise me... I change default server from IE to Mozilla, and then i get error messages. well, shud I decide to not get on my computer with Mozilla..or shud I risk security breeches with IE....hmmm at least i can get on the internet with IE Browser Details: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5 From URL: http://hendrix.mozilla.org/ Note to readers: Hendrix gives no expectation of a response to this fee...

The DataSourceID of 'GridView1' must be the ID of a control of type IDataSource. A control with ID 'AccessDataSource' could not be found.
what i'm missing that i get the error: The DataSourceID of 'GridView1' must be the ID of a control of type IDataSource.  A control with ID 'AccessDataSource' could not be found.      <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="NewsId"                  EmptyDataText="There are no data records to display.">          &nb...

The DataSourceID of 'gv2' must be the ID of a control of type IDataSource. A control with ID 'objDs1' could not be found.
i have a radiobutton list and gridview and a object data source at runtime i'm changing the object data source by clicking on the radiobutton list selected index changed and here is my source code....          <asp:RadioButtonList runat="server" ID="rblView" RepeatDirection="Horizontal" RepeatLayout="Flow" AutoPostBack="True" OnSelectedIndexChanged="rblView_SelectedIndexChanged">                &nb...

The DataSourceID of 'DetailsView1' must be the ID of a control of type IDataSource. A control with ID 'AccessDataSource1' could not be found.
 Anyone help with this? i have tried lots of ways to query this database and create the insert command, including making my own data sets and setting it up that way with my own custom SQL statement.....this did not work, so i though i would use VWD 2008's own tools to create the insert, i have been left with the following error: The DataSourceID of 'DetailsView1' must be the ID of a control of type IDataSource.  A control with ID 'AccessDataSource1' could not be found.   Everything looks ok to me. Code below:   <%@ Page Title="" Lan...

Target control with ID '' could not be found for extender '_AccordionExtender'.
Hey Folks, I'm trying to use the accordian in a page that uses a master page and I'm receiving this error.  I've place the following code inside the content place holder tag on the page.<atlasToolKit:Accordion runat='server' SelectedIndex='0' ID="Accordion1" AutoSize="None"FadeTransitions="true"TransitionDuration="250"FramesPerSecond="40"><Panes><atlasToolKit:AccordionPane><Header>Pane 1 </Header><Content> This is pane 1</Content></atlasToolKit:AccordionPa...

How do fix the error The DataSourceID of 'DataGrid1' must be the ID of a control of type IDataSource. A control with ID 'SqlMedTable' could not be found.
How do you fix the error: The DataSourceID of 'DataGrid1' must be the ID of a control of type IDataSource.  A control with ID 'SqlMedTable' could not be found.Here is the code.protected void Page_Load(object sender, EventArgs e) {if (!IsPostBack) {MedicalClassLibrary.Connection c = new MedicalClassLibrary.Connection(); c.GetMedicalTable();DataGrid1.AutoGenerateColumns = true; DataGrid1.DataSource = c.DS;InputDiv.Visible = false;Label1.Visible = false; txtRx.Focus(); } } Here is the class medhod:public void GetMedicalTable() {string medTable = "SELECT ...

'b'..'a'
Hello. I'm using defferent 5.6.0's for Win32. I wonder wheter following behaviour is intentional or not: d:\>perl -e "print 'b'..'c'" bc d:\>perl -e "print 'b'..'a'" bcdefghijklmnopqrstuvwxyz I expected empty list in latter case, like in perl -e "print 'bb'..'a'" <!ENTITY Vadim REALLIFE "Vadim V.Konovalov, St.Petersburg, Russia"> &Vadim; On Wed, Sep 20, 2000 at 03:14:41PM +0400, Konovalov, Vadim wrote: > Hello. > > I'm using defferent 5.6.0'...

'IN' Clause or 'OR'
Hello, [1]: select * from TABLEA where COL1 IN('value1','value2''valu3'....) [2]:select * from TABLEA where COL1 = 'value1' OR COL1= 'value2' OR COL1='valu3'. TABLEA is a huge table and it has non-clustered index on COL1. Among the above 2 queries, which query will give me the better performance or fast response and WHY? What is the difference between 'IN' and 'OR' clauses as for as Sybase Optimization is concerned. Which is the better one to be used on huge tables. Thanks. Mac An IN list is treated ...

Target control with ID 'Panel4' could not be found for extender 'CollapsiblePanelExtender1'
hello when i use collapseble panel control geting erros like 'Target control with ID 'Panel4' could not be found for extender 'CollapsiblePanelExtender1' i am using panels inside <div> please help me     Please see: http://forums.asp.net/thread/1293293.aspx#18Don't forget, this posting is provided "AS IS" with no warranties, and confers no rights. ...

Web resources about - The TargetControlID of 'ModalPopupExtender1' is not valid. A control with ID 'Button2' could not be found. - asp.net.ajax_control_toolkit

Resources last updated: 11/22/2015 6:47:59 PM