.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Back button and update panel problem

Posted By:      Posted Date: October 18, 2010    Points: 0   Category :ASP.Net


I have a search page that uses an AJAX update panel to deliver results to the user. They can then navigate to a product page for more info. So far so good...

My problem occurs when they are on a product page and use the back button. They are redirected to the search page, but its a blank search page and not the one they left when they clicked for product details. I realise this is because the browser only made a history 'marker' (I dont know the technical term) when they first came to the search page, so this is what it returns them to.

Does anyone know how I can make the back button redirect the user to the search page as it was when they left it? I have tried making the page expire immediately and storing the search terms in session state so I can rebuild the page when they click 'back'. This works in IE, but not in Firefox as it seems to just load out the old page from the cache regardless of the expiration policy I set. As if that werent bad enough, this also causes 'corrupted state information' error when they try to search again.

Any suggestions? Any help would be very much appreciated.

Thank you

(PS -  I have seen various solutions to the back button/ajax problem, but none of them seem to address my problem. Or have I missed something?)


View Complete Post

More Related Resource Links

Modal Popup Extender and an Update Panel - "Cancel" Button problem


This should be a quick "yes" answer - I am in the process of creating a very simple test, but I thought I'd ask on here too (also, so other people might be able to find the answer, if they have the same problem).

I have created a modalpopupextender that opens up a panel containing an update panel.  I have a cancel button that is tied into the MPE's [CancelControlID] property and this closes the popup when I click it.  However, if I perform a partial postback within the update panel, the cancel button no longer works.  I have found an example online that seems to imply that the cancel button (and I'm guessing, by association) and the OK button should be outside the update panel.  Does the partial postback break the buttons' client script bindings, and thus should they always be placed outside the update panel?

Problem with master page and update panel (I think)



the app I am working with is made up of three nested master pages that have the following design:

The first master page ha only realize the HEADER, BODY and FOOTER divs.

The second one specialize the Body content placeholder and divide it in three more layers: NAVIGATOR, PAGE TITLE, BODY CONTENT.

The final layer specialize the BODY CONTENT in PAGE CONTENT and ACTIONS.

In one of my content pages I have (inside the PAGE CONTENT area) 

  • 1 Update Panel that contains a gridview object
  • 1 Update Panel that contains some HTML code to show in a PopupModalExtender

The PopupModalExtender can be either triggered from inside the gridView and also from a series of LinkButtons that are in the ACTIONS area.

The problem is that when the PopupModalExtender shows the FOOTER and the ACTIONS areas are not dimmed from the style I apply as background to the modal popup. An example of what I am trying to explain can be viewed in the following screenshot.

Why this is going to happen? Has anybody any suggestion on how to solve this problem?

Thanks a lot

i want to set textbox(txtTitle) and button by clicking linkbutton but due to update panel it is not

Here this is my html code.....i want to set txtTitle and btnAdd by the GridView1's value....i tried Trigger.but unable to get desired output..can anyone draw me out of this problem??======================================================================================<cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">    </cc1:ToolkitScriptManager>    <cc1:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0"         Width="500px">               <cc1:TabPanel runat="server" HeaderText="Add Category" ID="TabPanel1">            <HeaderTemplate>Add Category            </HeaderTemplate>        <ContentTemplate>                <asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate>        <asp:Panel ID="Panel2" runat="server" Width="485px"    GroupingText=&q

problem with update panel height

I am using ajax update panel to show a tree without postback there is a label that is at the top of the panel I am hiding the label while showing the tree. document.getElementById('ctl00_phldDialogBody_lbltext').style.display = "none"; in the javascript but even after hiding the space of the label is still left blank causing the tree to be moved down pls help to fix it i want the tree to be at the same position

