Camillia
asked on
Update Panel - I know why not sure how to fix
I know why this is happening but not sure how to fix it.
I have a panel like this in an UpdatePanel:
<div id="pnlOrderItems" runat="server">
<updatepanel>
<asp:Button runat="server" ...>
I click on that button and I want to update a text on a linkbutton THAT IS OUTSIDE that updatepanel. Code is correct but i think because that textbox is outside the panel, that's why it doesnt get updated.
Anyway to do this? This is the linkbutton i want to update. The text remains as "No Data". If I come back to the page, it shows the correct text.
***If I make the linkbutton part of the updatepanel, then it works. I cant do this tho because of the position of the link button. It has to be on top.
I have a panel like this in an UpdatePanel:
<div id="pnlOrderItems" runat="server">
<updatepanel>
<asp:Button runat="server" ...>
I click on that button and I want to update a text on a linkbutton THAT IS OUTSIDE that updatepanel. Code is correct but i think because that textbox is outside the panel, that's why it doesnt get updated.
Anyway to do this? This is the linkbutton i want to update. The text remains as "No Data". If I come back to the page, it shows the correct text.
***If I make the linkbutton part of the updatepanel, then it works. I cant do this tho because of the position of the link button. It has to be on top.
<asp:Content ID="Content2" ContentPlaceHolderID="PageMenu" Runat="Server">
<asp:Button ID="hlViewTranHistory" Visible="false" runat="server"/>
<asp:Label ID="lblNoTransactions" runat="server" Visible="false" Text="No Data."></asp:Label>
</asp:Content>
you can put the link button in its own update panel. what does the linkbutton update?
have the other button be the trigger for that update panel...
ASKER
>> you can put the link button in its own update panel. what does the linkbutton update?
I did that but the button wont display at all
>> have the other button be the trigger for that update panel...
How?
>> GiftsonDJohn:
I havent tried your method. I will
I did that but the button wont display at all
>> have the other button be the trigger for that update panel...
How?
>> GiftsonDJohn:
I havent tried your method. I will
ASKER
I tried the Javascript method. I put it in the grid's itemdatabound. Didnt work.
wrapped the button in another update panel. It just wont display.
I dont know what the 3rd method mean: have the other button be the trigger for that update panel...
wrapped the button in another update panel. It just wont display.
I dont know what the 3rd method mean: have the other button be the trigger for that update panel...
like
<asp:Updatepanel....>
contentTemplate
<asp:linkbutton...>
</contentTemplate>
<triggers>
<asyncy...controlID = "OtherButton">
or you could set the updatePanel which holds the link button to: UpdateMode="Always"> since its only the button
<asp:Updatepanel....>
contentTemplate
<asp:linkbutton...>
</contentTemplate>
<triggers>
<asyncy...controlID = "OtherButton">
or you could set the updatePanel which holds the link button to: UpdateMode="Always"> since its only the button
ASKER
let me try it. Thanks for responding again. thought u guys forgot.
ASKER
didnt work. That "otherbutton" is inside a Grid. So, it cant be seen. I did below and got an error that btnProcess cannot be found
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:Button ID="hlViewTranHistory" Visible="false" runat="server"/>
<asp:Label ID="lblNoTransactions" runat="server" Visible="false" Text="No View." ></asp:Label>
</ContentTemplate>
<Triggers><asp:AsyncPostBackTrigger ControlID="btnProcess" /></Triggers>
</asp:UpdatePanel>
Here you go.
Add Grid as control and RowCommand event for the trigger
Add Grid as control and RowCommand event for the trigger
ASKER
>>Add Grid as control and RowCommand event for the trigger
not sure what u mean.
not sure what u mean.
i guess maybe you should give some background on what you're trying to do and why you implemented code this way if possible...
I didn't realize the button was in a grid until just now...
I didn't realize the button was in a grid until just now...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
giftson, that is another way that I agree should work...
only thing if you can get it to work with javascript, it may be quicker...
ASKER
>> declare the event to be executed as asynchronous is RowCommand
so create a RowCommand for the Grid and in that RowCommand, update the control outside the updatepanel??
so create a RowCommand for the Grid and in that RowCommand, update the control outside the updatepanel??
If you want an asynchronous update, both of them should be inside update panel.
<asp:UpdatePanel ID=UpdatePanel1>
<ContentTemplate
<asp:Grid ID=Grid1> </Grid>
</ContentTemplate>
</asp:UpdatePanel
<UpdatePanel ID=UpdatePanel2>
<ContentTemplate>
<asp:Button ID="hlViewTranHistory" Visible="false" runat="server"/>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Grid1" EventName="RowCommand" />
</Triggers>
</UpdatePanel>
<asp:UpdatePanel ID=UpdatePanel1>
<ContentTemplate
<asp:Grid ID=Grid1> </Grid>
</ContentTemplate>
</asp:UpdatePanel
<UpdatePanel ID=UpdatePanel2>
<ContentTemplate>
<asp:Button ID="hlViewTranHistory" Visible="false" runat="server"/>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Grid1" EventName="RowCommand" />
</Triggers>
</UpdatePanel>
ASKER
when I put Button ID="hlViewTranHistory" inside an updatepanel, it disappears. Not sure why. So, I want it outside the updatepanel. What is that "RowCommand" method you mentioned?
ASKER
wroks now. Thanks you both.
ScriptManager.RegisterClie