.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

textbox clears after a few secs in update panel

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

Strange problem, not sure why it's happening.  Basically I have inside an UpdatePanel a dropdownlist, a textbox, and a regex validator.  page loads, ddl is bound and then based on the value in the ddl, a different regex is applied to the textbox.  DDL could have search by "date" (with date regex), "last name" (with az regex), or "zip code" (with a zip regex).  This way one search box can be used with 3 different regexes.  Select zip code in the ddl, the OnSelectedIndexChanged is fired and the new regex is applied to the textbox.  Simple.

The problem is, though, is that the page loads, I select Zip Code in the DDL, type in a zip code and then tab out NOT clicking the search button, and as soon as I do the regex validator fires with the red *.  I wait about 2-3 seconds and it appears there's a postback that's fired somewhere because the textbox gets cleared out.  Here's the update panel.

		<asp:UpdatePanel runat="server" ID="updpnl">
			  <td>Search by:</td>
			    <asp:DropDownList ID="ctrlSearchByField" runat="server" AutoPostBack="true" DataValueField="Key

View Complete Post

More Related Resource Links

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

Update Panel - TextBox



              I m getting a value into Textbox using Javascript. That textbox value may or maynot changes when I click on button in the same page.

When textbox value changes, I want to trigger the textbox event automatically and want to display the info on the same page.

Simply, whenever textbox value changes, I need autopostback. But I dont want to postback whole page.


Treeview problems in Update panel



I tried using this code, on a Treeview inside an update panel, which is populated dynamically in code behind. 

However, it doesnt give me the required functionality.

Following is my aspx code for the TreeView and the TreeView populating logic:


<div id="treelist">
<asp:UpdatePanel ID="UpdatePanel1&quo

Accordion Control with Panel...Add an Update Panel?


I have an accordion control in my web site.  And in one of the panels, I have a drop down list box where, when the user selects an item, it updates the labels right below the ddlistbox.  I have it so that it maintains the scroll position when the ddlistbox has an autopostback, but it's very obvious that the whole page posts back.

My question is, can I/should I just enclose the ddlistbox and the labels (and a couple of text boxes) in an AJAX update panel?  I already have a ToolScriptManager (because of the accordion control), so I don't need to have another script manager, right?  I can just put the update panel (with the other controls inside of it) right in the accordion panel, right?  Then when the ddlistbox posts back it won't have the delay of the whole page posting back?  And it'll still execute the event handler for the listbox selection change?

Does this sound right?  I'm just looking to make the post back "invisible", and I would like to do a partial postback of just these few controls.

Thanks in advance! :)

update panel in content page



iam using master page  and i am using update panel in content pages (child pages)

my questions is that can use updatepanel in every child page or  master page only.

give ur suggestions, i have senario , in a page i have file upload concept ,updatepanel

is not support that fileupload.

Textbox text populated by Session Variable wont update into SQL with new text


Hi everyone, I have what I think is a weird issue. I send text from one page to another via Session Variable. When page 2 loads, the text box has the session text set, but if the user changes the text and clicks the button, the SQL database is update with the original session text. If I remove the redirect from the page 2 button_Click method, then, the page refreshes with the textbox reverting to the session text and thr SQLDataSource has the session text added to it.

Why would the button click cause the textbox refresh with the text from the pageLoad before updating the data source?


Partial Class _1
    Inherits System.Web.UI.Page

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        Session("UpdateProd") = "Have some text here to send to a textbox on page 2"
    End Sub
End Class

Partial Class _2
    Inherits System.Web.UI.Page


Wizard in an Update Panel


Hi everybody. Heres the deal. I have a three step Wizard with various textboxes in it. I out the Wizard inside an Update Panel and Content Template. I launch the site and the first step of the wizard is executed nicely but when I click next to get to the second step, nothing happen. If I take the wizard out of the update panel then it works fine.

Any help would be very much appreciated cause I am a bit new in ASP.NET.

Thanx a lot.

Trying to set update panel trigger programmatically


 I have a recursive sub that finds a dropdown list and sets up an AsyncPostbackTrigger for an update panel. I have tried calling this sub both from page_init and page_load 

If the dropdownlist is within the update panel, eveything works fine. If the dropdown list is not in the updatepanel I get error

A control with ID 'ddlPersonFilter' could not be found for the trigger in UpdatePanel 'up1'. In both cases the sub does find the dropdown list and executes the code to set up the trigger. Thanks for your help.

    Private Sub SetUpdatePanelTrigger(ByVal oControl As Control)
        For Each ctrl As Control In oControl.Controls
            If TypeOf ctrl Is DropDownList Then
                If CType(ctrl, DropDownList).ID = "ddlPersonFilter" Then
                    Dim thisddl As New DropDownList
                    Dim thistrigger As New AsyncPostBackTrigger
                    thisddl = ctrl
                    thistrigger.EventName = "SelectedIndexChanged"
                    thistrigger.ControlID = thisddl.ID
                    Exit Sub
                End If
                If ctrl.HasControls Then
                End If
            End If

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

changing records frm control in update panel


i have a list box, a command button and a grid