logout problem(after logout when clicking on back button after logout still opens the previous page

I am using ASP.NET, the web page is abandoning and clear session when a user click logout link but they click the back button and it is still showing the previous page. How can it prevent the previous page after logout?on Logout.aspx load im using this code//=================//        Session.Clear();        Response.Buffer = true;        Response.ExpiresAbsolute = DateTime.Now.AddDays(-1D);        Response.Expires = -1500;        Response.CacheControl = "no-cache";        //----- Second Technique : To Stop Caching of Secure Pages.        Response.Cache.SetCacheability(HttpCacheability.NoCache);        FormsAuthentication.SignOut();        if (Session["UserName"] == null)        {            Response.Redirect("login.aspx");        }       Session.Clear();         Response.Buffer = true;         Response.ExpiresAbsolute = DateTime.Now.AddDays(-1D);         Response.Expires = -1500;         Response.CacheControl = "no-cac

update panel and jquery problem

I m working on JQuery, I have one UserControl in that I have taken one button(it is present inside an updatePanel).  when i m clicking on button on that time i want to show alert from server side for that i have written-  ScriptManager sm = ScriptManager.GetCurrent(Page); string strScript = "alert('hi')"; ScriptManager.RegisterStartupScript(this, typeof(UserControl_FrmUConFriendList), "AlertKey", strScript , true); But it is not working, if i m removing updatePanel then it is working. So plz help me. Thank's in advance.    

Problem with User Control, Update panel and flicker


I have  block of code that consists of a textbox a button and a dropdown. The text entered in the text box filters the dropdownlist when the user clicks the button. The Ajax works great when it is in a simple page but if I put the same code in a User control I get flicker. Can anyone assist with this issue?

Trouble with update panel and dynamic controls and post back


 I have a page that is mostly dynamically built in the page load of my VB.net code behind page.

The issue is that I made a change to the page and added a button that redirects to a secondary page. When the button is clicked there is a very noticeable lag until the button click event fires because the page is being rebuilt every time.

I had not wrapped the code in the load event in the If not ispostback.... because I have dynamic controls that the user interacts with and I need the page to be rebuilt when the user clicks them.

The dynamic controls are clickable table cells. I did some looking and I found that the RegisterPostBackControl. I thought this would be perfect but, it does not although I maybe using it incorrectly.

Here is the code flow.

Page Load

If not ispostback then


end if


private sub setuppage()

'get a reference to the scriptmanager on the master page

Dim scriptManager = DirectCast

ModalPopupExtender problem with browser back button


ModalPopUpExtender shows popup when user clicks browser back button.

I saw this thread but I could find the solution for this problem.


mesajrapor1 is my user control which contains the modalpopupextender

Here is my code:


protected void DataList1_ItemCommand(object source, DataListCommandEventArgs e)
        HyperLink hyp = (HyperLink)e.Item.FindControl("hypGonderenAD");
        Label lblicer = (Label)e.Item.FindControl("lblIcerikMesaj");
        Label midlbl = (Label)e.Item.FindControl("lblIdMesaj");
        Label sidlbl = (Label)e.Item.FindControl("Label3");

        if (e.CommandName == "SikayetEt")
            mesajrapor1.RaporGonder(hyp.Text.ToString(), lblicer.Text.ToString(), Convert.ToInt32(midlbl.Text), Convert.ToInt32(sidlbl.Text));

problem with user control+update panel+javascript


hai all,


Im having a aspx page which has 5 tabs inside a update panel..also I have a user control

Wen I click each tab im dynamically loading dat user control .

The problem is im using javascript in dat user control..

the user control has a button which displays a panel containing three grid views  n s activated by a java script as given below..

function Elig()



'<%=btnLegend.ClientID %>')).click(function(){


('<%=pBody.ClientID %>')).slideToggle('slow');




Wen i run the aspx page the first tab  successfully loaded with dat user control n a

Datagrid Link button within the Update panel events are not working



I have a datagrid with linkbutton within the datagrid.   When i click on link button there is no response.   I have tried in different ways like
1.   after data binding to the datagrid
2. AsyncPostBackTrigger ControlID="lnk1" EventName="Tick"

can any one please tell me How to fire the linkbutton

Thanks & Regards,

Update panel problem in gridview footer


On my aspx page, I'm having troubles when I have an update panel within the footer template of a gridview. It appears to be an intermitent problem that occurs on subsequent postback when you do a delete command in the gridview. The first delete command always goes through fine (first postback). Clicking on another row to delete on the gridview (or any other button on the form) triggers this error:

An error has occurred because a control with id 'ctl00$SupremeContent$grdLineNumbers$ctl09$ctl00' could not be located or a different control is assigned to the same ID after postback. If the ID is not assigned, explicitly set the ID property of controls that raise postback events to avoid this error.

If you click the back button in the browser, then click on another page, then come back to this page, you can delete another record. Another attempt to delete another record brings you back to the above problem. Thectl00$SupremeContent$grdLineNumbers$ctl09$ctl00 changes each time you delete, come back to the page and delete.

If I disable the udpate panel, there's no errors.

The reason I have the update panel is so that the user can select the relevant pipe specification (they see multiple columns using a textbox, drop down extender, panel and gridview) without the form's data being reset by the embedded gridview's

problem with greybox inside update panel


Hi ,

i am using an link which displays the window in a grey box

<script type="text/javascript"> var GB_ROOT_DIR = "<%= ConfigurationSettings.AppSettings["SunTrust.SOS.BaseURL"] %><%= ConfigurationSettings.AppSettings["Root_Dir_Lightbox"] %>";

<script>script type="tex

Update Panel Postback Problem?



Related to my previous question which is answered. The deal is, there is an update panel for modalpopup extender that is triggered by a button. The problem is when the form is submitted by a button, this modal popup is seen on the page! I do NOT want this modal popup extender to be seen when the form is submitted.

Any help please?

Thanks in Advance.

Best regards.

<asp:Label ID="lblPopupTargetID" runat="server" Style="display: none;"></asp:Label>
<asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="lblPopupTargetID"
PopupControlID="Panel1" BackgroundCssClass="modalBackground" DropShadow="true" />
<asp:Panel ID="Panel1" runat="server" CssClass="modalPopup" Width="600px">
<asp:UpdatePanel runat="server" ID="UpdatePanel1">

Update Panel Problem?



I want to update a portion of my page. There is a dropdownlist and a checkbox. I want to update checkbox (checked...etc) when user changes the selected index of dropdownlist. Here is the code below. But it does NOT update the check box?

Any help would be great.

Thanks in advance.

 <asp:UpdatePanel runat="server" ID="UpdatePanel9" UpdateMode="Conditional">
                            <asp:CheckBox ID="CheckBox_otipi" runat="server" Text="<%$ Resources:OdemeTalep, CheckBox_otipi %>" />
                            <asp:AsyncPostBackTrigger ControlID="DropDownList_parabirimi" EventName="SelectedIndexChanged" />

Radio buttons, a label and an image button show twice inside update panel


I have an update panel with a set of 2 radio buttons, a label and an image button inside of it. There another set of 3 radio buttons that trigger the update panel. I got everything working but now the image button, label and set of 2 radio buttons inside the update panel show up twice when the radio button triggers are selected? Any ideas?

Update Panel Problem



on button click event i called server side code(enable page contorls) and then call javascript function using following code

protected void btnNewPayments_Click(object sender, EventArgs e)

protected void btnNewPayments_Click(object sender, EventArgs e)



ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "key", "return EnableDisable(true,false)", true);


all the server side code execute and JScript function call as well. But Page controls not enabled. I think this is update panel error.

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend