Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
my dropdownlist in updatepanel and numaric textbox is outside the updatepanel
my designe is

XML
<td style="width: 50%" align="left" valign="middle">                             
 <asp:UpdatePanel ID="UpdatePanel1" runat="server">
  <ContentTemplate>
<asp:DropDownList ID="ddlVendorName" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlVendorName_SelectedIndexChanged">
<asp:ListItem Text="Select" Value="0"></asp:ListItem>
</asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
</td>

XML
<td style="width: 50%">
<cc1:NumericTextBox ID="txtDiscount" runat="server" MaxLength="6"
TabIndex="1" AllowDecimal="True"></cc1:NumericTextBox>
</td>

In Page load I am Binding data to dropdownlist and
using dropdown selected value i am getting discount value from database and assign to dataset , from that dataset value assign to txtDiscount
in this ddlVendorName_SelectedIndexChanged event i have some code like
protected void ddlVendorName_SelectedIndexChanged(
DataSet ds = new MI.DAL.InventoryPurchases().GetVendorsPriceDetails(Convert.ToInt32(ddlVendorName.SelectedValue));
txtDeduction.Text = ds.Tables[0].Rows[0][0].ToString();

that value is coming but it is not sohwing at front end on browser .

pls help me ....
Posted
Comments
/\jmot 5-Feb-15 0:54am    
debug the code and see what value ds.Tables[0].Rows[0][0].ToString(); getting???
Member 10776340 5-Feb-15 1:02am    
thanks for responding, i saw that value ie 35 this value also assigned textbox but it is not showing on browser.
/\jmot 5-Feb-15 1:05am    
are you using update-panel????
and make sure that you are checking IsPostBack event in page load.
Member 10776340 5-Feb-15 1:18am    
yes iam using update-panel ,and in page load in !IsPostBack i am binding dropdown list and in IsPostBack i am calling
ddlVendorName_SelectedIndexChanged(sender,e) event also it is not showing on browser .i saw the value i.e 35 in code with debuging.pls solv the prblm
/\jmot 5-Feb-15 1:23am    
thats it, its for your update pannel..
use this.,..
<asp:UpdatePanel ID="UpdatePanel2" runat="server"
UpdateMode="Conditional">
<contenttemplate>
<asp:Label ID="Label2" runat="server"
ForeColor="red" />
……………………………………………………..
………………………………………………………
……………………………………………………….

<Triggers>
<asp:AsyncPostBackTrigger ControlID="ddlVendorName"
EventName="SelectedIndexChanged" />
</Triggers>

1 solution

you have added your update panel to your td, it's work only for it, and as you shown your code, your textbox is on other td, so ti will not updated on UI.

please remove your update panel from your td, and add whole table inside your update panel, so your problem is solved.

Reference...

Working with jQuery within the ASP.NET UpdatePanel[^]

http://www.asp.net/ajax/documentation/live/overview/updatepaneloverview.aspx[^]

http://ajax.net-tutorials.com/controls/updatepanel-control/[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900