UpdatePanel Refreshes Only Once?
Apr 3, 2010
I have two updatepanels inside an accordion control, laid out like this:
<accordion>
<first pane content>
<updatepanel UpdateMode="conditional">
<contenttemplate>...</contenttemplate>
<triggers>...</triggers>
</updatepanel>
</first pane content>
<second pane content>
<updatepanel>
<contenttemplate>...</contenttemplate>
<triggers>...</triggers>
</updatepanel>
</second pane content>
</accordion>
The panel updates once, but after that, no updates take place. If I refresh the page, then I can see the updated information. This means that the database is being updated, but the updatepanel isn't refreshing (after refreshing the first time). Why is this happening?
update
The problem seems to lie when I call this:
Sys.require(Sys.components.accordion, function() {
$("#acca_profile").accordion({
HeaderCssClass: "acc_header",
HeaderSelectedCssClass: "acc_selectedheader",
FadeTransitions: true,
suppressHeaderPostbacks: true,
requireOpenedPane: false
});
});
in the endRequestHandler function. However, if I don't call it, then the div that should be converted to an accordion is no longer an accordion.
Update 2
After a bit more work, I figured the problem may lie in the fact that the Jquery is not rebinding the events after the partial postback. A lot of solutions claim that you have to register the client script, but I have this at the top of my aspx page:
<asp:ScriptManager runat="server" EnablePageMethods="true">
<Scripts>
... (other script)
Path="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" />
</Scripts>
</asp:ScriptManager>
How can I rebind the JQuery events in my code?
View 1 Replies
Similar Messages:
Jun 23, 2010
I have a grid. Inside the grid I have a button which is placed inside an update panel, which when clicked should do something I tell it to do in code behind. The problem is that when I click the button, it ignores the fact that the button is inside the update panel and it refreshes the entire grid, instead of refreshing only the stuff inside the update panel. What I need it to do instead is update only things inside the update panel my button is in, but leave alone the grid.
This is the setup I currently have:
<asp:GridView ID="grv_FieldDesc" EnableViewState="True" runat="server" DataSourceID="ObjectDataSource1"
OnPreRender="grv_FieldDesc_PreRender">
<asp:TemplateField HeaderText="Hidden">
<EditItemTemplate>
<asp:UpdatePanel ID="updp_grids_formula" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:LinkButton ID="Button1" runat="server" OnClick ="Button1_Click">LinkButton</asp:LinkButton >
</ContentTemplate>
</asp:UpdatePanel>
</EditItemTemplate>
</asp:TemplateField>
</asp:GridView>
View 1 Replies
Jun 21, 2010
I am using web parts in asp.net 2.0 . Its all work well except every time I drag & drop or minimise and element the whole page get refreshed. I am also using master pages and theming.
View 4 Replies
Apr 9, 2010
I have a created a form using a user control. One of the dropdownlists in the form is populated after the user makes a specific selection from another dropdownlist...i.e. a dependent dropdown list. This is triggered using the SelectedIndexChanged event handler on the controllling dropdownlist.
The dependent dropdownlist gets populated correctly, but when I choose one of the options and go to submit the form, the dependent dropdown list is reset and doesn't maintain the selection that was made.
The controlling dropdown list ID is "level". The dependent dropdown list ID is "EnrollmentSize".
The "EnrollmentSize" DDL only losses the option that was selected. The DDL is sitll populated with all the correct values. It only losses the option that was selected and goes back to the first option...i.e. "Select..."
The viewstate on the page is enabled and all the other form values are maintained. It is only happening with the EnrollmentSize ddl.
I've set breakpoints and tried debugging and I do see that the EnrollmentSize.SelectedValue is an empty string, but I don't see why or where that is happening in the button click event
I thought it had something to do with EnableViewState,but that is set to true and has no bearing. Everytime I try to submit the form, the "EnrollmentSize" DDL is reset and doesn't maintain the option that is selected.
[Code]....
[Code]....
View 4 Replies
Dec 2, 2010
I've two SqlDataSources and two Repeaters, each repeater contains one hyperlink (i also tried using web server button and anchors). The hyperlinks fetch from the database some values and in the NavigationUrl property I use a string.Format method to create a parameterized url, to pass for the browser, then second repeater is populated according to the value passed in the url which is originally passed by the first repeater's hyperlink. this is my sample code : [URL]
<asp:ScriptManager id="Scrptmanagr" runat="server"></asp:ScriptManager>
<asp:UpdatePanel id="updtpanl" runat="server">
<ContentTemplate>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:testConnectionString %>"
SelectCommand="SELECT [arrange_by_id], [arrange_by] FROM [arrange_by]">
</asp:SqlDataSource>
<asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1">
<ItemTemplate>
<asp:HyperLink ID="HyperLink3" NavigateUrl='<%# string.Format("{0}?SortingType={1}",Request.AppRelativeCurrentExecutionFilePath, Eval("arrange_by_id"))%>' runat="server"><%# Eval("arrange_by") %></asp:HyperLink>
</ItemTemplate>
<SeparatorTemplate>
|
</SeparatorTemplate>
</asp:Repeater>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:testConnectionString %>"
SelectCommand="SELECT [alphabet_id],[arrange_by_id], [value] FROM [alphabet] WHERE ([arrange_by_id] = @arrange_by_id)">
<SelectParameters>
<asp:QueryStringParameter Name="arrange_by_id" QueryStringField="SortingType" Type="Int32" DefaultValue="1" />
</SelectParameters>
</asp:SqlDataSource>
<br /><br />
<asp:Repeater ID="Repeater2" runat="server" DataSourceID="SqlDataSource2">
<ItemTemplate>
<asp:HyperLink ID="hyper1" runat="server" NavigateUrl='<%#string.Format("{0}?SortingType={1}&SortBy={2}",Request.AppRelativeCurrentExecutionFilePath, Eval("arrange_by_id"),Eval("value"))%>'><%# Eval("value")%></asp:HyperLink>
</ItemTemplate>
<SeparatorTemplate>
|
</SeparatorTemplate>
</asp:Repeater>
</ContentTemplate>
</asp:UpdatePanel>
Now! everytime I click any of the hyperlinks it causes a full post back and refreshes the page!
View 2 Replies
Jan 18, 2010
I have only a textbox in a page. If I type something inside the textbox and click carriage return key (Enter), the page refreshes and the textbox becomes blank again.
What is actually happening here? Why the page refreshes? Is it the default property of asp.net?
View 11 Replies
May 1, 2010
i have n image button with an event:
[Code]....
when i click the button the page refreshs.. is it possible to make the event heppen without refreshign the page?
View 16 Replies
Feb 18, 2010
I have a page with a GridView populated from an ObjectDataSource. The data source has some select parameters which are used to filter the data. I have a button and when clicked the GridView is filtered as expected. However I have other controls on the page which do not relate to the Gridview. When these control are clicked the gridview is filtered again.
How do I setup my page so that only one control updates the datasource?
Sample code below
[Code]....
View 21 Replies
Jan 31, 2011
I have a dropdownlist in the GridView ItemTemplate. I want my grid to be in edit mode on gridview load and not on edit item click. So I have a dropdwonlist in the ItemTemplte of my Gridview and I have an onload event in dropdownlist which populates the dropdown items. B=But when I click the dropdownlist, I cannot do anything, cant even select the dropdownlist items, it just shows the list items and goes back to the same mode.
<PLC:PLCDBGrid
ID="GridView1"
runat="server"
AllowSorting="True"
[Code]...
View 4 Replies
Feb 24, 2010
I have three parameters to search and the record is being populated on the gridview.
Paremeters are dropdown lists:
lstDepartment, lstSection, lstLocation
I used AutoPostBack to true for above dropdowns but the problem I am facing is when I select value in lstDepartment to show values in lstSection then gridview data refreshes and after that when I select lstSection to show values in lstLocation then again gridview refreshes.
What I want to do is to when I'll select dropdown one by one then gridivew display data when a Search button pressed.
I don't want to refresh gridview everytime on the basis of dropdown selection.
View 14 Replies
Sep 10, 2010
I am struggling to login into my web portal on my new sony vaio laptop. I think that I need to do some settings, or download some plugin. Infact I don't know what to do, as I have spent many hours trying to login, but no success. Below is my office website:[URL]When I enter my credentials and click login, the web page gets refreshed, i.e username and password get erased, rather than taking me into my web-portal. The laptop is having windows 7 home premium, with ie8. I have also tried installing firefox, chrome, opera and safari, but same problem.
as sony has refused to take the laptop back and they are saying that there is problem with website. Similarly, website staff are saying that there is a problem with the laptop and not with the website.
View 3 Replies
Jan 13, 2011
I have a simple search page with a drop down list that I would like the value to persist on refresh..basically the user will select their location from the dropdownlist and this will be used to populate a gridview. After this the page is set to refresh at a set interval and use the same location data initially selected by the user. However the initial selection is lost each time the page refreshes.
p.s system is to old for ajax!
<meta http-equiv="Refresh" content="300" />
<script runat="server">
Dim connectionString As String = ConfigurationManager.ConnectionStrings("****").ConnectionString
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
If Not IsPostBack Then
Dim conn As SqlConnection
conn = New SqlConnection(connectionString)
Dim Locationcommandtext As String
Locationcommandtext = "SELECT * FROM [Location] ORDER BY [Location]"
Dim loccomm As SqlCommand
loccomm = New SqlCommand(Locationcommandtext, conn)
Dim reader As SqlDataReader
Try
conn.Open()
reader = loccomm.ExecuteReader()
Locations.DataSource = reader
Locations.DataValueField = "LocationID"
Locations.DataTextField = "Location"
Locations.DataBind()
Catch ex As SqlException
Response.Write("SQL Error:
" & ex.ToString())
Finally
conn.Close()
End Try
Else
'"Viewstate should kick in here"
End If
End Sub
</script>
View 6 Replies
May 20, 2010
Refresh the Parent Window. I open the child window,I want that on close button click on child window,parent window refreshes
Code:
[code]....
I searched all on the net & find the above soln,But its not refreshing.when i click on button1,then some Pop up appears see in Pic(with buttons Retry & Cancel). When i click on Retry again the child window loads Then again i click on button1,again popup appears & so on & on.
View 10 Replies
Jan 24, 2011
I am trying to see if it possible to create a back button that goes back 3 pages and refreshes that page. The make up of my page is a little complex. The Home page has a password prompt that enables a multiview to be visible with a gridview of information. The gridview has a details link that has a 2 querystrings that gets sent to the details page. The details page has the ability to be edited and updated. this is why I wanted it to go back 3 pages. The code I am using to go back is
<asp:Button ID="Button2" runat="server" CausesValidation="False" OnClientClick="javascript:history.go(-3);return false;" Text="Back" UseSubmitBehavior="False" />
View 4 Replies
Feb 10, 2010
Im implementing a simple form with ajax to warn the user if email has been used or not for registration, and it looks to be working fine with IE but mozilla does a full page postback and refreshes the whole page.
I already tried changing to updatemode to conditional, all the triggers are set as async, etc but mozilla keeps doing the same, Im sure it is a known problem I may not be the first one facing this problem so i guess there is a simple workaround for this.
View 2 Replies
Oct 7, 2010
I have two update panels and one javascript control.
When the javascript button is clicked, it forces a partial postback on UpdatePanel2. UpdatePanel2 is populated with dynamically created buttons that have javascript effects (jquery) but when click can also induce a postback. My problem is that, when clicking on these dynamic buttons, the whole page does not do a partial post back but rather UpdatePanel2 itself does a partial postback and everything is gone.
However, what I want to do is be able to tie each of the dynamic buttons in UpdatePanel2 (After being dynamically created) and make them an asychnonous triggers to UpdatePanel1. So that when clicking on these dynamic buttons, ONLY UpdatePanel1 is doing a partial postback refresh. UpdatePanel2 stays put and remains the same.
View 1 Replies
Mar 26, 2010
i have Linkbutton inside updatePanel and when i click on it it returns following error
An extender can't be in a different UpdatePanel than the control it extends
View 1 Replies
Feb 14, 2011
I have a script inside an updatepanel. This script needs to be inside the updatepanel as it must be located in that spot.
Now when we click the "LinkButton" to update the updatepanel, the script will dissapear.
It seems that the script only is initiazed on the first Page_Load and Refresh of the page.
How can we keep it when pressing the "LinkButton"?
Complete code is below:
[Code]....
View 15 Replies
Mar 11, 2010
I am currently using a asp.net 2.0 with visual studio 2005.
I am trying to build a web application using ajax.
but when I drag the ajax updatepanel on asp.net page it is not resizable,so how should i put other controls on it?
View 4 Replies
Oct 14, 2010
i am using a TabContainer and at each TabPanel i have embed an UpdatePanel in order to update each tab alone.
this is my code:
[Code]....
the problem is that it makes several seconds to update each tab (the same time for every tab) and i asume that this is happening because it updates all the TabContainer and not the selected Tab.
View 2 Replies
Aug 17, 2010
I am trying to trying to setup an updatepanel to update every X seconds, the problem is I don't want the control to actually refresh unless there is new data. So I currently have a child updatepanel in a parent UpdatePanel, the child updatepanel gets refreshed by a timer. But I can't seem to find a way to trigger the parent panel to update. Again, only when certain conditions(data changed) are met.
Sample Code:
[code]....
View 1 Replies
Jan 20, 2011
I have two updatepanels on my site (upanProfileSearch and upanMemberList). When I hit the button in the upanProfileSearch it should bind the Data Items in the gridview in upanMemberList and here make a RowFilter on the text in upanProfileSearch. When I make a run to curser, I can see, it happens. It makes a RowFilter. but it doesn't update the gridview. Can anyone tell me why it doesn't update? I have UpdateMode="Always" and RenderMode="inline" on both UpdatePanels.
[Code]....
[Code]....
View 1 Replies
Jun 23, 2010
I have a dropdownlist, that causes a postback. On the SelectedIndexChanged event, is it possible to force a placeholder that is within a different UpdatePanel to change it's visibility?
For example, when the SelectedItem.Value of DropDownList1 is "1" then show Placeholder1, otherwise hide it.
What I am most interested in is how to configure the UpdatePanels to allow this.
View 3 Replies
Nov 11, 2010
How to implement updatepanel functionality without updatepanel?
I am tring to use XMLHttpRequest but I am getting problem while redering a usercontrol containing postback controls in response of an Ajax request.
Here is my code
[Code]....
[Code]....
[Code]....
View 5 Replies
Mar 4, 2011
I have a web user control with one updatepanel (pnlUpdate_2), some controls and one apply button. I display the web user control as a modalpopup in my default page. In my default page i have an updatepanel (pnlUpdate_1) with a gridview and I modify that gridview with the apply button of the web user control. The web user control is for made a custom search of the gridview data. I have a problem with both updatepanels. If I set the updatemode as always in one of them (pnlUpdate_1) and the other as conditional (pnlUpdate_2), the pnlUpdate_1 make a postback in the pnlUpdate_2; I'm not an expert on this but I think that's why the pnlUpdate_2 disappear and reappear after postback of some controls in that updatepanel (not the apply button, it close the modal after postback). I try all the combinations and the problem persists. So I put both updatepanels as conditional and in some way it works; now the problem is that when I click the apply button in pnlUpdate_2 to modify the gridview in pnlUpdate_1 the pnlUpdate_1 not made the postback I get the pnlUpdate_2 postback when I use some control inside the pnlUpdate_1.
How can I postback the pnlUpdate1 from pnlUpdate_2 with the apply button?
View 3 Replies