Showing posts with label sqldatasource. Show all posts
Showing posts with label sqldatasource. Show all posts

Wednesday, March 28, 2012

Multiple UCs on a page

On my page I have two User Controls. One, UC1, has a DropDownList. The other one, UC2, is a list that gets data from a SqlDataSource (datasourcetype=strored procedure), by Repeater.

Whenever the ddl in UC1 is changed, it triggers a function that puts a log record into the database from which UC2 gets the data.

I need the new log record to appear immediately after the selected index of ddl is changed, but it only appears after I refresh the page.

I can't create any triggers for the UpdatePanel of UC1, because the controls are in different UCs.

I tried to use delegates and events, but unsuccessful. My knowledge in that area is limited.

You should be able to use triggers for the update panel even though they are different controls.
Can you post your code?
You can also just refresh the page in code...


Make sure they are both in updatepanels, and set both toUpdateMode="Always". Then, when one updates, the other automatically updates.

Multiple updates with Ajax

I have two dropdownboxes, one that is dependent on the other for the value. I have these dropdown boxes in an update panel using a sqldatasource on both of them. The second dropdown box uses the selected value from the first dropdown box to populate its content. I also have two text boxes that are start and end dates that are based on the second dropdown box. For further clarification, I have a publication dropdown box that will populate the issue dropdown box with a listing of all issues for that publication and also will populate the start and end dates for that issue. However, when I select a different publication and the issue is on another month, the issue then is updated but not the start and end dates. How would I go about accomplishing this?

//

//

Publication: ARCHI-TECH Buildings Interiors and SourcesIssue: April 2007 March 2007 January 2007 January/February 2007 December 2006 November/December 2006 October 2006 September 2006 September/October 2006 July 2006 July/August 2006 June 2006 May/June 2006 March/April 2006 January 2006 January/February 2006 November 2005 November/December 2005 September/October 2005 July 2005 July/August 2005 June 2005 May 2005 May/June 2005 April 2005 March/April 2005 February 2005 January 2005 January/February 2005 December 2004 November 2004 November/December 2004 September/October 2004 August 2004 July/August 2004 May/June 2004 March 2004 February 2004 January 2004*Section: Please Select a Section Awards Bottom Line Energy Issues Career CaseStudy CoverStory FastTalk Feature Innovations Awards - 2001 Innovations Awards - 2002 Interior Design Award - 2001 Interior Design Award 2002 News NextPage OnlineExclusive Opinion Product Smarter SmarterBuildings SubArticle TechWork theBuzz ViewPoint Who'sWho

Start Date:**End Date:**

Can you post the ASPX, or explain how you have this set up? Are the textboxes inside of the updatepanel? Do you have the textboxes in a separate updatepanel that has a trigger set? Are you updating the textbox values in the page_load event? You should try stepping through your code, and ensure that the code responsible for setting the text in the textboxes is actually being reached. If it is, verify that the textboxes are inside of an update panel. Control outside of the updatepanel can not be udpated asynchronously (unless insdie of another updatepanel).

Monday, March 26, 2012

Multi-UpdatePanel Problem?

I have a imagebutton and a GridView on a simple web form. The GridView's datasource is a SqlDataSource that has a simple select statement in it. The GridView is inside an UpdatePanel, the ImageButton is not. There is no masterpage. EnablePartialRendering is set to true. When I run it, on the buttons click the GridView is made visible. When displayed the gridview sorts and pages correctly. However, once I add an UpdatePanel to the ImageButton the GridView displays as it should but will not sort or page. I have tried ever scenario I can think of, with Triggers, without Triggers, Mode Conditional, Mode Always. I am at a complete stand still. If anyone can explain what is happening here. I thought you could put as many Update Panels on a page as you wanted.

Thanks!

hello.

are you saying that when you put the linkbutton inside a panel it just stops working? any chance of building a small demo page with this?


Thanks for responding. I have included a test page with two updatepanel and one with only one update panel. I am still stumped. Please let me know what you think...Thanks again

1>>>>>>>>>>>Two UpdatePanel Page234<%@. Page Language="C#" AutoEventWireup="true" CodeFile="Test.aspx.cs" Inherits="Test" Title="Untitled Page" %>56<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">7<html xmlns="http://www.w3.org/1999/xhtml" >8910<atlas:ScriptManager ID="ScriptManager1" EnablePartialRendering="true" runat="server">1112</atlas:ScriptManager>13<head id="Head1" runat="server">1415</head>16<body>17<form id="form1" runat="server">18<div>19<table style="width: 100%; height: 100%; vertical-align: top; text-align: left;" >202122 <tr align="left">2324 <td valign="top" align="left">252627 <table style="width: 100%; border-right: thin solid;28 border-top: thin solid;29 border-left: thin solid;30 border-bottom: thin solid;">31 <tr style="border-right: thin solid;32 border-top: thin solid;33 border-left: thin solid;34 border-bottom: thin solid;35 width: 100%;36 height: 75px;">37 <td style="width: 25%; vertical-align: middle; text-align: left;">3839 <atlas:UpdatePanel ID="up1" runat="server" Mode="Always">40 <ContentTemplate>41 <asp:ImageButton ID="imbStart" runat="server" ImageUrl="~/images/Approve_32.jpg" OnClick="imbStart_Click" />42 </ContentTemplate>43 </atlas:UpdatePanel>4445 </td>4647 </tr>4849 <tr style="border-right: thin solid; border-top: thin solid; border-left: thin solid;50 width: 100%; border-bottom: thin solid">51 <td colspan="2" style="vertical-align: top; height: 100%; text-align: left">52 <atlas:UpdatePanel ID="UpdatePanel7" runat="server" Mode="Always">53 <ContentTemplate>5455  <asp:GridView ID="gvTrk" runat="server" Width="100%" Caption="Duplicates Trackers" AllowPaging="True" CaptionAlign="Top" Font-Bold="True" AllowSorting="True" AutoGenerateSelectButton="True" DataSourceID="SqlDataSource1" style="position: static" AutoGenerateColumns="False" OnSelectedIndexChanged="gvTrk_SelectedIndexChanged" Visible="False" >56 <Columns>57 <asp:BoundField DataField="UPS185_E_FF_ProdSvcU_ID" HeaderText="UPS185_E_FF_ProdSvcU_ID"58 InsertVisible="False" ReadOnly="True" SortExpression="UPS185_E_FF_ProdSvcU_ID" />59 <asp:CheckBoxField DataField="PrimaryPS_LG" HeaderText="PrimaryPS_LG" SortExpression="PrimaryPS_LG" />60 <asp:BoundField DataField="PkgType_VC" HeaderText="PkgType_VC" SortExpression="PkgType_VC" />61 <asp:BoundField DataField="ChargeCategoryCode_CH" HeaderText="ChargeCategoryCode_CH"62 SortExpression="ChargeCategoryCode_CH" />63 <asp:BoundField DataField="ChargeCategoryDetailCode_CH" HeaderText="ChargeCategoryDetailCode_CH"64 SortExpression="ChargeCategoryDetailCode_CH" />65 <asp:BoundField DataField="ChargeClassificationCode_VC" HeaderText="ChargeClassificationCode_VC"66 SortExpression="ChargeClassificationCode_VC" />67 <asp:BoundField DataField="ChargeDescriptionCode_VC" HeaderText="ChargeDescriptionCode_VC"68 SortExpression="ChargeDescriptionCode_VC" />69 <asp:BoundField DataField="SvcDesc_VC" HeaderText="SvcDesc_VC" SortExpression="SvcDesc_VC" />70 <asp:BoundField DataField="PS_Mstr_ID" HeaderText="PS_Mstr_ID" SortExpression="PS_Mstr_ID" />71 <asp:BoundField DataField="ModeCat_ID" HeaderText="ModeCat_ID" SortExpression="ModeCat_ID" />72 <asp:BoundField DataField="CWTByPkg_PS_ID" HeaderText="CWTByPkg_PS_ID" SortExpression="CWTByPkg_PS_ID" />73 <asp:BoundField DataField="Fuel_ID" HeaderText="Fuel_ID" SortExpression="Fuel_ID" />74 <asp:BoundField DataField="WgtLo_IN" HeaderText="WgtLo_IN" SortExpression="WgtLo_IN" />75 <asp:BoundField DataField="WgtHi_IN" HeaderText="WgtHi_IN" SortExpression="WgtHi_IN" />76 <asp:BoundField DataField="ZoneLo_IN" HeaderText="ZoneLo_IN" SortExpression="ZoneLo_IN" />77 <asp:BoundField DataField="ZoneHi_IN" HeaderText="ZoneHi_IN" SortExpression="ZoneHi_IN" />78 <asp:BoundField DataField="DIFSEX_CH" HeaderText="DIFSEX_CH" SortExpression="DIFSEX_CH" />79 <asp:CheckBoxField DataField="IsCWT_LG" HeaderText="IsCWT_LG" SortExpression="IsCWT_LG" />80 <asp:CheckBoxField DataField="IsRES_LG" HeaderText="IsRES_LG" SortExpression="IsRES_LG" />81 <asp:CheckBoxField DataField="ReRate_LG" HeaderText="ReRate_LG" SortExpression="ReRate_LG" />82 <asp:BoundField DataField="OStPv_CD" HeaderText="OStPv_CD" SortExpression="OStPv_CD" />83 <asp:BoundField DataField="DStPv_CD" HeaderText="DStPv_CD" SortExpression="DStPv_CD" />84 </Columns>85 <SelectedRowStyle BackColor="#FFC080" />86 <HeaderStyle BackColor="SandyBrown" Font-Names="Arial" Font-Size="8pt" />87 <AlternatingRowStyle BackColor="#E0E0E0" />88 </asp:GridView>89 </ContentTemplate>9091 </atlas:UpdatePanel>92 </td>93 </tr>9495 </table>96 <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:myEDIConnectionString%>"97 SelectCommand="SELECT UPS185_E_FF_ProdSvcU_T.* FROM UPS185_E_FF_ProdSvcU_T"></asp:SqlDataSource>98 </td>99 <td valign="top" align="left" style="width: 25px">100 </td>101 </tr>102 </table>103</div>104</form>105</body>106</html>107108109>>>>>>One Update Panel Page>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>110111112<%@. Page Language="C#" AutoEventWireup="true" CodeFile="Test.aspx.cs" Inherits="Test" Title="Untitled Page" %>113114<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">115<html xmlns="http://www.w3.org/1999/xhtml" >116117118<atlas:ScriptManager ID="ScriptManager1" EnablePartialRendering="true" runat="server">119120</atlas:ScriptManager>121<head id="Head1" runat="server">122123</head>124<body>125<form id="form1" runat="server">126<div>127<table style="width: 100%; height: 100%; vertical-align: top; text-align: left;" >128129130 <tr align="left">131132 <td valign="top" align="left">133134135 <table style="width: 100%; border-right: thin solid;136 border-top: thin solid;137 border-left: thin solid;138 border-bottom: thin solid;">139 <tr style="border-right: thin solid;140 border-top: thin solid;141 border-left: thin solid;142 border-bottom: thin solid;143 width: 100%;144 height: 75px;">145 <td style="width: 25%; vertical-align: middle; text-align: left;">146147148149 </td>150151 </tr>152153 <tr style="border-right: thin solid; border-top: thin solid; border-left: thin solid;154 width: 100%; border-bottom: thin solid">155 <td colspan="2" style="vertical-align: top; height: 100%; text-align: left">156 <atlas:UpdatePanel ID="UpdatePanel7" runat="server" Mode="Always">157 <ContentTemplate>158159  <asp:GridView ID="gvTrk" runat="server" Width="100%" Caption="Duplicates Trackers" AllowPaging="True" CaptionAlign="Top" Font-Bold="True" AllowSorting="True" AutoGenerateSelectButton="True" DataSourceID="SqlDataSource1" style="position: static" AutoGenerateColumns="False" OnSelectedIndexChanged="gvTrk_SelectedIndexChanged" Visible="False" >160 <Columns>161 <asp:BoundField DataField="UPS185_E_FF_ProdSvcU_ID" HeaderText="UPS185_E_FF_ProdSvcU_ID"162 InsertVisible="False" ReadOnly="True" SortExpression="UPS185_E_FF_ProdSvcU_ID" />163 <asp:CheckBoxField DataField="PrimaryPS_LG" HeaderText="PrimaryPS_LG" SortExpression="PrimaryPS_LG" />164 <asp:BoundField DataField="PkgType_VC" HeaderText="PkgType_VC" SortExpression="PkgType_VC" />165 <asp:BoundField DataField="ChargeCategoryCode_CH" HeaderText="ChargeCategoryCode_CH"166 SortExpression="ChargeCategoryCode_CH" />167 <asp:BoundField DataField="ChargeCategoryDetailCode_CH" HeaderText="ChargeCategoryDetailCode_CH"168 SortExpression="ChargeCategoryDetailCode_CH" />169 <asp:BoundField DataField="ChargeClassificationCode_VC" HeaderText="ChargeClassificationCode_VC"170 SortExpression="ChargeClassificationCode_VC" />171 <asp:BoundField DataField="ChargeDescriptionCode_VC" HeaderText="ChargeDescriptionCode_VC"172 SortExpression="ChargeDescriptionCode_VC" />173 <asp:BoundField DataField="SvcDesc_VC" HeaderText="SvcDesc_VC" SortExpression="SvcDesc_VC" />174 <asp:BoundField DataField="PS_Mstr_ID" HeaderText="PS_Mstr_ID" SortExpression="PS_Mstr_ID" />175 <asp:BoundField DataField="ModeCat_ID" HeaderText="ModeCat_ID" SortExpression="ModeCat_ID" />176 <asp:BoundField DataField="CWTByPkg_PS_ID" HeaderText="CWTByPkg_PS_ID" SortExpression="CWTByPkg_PS_ID" />177 <asp:BoundField DataField="Fuel_ID" HeaderText="Fuel_ID" SortExpression="Fuel_ID" />178 <asp:BoundField DataField="WgtLo_IN" HeaderText="WgtLo_IN" SortExpression="WgtLo_IN" />179 <asp:BoundField DataField="WgtHi_IN" HeaderText="WgtHi_IN" SortExpression="WgtHi_IN" />180 <asp:BoundField DataField="ZoneLo_IN" HeaderText="ZoneLo_IN" SortExpression="ZoneLo_IN" />181 <asp:BoundField DataField="ZoneHi_IN" HeaderText="ZoneHi_IN" SortExpression="ZoneHi_IN" />182 <asp:BoundField DataField="DIFSEX_CH" HeaderText="DIFSEX_CH" SortExpression="DIFSEX_CH" />183 <asp:CheckBoxField DataField="IsCWT_LG" HeaderText="IsCWT_LG" SortExpression="IsCWT_LG" />184 <asp:CheckBoxField DataField="IsRES_LG" HeaderText="IsRES_LG" SortExpression="IsRES_LG" />185 <asp:CheckBoxField DataField="ReRate_LG" HeaderText="ReRate_LG" SortExpression="ReRate_LG" />186 <asp:BoundField DataField="OStPv_CD" HeaderText="OStPv_CD" SortExpression="OStPv_CD" />187 <asp:BoundField DataField="DStPv_CD" HeaderText="DStPv_CD" SortExpression="DStPv_CD" />188 </Columns>189 <SelectedRowStyle BackColor="#FFC080" />190 <HeaderStyle BackColor="SandyBrown" Font-Names="Arial" Font-Size="8pt" />191 <AlternatingRowStyle BackColor="#E0E0E0" />192 </asp:GridView>193 </ContentTemplate>194195 </atlas:UpdatePanel>196 </td>197 </tr>198199 </table>200 <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:myEDIConnectionString%>"201 SelectCommand="SELECT UPS185_E_FF_ProdSvcU_T.* FROM UPS185_E_FF_ProdSvcU_T"></asp:SqlDataSource>202 </td>203 <td valign="top" align="left" style="width: 25px">204 </td>205 </tr>206 </table>207</div>208</form>209</body>210</html>211