Search Results

Search found 428 results on 18 pages for 'updatepanel'.

Page 2/18 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Problem with textbox inside updatepanel - not causing OnTextChanged event

    - by DaDa
    I have the following situation: I have a textbox inside an ajax updatepanel. Wherever the user types in the textbox I must display a message (different message that depends on the user typed data). <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always"> <ContentTemplate> <asp:TextBox ID="txtMyTexbox" runat="server" Width="500px" OnTextChanged="txtMyTexbox_TextChanged" AutoPostBack="true"></asp:TextBox> <br /> <asp:Label ID="lblMessage" runat="server" CssClass="errorMessage" Visible="false">Hello World</asp:Label> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="txtMyTexbox" /> </Triggers> </asp:UpdatePanel> In server side I have written the following at page load ScriptManager.GetCurrent(this).RegisterAsyncPostBackControl(txtMyTexbox); and the method like this protected void txtMyTexbox_TextChanged(object sender, EventArgs e) { if (.....) { lblMessage.Visible = false; } else { lblMessage.Visible = true; } } My problem now is that: when the user types in the textbox it doesn't cause OnTextChanged event. Am I missing something?

    Read the article

  • adding controls dynamically to panel in a UpdatePanel asp.net 4.0

    - by softwaremonster
    Hi, I have a UpdatePanel includes some panels. I want to add to these panel some controls according to the operations. After i click any button twice or after first page load the page gives error. Either I have to use each panel without any post back [no page refresh] how can i solve this? the html code is below. wordOrgButton enables word panel and after any operation fills that word panel. same for userOrgButton <asp:UpdatePanel ID="mainPanel" runat="server" Height="220px"> <ContentTemplate> <fieldset> <asp:Panel ID="buttonsPanel" runat="server"> <asp:Button ID="wordOrgButton" runat="server" Text="Words" onclick="wordOrgButton_Click" /> <asp:Button ID="userOrgButton" runat="server" Text="User" onclick="userOrgButton_Click" /> <asp:Button ID="exitButton" runat="server" Text="Exit" onclick="exitButton_Click" /> </asp:Panel> <asp:Panel ID="usersPanel" runat="server"> <asp:TextBox ID="whoisUserTextBox" runat="server"></asp:TextBox> <asp:Button ID="catchUserButton" runat="server" Text="Bring" onclick="catchUserButton_Click" /> <asp:Panel ID="userOrgPanel" runat="server" ></asp:Panel> </asp:Panel> <asp:Panel ID="wordsPanel" runat="server"></asp:Panel> <asp:Panel ID="informationPanel" runat="server"> <asp:Label ID="operationinfoLabel" runat="server"></asp:Label> </asp:Panel> </fieldset> </ContentTemplate> </asp:UpdatePanel>

    Read the article

  • ASP.NET UpdatePanel > Get selected value from checbox list outside of panel

    - by Rob
    Hi, I have a listing in an UpdatePanel I have some filters for that list in the form a checkboxList control. The checkboxList is created dynamically on page load During the Ajax update (postback), the checkbox list is not populated form the viewstate, so I cannot get the listing to filter. Note: If I put the checkbox list items directly in the markup, it all works, just not if the listing is populated on-postback. protected override void OnLoad(EventArgs e) { if (!Page.IsPostBack) { foreach (var p in global.Product) CheckListManufacurer.Items.Add(new ListItem(p, p)); } base.OnLoad(e); } <form id="ProductListForm" runat="server"> <asp:ScriptManager ID="ScriptManager" runat="server" EnablePartialRendering="true"></asp:ScriptManager> <asp:CheckBoxList ID="CheckListManufacurer" runat="server" EnableViewState="true"> <asp:ListItem Value="" Text="(All)"></asp:ListItem> </asp:CheckBoxList> <asp:Button id="btnTestAjax" runat="server" Text="Test" /> <asp:UpdatePanel ID="ProductsPanel" runat="server" UpdateMode="Conditional"> <Triggers> <asp:AsyncPostBackTrigger ControlID="btnTestAjax" /> <asp:AsyncPostBackTrigger ControlID="CheckListManufacurer" /> </Triggers> <ContentTemplate> <sr:ProductList ID="Products" runat="server" /> </ContentTemplate> </asp:UpdatePanel> </form>

    Read the article

  • UpdatePanel reloads the whole page

    - by Emil D
    Hi.I'm building an asp.net cutom control inside which I have two dropdownlists: companyIdSelection and productFamilySelection.I populate the companyIdSelection at Page_Load and in order to populate the productFamilySelection depending on the selected item in companyIdSelection.I'm using UpdatePanels to achieve this, but for some reason every time I update companyIdSelection Page_Load is being called ( which as far as I know should happen only when the entire page is reloaded ), the list is being reloaded again and the item the user selected is lost( the selected item is always the top one ).Here's the code <asp:UpdatePanel ID="updateFamilies" runat="server" UpdateMode="Always"> <ContentTemplate> Company ID:<br> <br></br> <asp:DropDownList ID="companyIdSelection" runat="server" AutoPostBack="True" OnSelectedIndexChanged="companyIdSelection_SelectedIndexChanged"> </asp:DropDownList> <br></br> Product Family: <br></br> <asp:DropDownList ID="productFamilySelection" runat="server" AutoPostBack="True" onselectedindexchanged="productFamilySelection_SelectedIndexChanged"> </asp:DropDownList> <br> </ContentTemplate> </asp:UpdatePanel> protected void Page_Load(object sender, EventArgs e) { this.companyIdSelection.DataSource = companyIds(); //companyIds returns the object containing the initial data items this.companyIdSelection.DataBind(); } protected void companyIdSelection_SelectedIndexChanged(object sender, EventArgs e) { // Page_Load is called again for some reason before this method is called, so it // resets the companyIdSelection EngDbService s = new EngDbService(); productFamilySelection.DataSource = s.getProductFamilies(companyIdSelection.Text); productFamilySelection.DataBind(); } Also, I tried setting the UpdateMode of the UpdatePanel to "Conditional" and adding an asyncpostback trigger but the result was the same. What am I doing wrong? PS: I fixed the updating problem, by using Page.IsPostBack in the Page_Load method, but I would still want to avoid a full postback if possible

    Read the article

  • ASP.Net UpdatePanel, want to have html-tag as a parameter

    - by Nordis
    This is my problem, I have one textbox, one button and one label. Everything is inside an updatepanel. Let's say I want to test if a valid html-tag is entered in the textbox when I press the button. In the code-behind I have a method for that. Everythings works just fine, except when I actually enter a html-tag in my textbox. If I test < html, it works. But not if I test . So my question is, doesn't the updatepanel accept html-tags as parameters? Because my breakpoint for the button_click doesn't triggers. Sorry for my bad english.. :)

    Read the article

  • ASP.NET GridView and UpdatePanel

    - by Echilon
    I have a GridView, inside a UserControl, inside an UpdatePanel on a page. There's a button in the GridView which needs to fire a postback. What happens is: User clicks button - RowCommand Fires - Custom event is raised on UserControl - Page detects this and changes the active view index for a multiview and also the page title and some other controls outside the UpdatePanel. The problem is, the page posts back asyncchronously, the page title changes, but the actions requireing a full postback don't happen because a full postback doesn't occur. To register the button as a postback trigger I'm using: ImageButton btnResults = e.Row.FindControl("btnResults") as ImageButton; ScriptManager scrCurrent = ScriptManager.GetCurrent(this.Page); if (btnResults != null && scrCurrent != null) { scrCurrent.RegisterPostBackControl(btnResults); } I know this is a bit of a complicated problem, but I'd really appreciate any help.

    Read the article

  • GridView paging inside an UpdatePanel or PlaceHolder components

    - by John
    Hello, I'm new to ASP.NET. Im developing ASP.NET C# web form which creating GridView components dynamically and filling them using the data received from my webservice. I'm creating these GridView components programmatically in server-side (cs file)- it has to be flexible - 1 GridView and sometimes 10 GridView components. The problem occurs when I'm trying to add pagination - whenever the user clicks the "next" page, the whole page is getting refreshed because of a postBack and I'm loosing all my data and the page returns Blank/Empty. I used PlaceHolder to hold the GridView components, while searching for a solution, I found UpdatePanel as a better alternative - as far as I understand the page can be partially refreshed - which means that only the UpdatePanel has to be refreshed...but it doesn't work. The following code sample is my TEST, the UpdatePanel is the only component initiated in the client side (aspx page), the rest initiated programmatically in CS. how can I solve the issue described above? Why does the whole page is getting refreshed and I'm loosing my data? can you recommend another way? can provide me with any code sample? If I'm not rebuilding the GridView, it doesn't work... Here is my Default.aspx.cs: public partial class TestAjaxForm : System.Web.UI.Page { DataTable table; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) bindGridView(); } public void bindGridView() { GridView gridView1 = new GridView(); gridView1.AutoGenerateColumns = true; gridView1.PageSize = 2; gridView1.AllowPaging = true; gridView1.PagerSettings.Mode = PagerButtons.Numeric; gridView1.PagerSettings.Position = PagerPosition.Bottom; gridView1.PagerSettings.PageButtonCount = 10; gridView1.PageIndexChanging += new GridViewPageEventHandler(this.GridView1_PageIndexChanging); table = new DataTable(); table.Columns.Add("FirstName"); table.Columns.Add("LastName"); DataRow row = table.NewRow(); row["FirstName"] = "John"; row["LastName"] = "Johnoson"; table.Rows.Add(row); row = table.NewRow(); row["FirstName"] = "Johnny"; row["LastName"] = "Marley"; table.Rows.Add(row); row = table.NewRow(); row["FirstName"] = "Kate"; row["LastName"] = "Li"; table.Rows.Add(row); panel.ContentTemplateContainer.Controls.Add(gridView1); gridView1.DataSource = table; gridView1.DataBind(); } protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e) { GridView gridView1 = (GridView)sender; gridView1.PageIndex = e.NewPageIndex; gridView1.DataSource = table; gridView1.DataBind(); } } Please help me, Thank you.

    Read the article

  • Selecting the contents of an ASP.NET TextBox in an UpdatePanel after a partial page postback

    - by Scott Mitchell
    I am having problems selecting the text within a TextBox in an UpdatePanel. Consider a very simple page that contains a single UpdatePanel. Within that UpdatePanel there are two Web controls: A DropDownList with three statically-defined list items, whose AutoPostBack property is set to True, and A TextBox Web control The DropDownList has a server-side event handler for its SelectedIndexChanged event, and in that event handler there's two lines of code: TextBox1.Text = "Whatever"; ScriptManager.RegisterStartupScript(this, this.GetType(), "Select-" + TextBox1.ClientID, string.Format("document.getElementById('{0}').select();", TextBox1.ClientID), true); The idea is that whenever a user chooses and item from the DropDownList there is a partial page postback, at which point the TextBox's Text property is set and selected (via the injected JavaScript). Unfortunately, this doesn't work as-is. (I have also tried putting the script in the pageLoad function with no luck, as in: ScriptManager.RegisterStartupScript(..., "function pageLoad() { ... my script ... }");) What happens is the code runs, but something else on the page receives focus at the conclusion of the partial page postback, causing the TextBox's text to be unselected. I can "fix" this by using JavaScript's setTimeout to delay the execution of my JavaScript code. For instance, if I update the emitted JavaScript to the following: setTimeout("document.getElementById('{0}').select();", 111); It "works." I put works in quotes because it works for this simple page on my computer. In a more complex page on a slower computer with more markup getting passed between the client and server on the partial page postback, I have to up the timeout to over a second to get it to work. I would hope that there is a more foolproof way to achieve this. Rather than saying, "Delay for X milliseconds," it would be ideal to say, "Run this when you're not going to steal the focus." What's perplexing is that the .Focus() method works beautifully. That is, if I scrap my JavaScript and replace it with a call to TextBox1.Focus(); then the TextBox receives focus (although the text is not selected). I've examined the contents of MicrosoftAjaxWebForms.js and see that the focus is set after the registered scripts run, but I'm my JavaScript skills are not strong enough to decode what all is happening here and why the selected text is unselected between the time it is selected and the end of the partial page postback. I've also tried using Firebug's JavaScript debugger and see that when my script runs the TextBox's text is selected. As I continue to step through it the text remains selected, but then after stepping off the last line of script (apparently) it all of the sudden gets unselected. Any ideas? I am pulling my hair out. Thanks in advance...

    Read the article

  • Reload external javascript after asynchronous postback via UpdatePanel

    - by Protector one
    I have an external javascript on my page, e.g. something like: <script src="http://foo.com/script.js" type="text/javascript"></script> and an UpdatePanel somewhere. The script writes some content, and does this from within an anonymous javascript function in the js file. I.e., there is something like this in the script: (function(){document.write('content');})(); Whenever the UpdatePanel is updated through asynchronous postback, everything the script did (or any javascript on my page, for that matter) is made undone. For normal javascript, I would just use: Sys.WebForms.PageRequestManager.getInstance().add_endRequest(myFunction) to redo all that, but since the function in the script source file is anonymous and called upon definition, I'm SOL! Any ideas? Note: the external js source is from another domain and its content is out of my control.

    Read the article

  • Memory Leak with jQuery UI inside UpdatePanel in ie7

    - by Ryan
    I have a fairly complex asp.net page based on UpdatePanels and jQuery UI. Unfortunately, when the panels update, the jQuery UI widgets leak memory like crazy in ie7, even if I manually 'destroy' them. Does anyone know a technique/patch to prevent these leaks? I've created a simple example page with a slider inside an UpdatePanel. Just click the 'Leak' button and refresh the page to see the leak in sieve. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Leak2.aspx.cs" Inherits="Leak2" %> <%@ Register Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI" TagPrefix="asp" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Leak</title> <link type="text/css" href="/jquery/css/custom-theme/jquery-ui-1.7.2.custom.css" rel="Stylesheet" /> <script type="text/javascript" src="/jquery/js/jquery-1.3.2.min.js"></script> <script type="text/javascript" src="/jquery/js/jquery-ui-1.7.2.custom.min.js"></script> </head> <body> <form id="form1" runat="server"> <div> <script type="text/javascript"> function initializeSlider() { $(".slider").slider({ min: 0, max: 100, value: 100, step: 5 }); } $(document).ready(function() { initializeSlider(); Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function() { initializeSlider(); }); }); </script> <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <div style="width: 300px;"> <div class="slider"></div> <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Leak" /> </div> </ContentTemplate> </asp:UpdatePanel> </div> </form> </body> </html>

    Read the article

  • UpdatePanel Full Postback

    - by Korivo
    Greetings, here is the scenario. I have and .aspx page with and updatepanel like this <asp:UpdatePanel id="uPanelMain" runat="server"> <ContentTemplate> <uc:Calendar id="ucCalendar" runat="server" Visible="true" /> <uc:Scoring id="ucScoring" runat="server" Visible="false" /> </ContentTemplate> The control ucCalendar is loaded first and it contains a grid like this <asp:DataGrid CssClass="grid" ID="gridGames" runat="server" AutoGenerateColumns="False" HeaderStyle-CssClass="gridHeader" ItemStyle-CssClass="gridScoringRow" GridLines="None" ItemStyle-BackColor="#EEEEEE" AlternatingItemStyle-BackColor="#F5F5F5" OnEditCommand="doScoreGame" OnDeleteCommand="doEditGame" OnCancelCommand="printLineup" OnItemDataBound="gridDataBound"> <Columns> <asp:TemplateColumn > <ItemTemplate> <asp:CheckBox ID="chkDelete" runat="server" /> </ItemTemplate> </asp:TemplateColumn> <asp:BoundColumn DataField="idGame" Visible="false" /> <asp:BoundColumn DataField="isClose" Visible="false" /> <asp:TemplateColumn HeaderText="Status"> <ItemTemplate> <asp:Image ID="imgStatus" runat="server" ImageUrl="~/img/icoX.png" alt="icoStatus" /> </ItemTemplate> </asp:TemplateColumn> <asp:TemplateColumn> <ItemTemplate> <asp:LinkButton ID="linkScore" runat="server" CommandName="Edit" Text="Score" /> </ItemTemplate> </asp:TemplateColumn> </Columns> </asp:DataGrid> So when i click the "linkButton", the codebehind of the userControl calls a public method in the .aspx as this: From the userControl protected void doScoreGame(object sender, DataGridCommandEventArgs e) { ((GM)this.Page).showScoring(null, null); } From the .aspx page public void showScoring(object sender, EventArgs e) { removeLastLoadedControl(); ucScoring.Visible = true; } So, here comes the problem: There are two postbacks taking place when I change the visible attribute of the ucScoring control. The first postback is fine, it's handled by the updatePanel. The second postback is a full postback, and i really don't understand why it is happening. I'm really lost here, please help! Thanks Mat

    Read the article

  • Setting Session Variable from UpdatePanel

    - by Gavin
    I am using ASP.NET 2.0 AJAX Extensions 1.0 with the version v1.0.20229 of the AJAX Control Toolkit (which to my knowledge is the latest for .NET 2.0/Visual Studio 2005). My web page (aspx) has a DropDownList control on an UpdatePanel. In the handler for the DropDownList's SelectedIndexChanged event I attempt to set a session variable. The first time the event is fired, I get a Sys.WebForms.PageRequestManagerParserErrorException: "The message received from the server could not be parsed". If I continue, subsequent SelectedIndexChanged's are handled successfully. I have stumbled upon a solution whereby if I initialise the session variable in my Page_Load (so the event handler is just setting the value of a session variable that already exists as opposed to creating a new one) the problem goes away. I'm happy to do this, but I'm curious as to exactly what the underlying cause is. Can anyone explain? (My suspicion is that setting the session variable receives a response from the server which is then returned to the 'caller', but it's not the sort of response it knows how to deal with causing the exception?) EDIT: I reproduced the problem in a seperate little project: Default.aspx <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="SessionTest._Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server" /> <div> <asp:UpdatePanel id="upCategorySelector" runat="server"> <ContentTemplate> Category: <asp:DropDownList ID="ddlCategory" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlCategories_SelectedIndexChanged"> <asp:ListItem>Item 1</asp:ListItem> <asp:ListItem>Item 2</asp:ListItem> <asp:ListItem>Item 3</asp:ListItem> </asp:DropDownList> </ContentTemplate> </asp:UpdatePanel> </div> </form> </body> </html> Default.aspx.cs using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; namespace SessionTest { public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { // If I do this, the exception does not occur. if (Session["key"] == null) Session.Add("key", 0); } protected void ddlCategories_SelectedIndexChanged(object sender, EventArgs e) { // If Session["key"] has not been created, setting it from // the async call causes the excaption Session.Add("key", ((DropDownList)sender).SelectedValue); } } }

    Read the article

  • JQuery BlockUI with UpdatePanel Viewstate Issue

    - by Chris
    I am using BlockUI to show a modal. Within the blocked modal I have an update panel. Within the update panel I have a textbox and a button that submits the content back to the server. Everything works fine up to this point (the blockUI is called, the modal appears, and the button performs the postback). However, when the button's click event is fired the value for the textbox is consistently empty even if text was entered. When the update panel updates the textbox shows up blank. It appears that this may be some sort of viewstate issue and I haven't turned off viewstate. <a href="javascript:$.blockUI({ message: $('#divTest') });">SHOW MODAL</a> <div id="divTest" style="display: none;"> <asp:UpdatePanel ID="upTest" UpdateMode="Conditional" runat="server"> <ContentTemplate> <asp:TextBox ID="txtTestVS" runat="server" /><br /> <asp:Button ID="cmdTest" Text="TEST" OnClick="cmdTest_Click" UseSubmitBehavior="false" runat="server" /> </ContentTemplate> </asp:UpdatePanel> SERVER-SIDE: protected void cmdTest_Click(object sender, EventArgs e) { string x = txtTestVS.Text; } String "x" always equal "".

    Read the article

  • UpdatePanel Javascript Error on Adding Clientside Listbox items After postback

    - by DBMaster
    Hi, I have a Dynamic list control of Metabuilder.Webcontrol inside UpdatePanel,I am adding removing Items using Javascript from the list control. It works fine Inside UpdatePanel. I have another control Gridview along with checkbox's which require postback to get populated. Once It gets populated successfully inside update without postback. I checked few rows and wanted to add them into List Control using Javascript. It says "object doesn't support this property or method" function addItmList(idv,valItem) { var list =document.getElementById('ctl00_ContentPlaceHolder1_MyList'); //var generatedName = "newItem" + ( list.options.length + 1 ); list.Add(idv,valItem); } function checkitemvalues() { var gvET = document.getElementById("ctl00_ContentPlaceHolder1_grd"); var target = document.getElementById('ctl00_ContentPlaceHolder1_lstIControl'); var newOption = window.document.createElement('OPTION'); var rCount = gvET.rows.length; var rowIdx = 0; var tcount = 1; for (rowIdx; rowIdx<=rCount-1; rowIdx++) { var rowElement = gvET.rows[rowIdx]; var chkBox = rowElement.cells[0].firstChild; var cod = rowElement.cells[1].innerText; var desc = rowElement.cells[2].innerText; if (chkBox.checked == true){ addItmList(rowElement.cells[1].innerText,rowElement.cells[2].innerText); } } } Code Behind ScriptManager.RegisterClientScriptBlock( Me.Page, Me.GetType(), MyList.ClientID, "" & vbCr & vbLf & "window.mylistid='" + MyList.ClientID + "';" & vbCr & vbLf & "", True ) Remember my code works fine. It cannot maintain the state of List Control thats why It says Object reqiured. Can any one help me out. After Update Panel Why My javascript doesnt add Items into ListBox. Thanks In advance

    Read the article

  • div innerHTML problem with updatepanel

    - by asif
    I have an application developed in asp.net which set innerhtml of div. I am creating an html string to show googlemap. It works fine. But when I put my div inside update panel. it doesnt show googlemap in div. Here is my aspx file code: </td> </tr> <tr> <td colspan="4"> <asp:UpdatePanel ID="UpdatePanel2" runat="server"> <ContentTemplate> <div id="map_canvas" runat="server" style="width: 100%; height: 1500px; margin-bottom: 2px; text-align: center;"> <asp:Panel ID="Panel1" runat="server"> <%--Place holder to fill with javascript by server side code--%> <asp:Literal ID="js" runat="server"></asp:Literal> <%--Place for google to show your MAP--%> <div id="Div1" style="width: 100%; height: 728px; margin-bottom: 2px;"> </div> <br /> </asp:Panel> </div> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="btnShow" EventName="Click" /> </Triggers> </asp:UpdatePanel> </td> </tr> here is my button click event. protected void btnShow_Click(object sender, EventArgs e) { // works fine without update panel. map_canvas.InnerHtml = showMapWithPoints(); }

    Read the article

  • AJAX UpdatePanel.Visible Property not working with Javascript

    - by Ahmet Altun
    I have code below. I want to hide the update panel by using Javascript (without going to server) when the user clicks Hide button. Although javascript funciton seems to be working fine in debugging, it does not hide! <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" % <script type="text/javascript" language="javascript"> function Show() { document.getElementById("UpdatePanel1").Visible = true; } function Hide() { document.getElementById("UpdatePanel1").Visible = false; } </script> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:Button ID="btnShow" runat="server" Text="Show" OnClientClick="Show(); return false;" /> <asp:Button ID="BtnHide" runat="server" Text="Hide" OnClientClick="Hide(); return false;" /> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <br /> <asp:TextBox ID="TextBox1" runat="server" TextMode="MultiLine"></asp:TextBox> <br /> <asp:Button ID="btnSubmit" runat="server" Text="Gönder" onclick="btnSubmit_Click" /> <br /> </ContentTemplate> </asp:UpdatePanel> </div> </form>

    Read the article

  • Custom Paging for GridView in an UpdatePanel not firing PageIndexChanging event

    - by JeffCren
    I have a GridView that uses custom paging inside an UpdatePanel (so that the paging and sorting of the gridview don't cause postback). The sorting works fine, but the paging doesn't. The PageIndexChanging event is never called. This is the aspx code: <asp:UpdatePanel runat="server" ID="upSearchResults" ChildrenAsTriggers="true" UpdateMode="Always"> <ContentTemplate> <asp:GridView ID="gvSearchResults" runat="server" AllowSorting="true" AutoGenerateColumns="false" AllowPaging="true" PageSize="10" OnDataBound="gvSearchResults_DataBound" OnRowDataBound ="gvSearchResults_RowDataBound" OnSorting="gvSearchResults_Sorting" OnPageIndexChanging="gvSearchResults_PageIndexChanging" Width="100%" EnableSortingAndPagingCallbacks="false"> <Columns> <asp:TemplateField HeaderText="Select" HeaderStyle-HorizontalAlign="Center"> <ItemTemplate> <asp:HyperLink ID="lnkAdd" runat="server">Add</asp:HyperLink> <asp:HiddenField ID="hfPersonId" runat="server" Value='<%# Eval("Id") %>'/> </ItemTemplate> </asp:TemplateField> <asp:BoundField HeaderText="First Name" DataField="FirstName" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" SortExpression="FirstName" /> <asp:BoundField HeaderText="Last Name" DataField="LastName" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" SortExpression="LastName" /> <asp:TemplateField HeaderText="Phone Number" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" > <ItemTemplate> <asp:Label ID="lblPhone" runat="server" Text="" /> </ItemTemplate> </asp:TemplateField> </Columns> <PagerTemplate> <table width="100%" class="pager"> <tr> <td> </td> </tr> </table> </PagerTemplate> </asp:GridView> <div class="btnContainer"> <div class="btn btn-height_small btn-style_dominant"> <asp:LinkButton ID="lbtNewRecord" runat="server" OnClick="lbtNewRecord_Click"><span>Create New Record</span></asp:LinkButton> </div> <div class="btn btn-height_small btn-style_subtle"> <a onclick="openParticipantModal();"><span>Cancel</span></a> </div> </div> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="gvSearchResults" EventName="PageIndexChanging" /> <asp:AsyncPostBackTrigger ControlID="gvSearchResults" EventName="Sorting" /> </Triggers> </asp:UpdatePanel> In the code behind I have a SetPaging method that is called on the GridView OnDataBound event: private void SetPaging(GridView gv) { GridViewRow row = gv.BottomPagerRow; var place = row.Cells[0]; var first = new LinkButton(); first.CommandName = "Page"; first.CommandArgument = "First"; first.Text = "First"; first.ToolTip = "First Page"; if (place != null) place.Controls.Add(first); var lbl = new Label(); lbl.Text = " "; if (place != null) place.Controls.Add(lbl); var prev = new LinkButton(); prev.CommandName = "Page"; prev.CommandArgument = "Prev"; prev.Text = "Prev"; prev.ToolTip = "Previous Page"; if (place != null) place.Controls.Add(prev); var lbl2 = new Label(); lbl2.Text = " "; if (place != null) place.Controls.Add(lbl2); for (int i = 1; i <= gv.PageCount; i++) { var btn = new LinkButton(); btn.CommandName = "Page"; btn.CommandArgument = i.ToString(); if (i == gv.PageIndex + 1) { btn.BackColor = Color.Gray; } btn.Text = i.ToString(); btn.ToolTip = "Page " + i.ToString(); if (place != null) place.Controls.Add(btn); var lbl3 = new Label(); lbl3.Text = " "; if (place != null) place.Controls.Add(lbl3); } var next = new LinkButton(); next.CommandName = "Page"; next.CommandArgument = "Next"; next.Text = "Next"; next.ToolTip = "Next Page"; if (place != null) place.Controls.Add(next); var lbl4 = new Label(); lbl4.Text = " "; if (place != null) place.Controls.Add(lbl4); var last = new LinkButton(); last.CommandName = "Page"; last.CommandArgument = "Last"; last.Text = "Last"; last.ToolTip = "Last Page"; if (place != null) place.Controls.Add(last); var lbl5 = new Label(); lbl5.Text = " "; if (place != null) place.Controls.Add(lbl5); } The paging works if I don't use custom paging, but I really need to use the custom paging. I can't figure out why the PageIndexChanging event isn't fired when I'm using the custom paging. Thanks, Jeff

    Read the article

  • UpdatePanel, Repeater, DataBinding Problem

    - by Gordon Carpenter-Thompson
    In a user control, I've got a Repeater inside of an UpdatePanel (which id displayed inside of a ModalPopupExtender. The Repeater is databound using an array list of MyDTO objects. There are two buttons for each Item in the list. Upon binding the ImageURL and CommandArgument are set. This code works fine the first time around but the CommandArgument is wrong thereafter. It seems like the display is updated correctly but the DTO isn't and the CommandArgument sent is the one that has just been removed. Can anybody spot any problems with the code? ASCX <asp:UpdatePanel ID="ViewDataDetail" runat="server" ChildrenAsTriggers="true"> <Triggers> <asp:PostBackTrigger ControlID="ViewDataCloseButton" /> <asp:AsyncPostBackTrigger ControlID="DataRepeater" /> </Triggers> <ContentTemplate> <table width="100%" id="DataResults"> <asp:Repeater ID="DataRepeater" runat="server" OnItemCommand="DataRepeater_ItemCommand" OnItemDataBound="DataRepeater_ItemDataBound"> <HeaderTemplate> <tr> <th><b>Name</b></th> <th><b>&nbsp;</b></th> </tr> </HeaderTemplate> <ItemTemplate> <tr> <td> <b><%#((MyDTO)Container.DataItem).Name%></b> </td> <td> <asp:ImageButton CausesValidation="false" ID="DeleteData" CommandName="Delete" runat="server" /> <asp:ImageButton CausesValidation="false" ID="RunData" CommandName="Run" runat="server" /> </td> </tr> <tr> <td colspan="2"> <table> <tr> <td>Description : </td> <td><%#((MyDTO)Container.DataItem).Description%></td> </tr> <tr> <td>Search Text : </td> <td><%#((MyDTO)Container.DataItem).Text%></td> </tr> </table> </td> </tr> </ItemTemplate> </asp:Repeater> </table> </ContentTemplate> </asp:UpdatePanel> Code-Behind public DeleteData DeleteDataDelegate; public RetrieveData PopulateDataDelegate; public delegate ArrayList RetrieveData(); public delegate void DeleteData(String sData); protected void Page_Load(object sender, EventArgs e) { //load the initial data.. if (!Page.IsPostBack) { if (PopulateDataDelegate != null) { this.DataRepeater.DataSource = this.PopulateDataDelegate(); this.DataRepeater.DataBind(); } } } protected void DataRepeater_ItemCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandName == "Delete") { if (DeleteDataDelegate != null) { DeleteDataDelegate((String)e.CommandArgument); BindDataToRepeater(); } } else if (e.CommandName == "Run") { String sRunning = (String)e.CommandArgument; this.ViewDataModalPopupExtender.Hide(); } } protected void DataRepeater_ItemDataBound(object source, RepeaterItemEventArgs e) { RepeaterItem item = e.Item; if (item != null && item.DataItem != null) { MyDTO oQuery = (MyDTO)item.DataItem; ImageButton oDeleteControl = (ImageButton) item.FindControl("DeleteData"); ImageButton oRunControl = (ImageButton)item.FindControl("RunData"); if (oDeleteControl != null && oRunControl !=null) { oRunControl.ImageUrl = "button_expand.gif"; oRunControl.CommandArgument = "MyID"; oDeleteControl.ImageUrl = "btn_remove.gif"; oDeleteControl.CommandArgument = "MyID"; } } } public void BindDataToRepeater() { this.DataRepeater.DataSource = this.PopulateDataDelegate(); this.DataRepeater.DataBind(); } public void ShowModal(object sender, EventArgs e) { BindDataToRepeater(); this.ViewDataModalPopupExtender.Show(); }

    Read the article

  • control with ID 'GridView1' could not be found for the trigger in UpdatePanel 'UpdatePanel1'

    - by Kk
    I have two gridview in update panel and m adding entries from one gridview to another on selectedIndexChanged event what m trying to do is updating update panel on this event selectedindexchanged ...but my gridview is inside accordian control so it does not get initialized and hence i get this error ..... control with ID 'GridView1' could not be found for the trigger in UpdatePanel 'UpdatePanel1' Anybody knows solution?

    Read the article

  • UpdateProgress with UpdatePanel not showing up in User control when page is loading

    - by Carter
    Is this typical behavior of the UpdateProgress for an ASP.Net UpdatePanel? I have an update panel with the UpdateProgress control inside of a user control window on a page. If I then make the page in the background do some loading and click a button in the user control update panel the UpdateProgress does not show up at all. It's like the UpdatePanels refresh request is not even registered until after the actual page is done doing it's business. It's worth noting that it will show up if nothing is happening in the background. The functionality I want is what you would expect. I want to loader to show up if it has to wait for anything to get it's refresh done when after the button is clicked. I know I can get this functionality if I just use jquery ajax with a static web method, but you can't have static web methods inside of a user control. I could have it in the page but it really doesn't belong there. A full-blown wcf wouldn't really be worth it in this case either. I'm trying to compromise with an UpdatePanel but these things always seem to cause me some kind of trouble. Maybe this is just the way it works? Edit:So I'll clarify a bit what I'm doing. What's happening is I have a page and all it has on it are some tools on the side and a big map. When the page initially loads it takes some time to load the map. Now if while it's loading I open up the tool (a user control) that has the update panel in question in it and click the button on this user control that should refresh the update panel with new data and show the loading sign (in the updateprogress) then the UpdateProgress loading image does not show up. However, the code run by the button click does run after the page is done loading (as expected) and The UpdateProgress will show up if nothing on the page containing the user control is loading. I just want the loader to show up while the page is loading. I thought my problem was that perhaps the map loading is in an update panel and my UpdateProgress was only being associated with the update panel for the user control's update panel. Hence, I would get no loading icon when the map was loading. This is not the case though.

    Read the article

  • UpdatePanel works great in all browsers except IE8

    - by Phil
    I'm using a timer triggered update panel which works perfectly under the latest versions of Firefox, Opera, and Safari. However, in IE, it sometimes works fine (just the panel updates without flicker elsewhere), but often the whole page starts to flicker after a while. I'm using a control to encapsulate this logic and the control is used on all of the pages on my web site. Here's my code. Any suggestions? and Thank you. <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="QuoteControl.ascx.cs" Inherits="occinc.QuoteControl" %> <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="True" AjaxFrameworkMode="Enabled"/> <asp:UpdatePanel UpdateMode="Conditional" runat="server" ID="UpdatePanel1" > <ContentTemplate> <div id="content-side2-three-column"> <%--Data Source Controls--%> <asp:ObjectDataSource ID="ObjectDataSourceQuotes" runat="server" SelectMethod="GetAllQuotes" TypeName="Quotes"></asp:ObjectDataSource> <asp:GridView ID="GridViewQuotes" runat="server" AutoGenerateColumns="False" DataSourceID="ObjectDataSourceQuotes" BorderWidth="0" BorderColor="white" OnRowCreated="GridViewAllQuotes_RowCreated"> <Columns> <asp:TemplateField> <ItemTemplate> <h2 id="<%# Eval("id").ToString() %>"> <%# Eval("Author") %> </h2> <q lang="en-us"><%# Eval("Content")%></q> <br /> <hr /> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> </div> </ContentTemplate> <Triggers><asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" /></Triggers> </asp:UpdatePanel> <asp:Timer ID="Timer1" runat="server" Interval="5000" /> <div class="clear"> </div>

    Read the article

  • Suppressing .net's updatepanel submit event handler

    - by wheresrhys
    I'm performing some custom js validation on my forms, triggered by submitting the form $("form").submit(function (e) { var validates = true; // validation code goes in here if (!validates) { e.preventDefault(); e.stopImmediatePropagation(); return false; } }) None of the lines I've included to stop the submit event prevent the .NET control posting back. Is there some way (using js or setting a property in the updatepanel control) of stopping post back?

    Read the article

  • ASP.NET UpdatePanel Time Out

    - by ctrlShiftBryan
    I'm making a request from an UpdatePanel that takes more then 90 seconds. I'm getting this timeout error. "Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerTimeoutException: The server request timed out." Does anyone know if there is a way to increase the amount of time before the the call times out?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >