Camillia
asked on
Stuff inside UpdatePanel disappear
I have a BUTTON inside an update panel: hlViewTranHistory
I have another updatepanel that has a GRID inside it. There's a button as part of the grid.
this is "btnProcess"
When i click the GRID button (btnProcess), i call a function that updates the other button's text. ***But this button wont even show up when I put it insde an update panel. OUTSide the update panel, the text wont get updated.
What to do? I called the function inside the GRID's button event. I think i even tried the Grid's itemdatabound...
I have another updatepanel that has a GRID inside it. There's a button as part of the grid.
this is "btnProcess"
When i click the GRID button (btnProcess), i call a function that updates the other button's text. ***But this button wont even show up when I put it insde an update panel. OUTSide the update panel, the text wont get updated.
What to do? I called the function inside the GRID's button event. I think i even tried the Grid's itemdatabound...
<asp:Content ID="Content2" ContentPlaceHolderID="PageMenu" Runat="Server">
<asp:Button ID="hlViewTranHistory" Visible="false" runat="server"/>
</asp:Content>
----function
private void NumberOfTransactions(Guid orderID)
{
int num = OrderProcessingFacade.GetNumberOfTransactions("Deck", orderID);
if (num > 0)
{
hlViewTranHistory.Visible = true;
hlViewTranHistory.Text = string.Concat("View: ", num.ToString());
}
else
{
}
}
ASKER
by default it's set to "Always".
ASKER
that's the default value of UpdatePanel, no?
if its inside the grid (as a column are you capturing the row command event. My code below works fine with the 2 update panels in this manner
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataKeyNames="PrimaryID" DataSourceID="SqlDataSource1"
onrowcommand="GridView1_RowCommand">
<Columns>
<asp:ButtonField CommandName="PressMe" Text="PressMe" />
<asp:BoundField DataField="PrimaryID" HeaderText="PrimaryID" InsertVisible="False" ReadOnly="True" SortExpression="PrimaryID" />
<asp:BoundField DataField="Column1" HeaderText="Column1" SortExpression="Column1" />
<asp:BoundField DataField="Column2" HeaderText="Column2" SortExpression="Column2" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:Expert ExchangeConnectionString %>" SelectCommand="SELECT * FROM [TestTable]"></asp:SqlDataSource>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpdatePanel2" runat="server">
<ContentTemplate>
<asp:Button ID="Button1" runat="server" Text="You Havent Clicked yet" />
</ContentTemplate>
</asp:UpdatePanel>
</form>
</body>
</html>
===============================================
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "PressMe")
this.Button1.Text = "Yay It worked";
}
ASKER
i think i dont have a scriptmanager on the page.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
let me see. I might have it on the master page tho. Let me try it again.
Farz, did you get things working?
ASKER
not yet, Will post back,.
Ram