when i click a particular record / or multiple records on the  list box and then cclick the command button the records r transferred 2 the grid

i also have custom paging, the paging shld ocur as many times i clcik the command button

i have used updatepanel with the command button in it so that partial postback ocurs or there is no page flicker ,

but when i use update panel i get teh records in the grid but custom page is not working . it has no affect even if the records are added

if i remove update panel the paging works properly

how do i manage it with update panel

Changing a textbox's readonly property right before update on a gridview


I have a gridview with a date field. I don't want the user to be able to type in their own date and mess up the format so I made the property readonly. That date is then set by a point and click interface. This is all working fine but when the user clicks update this field doesn't update because it's readonly. If i turn readonly off it works so is there a way to turn off the readonly property right before submit?

Update Panel only doing full postback

I have a page with a TabContainer with 3 tabs.  Within each tab, I have an UpdatePanel.  One of my UpdatePanel's update mode is set to "conditional" and I've added an asyncpostbacktrigger with the controlId="btnClearEmail1" and the eventname="Click".  When I run the page and click the button assigned to the asyncpostback trigger, the page will do a full postback.  Am I forgetting something?  How can I get it to just refresh what is inside the UpdatePanel?  <asp:tabcontainer id="ajaxTabContainer" runat="server"> <asp:tabpanel id="ajaxTabCustomerInfo" runat="server" headertext="Customer Information" visible="true"> <contenttemplate> ... [clipped for brevity] </contenttemplate> </asp:tabpanel> <asp:tabpanel id="ajaxTabSiteBranding" runat="server" headertext="Custom Site Branding"> <contenttemplate> <asp:updatepanel id="UpdatePanel2" runat="server"> <contenttemplate> ... [clipped for brevity] </contenttemplate> </asp:updatepanel> </contenttemplate> </asp:tabpanel> <asp:tabpanel id="ajaxTabEmails" runat="server" headertext="E-mail Notifications"> <contenttemplate> <div> <asp:panel

Gridview's in Update Panel not updating

I have 2 gridviews in an update panel that for some reason will not update.  There is no data entry, paging, sorting going on, the data is just there to be displayed.  I'm using a timer that initiates every 5 minutes to trigger the updatepanel.  I also have an updatepanel on an additional page where I am also using a trigger to fire the updatepanel with 2 charts and 1 oneline/column gridview.  The 2 charts update just like they are supposed to however the gridview does not. Here is the code for the 2 Gridview aspx page:</head> <body> <form id="form1" runat="server"> <div> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:Timer ID="Timer1" runat="server" Interval="300000" Enabled="True"> </asp:Timer> <br /> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <Triggers> <asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" /> </Triggers> <ContentTemplate> <table class="style1"> <tr>

Javascript to update value in Textbox

Hi I have a javascript file, which creates a calendar picker. This file is used through out the application and is a piece of code that I have to use because my .Net application is part of another application which uses this piece of JavaScript code.Anyhow, with the calendar picker I can save the date into a textbox, but the problem that I have is the format. Unfortunately, I cannot change the calendar picker code because this will affect other parts of the application. Therefore, what I am looking to do is to reformat the date on the textbox control. This I can do but only when I use the javascript event onfocus.Now, my question is this, is there away in javascript or with jquery that when a value enters into a textbox that this value is then reformatted to the format I want without postback or clicking on the textbox?Thanks

Using Update Panel on a repeater using Dropdown Autopostback

 Hi, The subject is explanatory, but here are some details:   I want to update a repeater when SelectedIndex value changes for a dropdown list. The problem is Nothing happens. My aspx page is present in a nested master page. and neither autopostback works nor update panel. i have set the AsyncPostBack trigger on SelectedIndexChange event.   Please let me know what am i doing wrong or what am i missing. PS: I have never worked on ajax before so I might have overlooked something.

AJAX update panel and update progress controls

I have writtena Crystal reports web application, that prompts ths user for parameters and then apply them and exports the report to a folder as .rpt and then display the report. I prompt the parameters on one screen and then display the report on another page. I have the AJAX update panel and update progress controls in the parameter page. When the user enters the parameters and click on ok, I export the report and then loads the report to a session report document and transfer the user to the second page where the report is displayed. I use the following code to do transfer to the seconds page. I have excluded the report load and parameter assign code here.rpt.ExportToDisk(ExportFormatType.CrystalReport, "c:\reports\testrep.rpt") Session("rpt") = New ReportDocument Session("rpt").load("c:\reports\testrep.rpt") Response.Redirect("show.aspx") In the second page I have the following: rptViewer.reportsource = Session("rpt") My problem is this works one time and then stops working the second. What I found out was it comes to the statement: Response.Redirect("show.aspx") But it does not even load the show.aspx page. It stays on the parameter page. There are no errors displayed. I could not see any errors when I debug the application also. And out of the blue it works

Multiple Update panel

 Hi All, I just need a small confirmation, that using multiple update panel in single ASP Page is a good practice or not? a. I can put whole page in single Update panel b. I can have multiple update panel in single page.   please suggest me which approach is good. I dont want to refresh all controls on very callback/postback.   thanks siraj    
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