Showing posts with label filled. Show all posts
Showing posts with label filled. Show all posts

Monday, March 26, 2012

dynamic addhandler not working in update panel

hi all,

i have designed a page, with a place holder in it, the placeholder is inside a updatepanel, the placeholder gets filled with images at load, and when i click the viewcart button it get filled with the image information with few dynamic buttons, i have added addhandler for those buttons, but they are not firring up. i am pasting my code here if some one can help me plz.

Dim

updateorderlnkbtn AsNew button ' this is done at the genearal section of the page to make it globalAddHandler updateorderlnkbtn.click,AddressOf cancelBtn_click ' at page init

please help me

hi all

i have done some other changes to the code but still the same problem, if any one of you can give me some idea that would be highly appreciated

thanks


hi all

I have done some thing here that my 5 static buttons that are created at runtime are working fine now but the problem is with the dynamic table, i am placing a delete button in the dynamic table now the dynamic table is created at runtime and i want the delete button to remove the row.

the other buttons (5 buttons) code is something like this , i have wrote the code behing the load, the problem is that i can't wrote the dynamic table code behind the load, the dynammic table is created when i click a viewcart button

please help

Wednesday, March 21, 2012

dropdownlist in a tabpanel to display data from previous tabpanel

Hello All,

I have a DropDownList in one of my tab panels. The data to this dropdown is provided by a datasource. The data to this datasource is filled in one of the other tab panels. Since the contents of the other tab panel are inside an update panel, a full postback doesnt take place and hence my dropdown does not show any data that was added in the previous tab(unless you do a refresh on the page). Can anyone help me solve this issue with any suggestions? (I tried using the OnPreRender of the dropdownlist to bind the datasource but still it wouldnt display the most recently added data)

Any help will be greatly appreciated.

Thanks,

Nicky

Hi Nicky, Can you provide a small sample to illustrate it?

Raymond Wen - MSFT:

Hi Nicky, Can you provide a small sample to illustrate it?

Hello Raymond,

Sure. Here are the two Tab Panels that I amtalking about. The 'DetailsView' with ID "SpecializationCodeView1" onthe first tab panel inserts data and the 'DropDown' with ID"DropDownList2" on the second tab panel should display the inserteddata.

I could not use the same DataSourceID for these twocontrols since I am using "<%# Bind("specializationCode") %>" forthe dropdown andby doing so it gives me an error "Functions like Eval(), Bind() etc. can be used only with databound objects" while inserting data.

Can you please help?

Thanks,

Nicky

<ajaxToolkit:TabPanel ID="TabPanel4" runat="server">
<HeaderTemplate>Specializations</HeaderTemplate>
<ContentTemplate>
<asp:UpdatePanel ID="SpecializationGridUpdatePanel" runat="server">
<ContentTemplate>
<asp:GridView ID="SpecializationGrid" runat="server"DataKeyNames="id" DataSourceID="SpecializationDataSource2"
GridLines="Horizontal" Width="314px">
<Columns>
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
<asp:BoundField DataField="code" HeaderText="code" SortExpression="code" />
<asp:BoundField DataField="description" HeaderText="description" SortExpression="description" />
</Columns>
</asp:GridView>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="SpecializationCodeView1" EventName="ModeChanged" />
</Triggers>
</asp:UpdatePanel>
<br />
<asp:UpdatePanel ID="SpecializationViewUpdatePanel" runat="server">
<ContentTemplate>
<asp:DetailsView ID="SpecializationCodeView1" runat="server" AutoGenerateRows="False"
CellPadding="3" DataKeyNames="id" DataSourceID="SpecializationDataSource2" DefaultMode="Insert">
<Fields>
<asp:BoundField DataField="id" HeaderText="id" InsertVisible="False" ReadOnly="True"
SortExpression="id" />
<asp:BoundField DataField="code" HeaderText="code" SortExpression="code" />
<asp:BoundField DataField="description" HeaderText="description" SortExpression="description" />
<asp:CommandField ShowInsertButton="True" />
</Fields>
</asp:DetailsView>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajaxToolkit:TabPanel>

<ajaxToolkit:TabPanel ID="TabPanel5" runat="server" >
<HeaderTemplate>
Sub Specializations
</HeaderTemplate>
<ContentTemplate>
<br />
<asp:UpdatePanel ID="SubSpecializationGridUpdatePanel" runat="server">
<ContentTemplate>
<asp:GridView ID="SubSpecializationGrid"runat="server" DataKeyNames="id"DataSourceID="SubSpecializationDataSource"
GridLines="Horizontal">
<Columns>
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
<asp:BoundField DataField="id" HeaderText="id" InsertVisible="False" ReadOnly="True"
SortExpression="id" Visible="False" />
<asp:BoundField DataField="code" HeaderText="code" SortExpression="code" />
<asp:BoundField DataField="description" HeaderText="description" SortExpression="description" />
<asp:BoundFieldDataField="specializationCode" HeaderText="specializationCode"SortExpression="specializationCode" />
</Columns>
</asp:GridView>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="SubSpecializationsView" EventName="ModeChanged" />
</Triggers>
</asp:UpdatePanel>
<br />
<asp:UpdatePanel ID="SubSpecializationInsertUpdatePanel" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:DetailsView ID="SubSpecializationsView" runat="server" AutoGenerateRows="False"
DataKeyNames="id" DataSourceID="SubSpecializationDataSource"
DefaultMode="Insert" GridLines="Horizontal" Height="50px" Width="125px">
<Fields>
<asp:BoundField DataField="id" HeaderText="id" InsertVisible="False" ReadOnly="True"
SortExpression="id" />
<asp:BoundField DataField="code" HeaderText="code" SortExpression="code" />
<asp:BoundField DataField="description" HeaderText="description" SortExpression="description" />
<asp:TemplateField HeaderText="specializationCode" SortExpression="specializationCode">
<EditItemTemplate>
<asp:Label ID="Label1"runat="server" Text='<%# Eval("specializationCode")%>'></asp:Label>
</EditItemTemplate>
<InsertItemTemplate>
<asp:DropDownList ID="DropDownList2" runat="server" DataSourceID="SpecializationDataSource"
DataTextField="description"DataValueField="code" SelectedValue='<%# Bind("specializationCode")%>'>
</asp:DropDownList>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1"runat="server" Text='<%# Bind("specializationCode")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:CommandField ShowInsertButton="True" />
</Fields>
</asp:DetailsView>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>

</ajaxToolkit:TabPanel>

</ajaxToolkit:TabContainer>


I can't run the code directly.

But may be you can try to force the updatePanel that contains the DDL update in the ItemInserted event of the DetailsView?


protected void SpecializationCodeView1_ItemInserted(object sender, DetailsViewInsertedEventArgs e)
{
UpdatePanel up = tabContainer1.Tabs[1].Controls[0].FindControl("SubSpecializationInsertUpdatePanel") as UpdatePanel;
up.Update();
}


bvc xvbvx xvbcvcbcv cvb
bvc xvbvx xvbcvcbcv cvb