Search Results

Search found 729 results on 30 pages for 'postback'.

Page 24/30 | < Previous Page | 20 21 22 23 24 25 26 27 28 29 30  | Next Page >

  • Can I stagger UpdatePanel updates in .NET?

    - by cusimar9
    I have a situation in which I select an account and I want to bring back its details. This is a single UpdatePanel round trip and its quite quick. In addition, I need to bring back some transactional information which is from a much bigger table and takes a couple of seconds for the query to come back. Ideally, I would like to put this into a second update panel and update this additional information once it has been received, but after the first update panel has updated i.e. the user sees: Change account See account details (almost instant) See transactional info (2 seconds later) The only way I can think of doing this is to use javascript to cause a SECOND postback once the account details have been retrieved to get the transaction information. Is there a better way?

    Read the article

  • Can I have different name and id attributes on a form element?

    - by ewitkows
    Hi all, I have a web form with usual elements (first name, last name, etc). The Postback URL is a different website altogether as the form is intented to post lead information to another website. The site that accepts the lead is expecting First Name to come over as "FName", and Last Name to come over as "LName". Is there any way I can set the ID of a textbox to "txtFName", but submit it over the wire as "FName"? I tried changing the name attribute, but at runtime it sets the name = id.

    Read the article

  • JQuery updating label

    - by Zaps
    Hi, I have 2 textboxes and a label on my page. The 2 textboxes will contain numeric values. The label text will be the product of the 2 textbox values. Is there a way to do this using JQuery so that the value can get updated without having to do a postback? Also the textboxes may contain values with commas in it: e.g. 10,000. Is there a way I can extract the number from this so that it can be used to calculate the label value. Thanks in advance, Zaps

    Read the article

  • Appending to InnerHtml without rest of contents flicking

    - by centro
    I have a div element with some formatted images. On user request, I load additional images asynchronously, without postback, and append the result (formatted HTML for new images) to the div element using JavaScript: function onRequestComplete(result) { var images = document.getElementById('images'); images.InnerHtml += result; } All is okay, except that part when images in the panel loaded previously flicker after the HTML is appended. As far I understand, the panel is reconstructed, not just new HTML is appended to its bottom. So it isn't web 2.0 behavior. How can it be done without flicking? Thanks in advance.

    Read the article

  • Adding JavaScript to your code dependent upon conditions

    - by DavidMadden
    You might be in an environment where you code is source controlled and where you might have build options to different environments.  I recently encountered this where the same code, built on different configurations, would have the website at a different URL.  If you are working with ASP.NET as I am you will have to do something a bit crazy but worth while.  If someone has a more efficient solution please share. Here is what I came up with to make sure the client side script was placed into the HEAD element for the Google Analytics script.  GA wants to be the last in the HEAD element so if you are doing others in the Page_Load then you should do theirs last. The settings object below is an instance of a class that holds information I collection.  You could read from different sources depending on where you stored your unique ID for Google Analytics. *** This has been formatted to fit this screen. *** if (!IsPostBack) { if (settings.GoogleAnalyticsID != null || settings.GoogleAnalyticsID != string.Empty) { string str = @"//<!CDATA[ var _gaq = _gaq || []; _gaq.push(['_setAccount', '"  + settings.GoogleAnalyticsID + "']); _gaq.push(['_trackPageview']);  (function () {  var ga = document.createElement('script');  ga.type = 'text/javascript';  ga.async = true;  ga.src = ('https:' == document.location.protocol  ? 'https://ssl' :  'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0];  s.parentNode.insertBefore(ga, s);})();"; System.Web.UI.HtmlControls.HtmlGenericControl si =  new System.Web.UI.HtmlControls.HtmlGenericControl(); si.TagName = "script"; si.Attributes.Add("type", @"text/javascript"); si.InnerHtml = sb.ToString(); this.Page.Header.Controls.Add(si); } } The code above will prevent the code from executing if it is a PostBack and then if the ID was not able to be read or something caused the settings to be lost by accident. If you have larger function to declare, you can use a StringBuilder to separate the lines. This is the most compact I wished to go and manage readability.

    Read the article

  • RadGrid nestedview sort makes nestedview disappear?

    - by lance
    When I click on the header of my detail table, it disappears entirely, leaving empty white space in the browser where it used to be. The Ajax postback caused by my clicking on the header does fire FooGridNeedDataSource and FooGridItemCommand, but I've used the debugger to skip the code inside those handlers (after clicking the header of the column I'm trying to sort, in the detail table), and I still get the same behavior. I'm hoping someone can tell me what I'm doing wrong? The MasterTableView sorts just fine (my real markup enables that with AllowSorting="true" on MasterTableView). <telerik:RadGrid ID="FooGrid" runat="server" AutoGenerateColumns="false" OnNeedDataSource="FooGridNeedDataSource" OnItemCommand="FooGridItemCommand" > <MasterTableView ClientDataKeyNames="FooData" DataKeyNames="FooData"> <Columns> <telerik:GridBoundColumn DataField="FooData" HeaderText="Foo"></telerik:GridBoundColumn> </Columns> <DetailTables> <telerik:GridTableView AllowSorting="true"> <Columns> <telerik:GridBoundColumn DataField="FooDetailData" HeaderText="Foo Detail" ></telerik:GridBoundColumn> </Columns> </telerik:GridTableView> </DetailTables> </MasterTableView> </telerik:RadGrid>

    Read the article

  • dynamic GridView in CreateChildControls throws a "RegisterRequiresControlState can only be called be

    - by tbischel
    I am trying to add a GridView dynamically to a SharePoint Web Part. Right now, the first time I load the gridview, everything works fine. My gridview has an edit column enabled... so when I click that, it throws an exception when I try and add the gridview control on the postback. The exception: "RegisterRequiresControlState can only be called before and during PreRender" I've tried adding my controls in the CreateChildControls function, the OnInit, OnPageLoad, and OnPreRender... all exhibit the same problem. Does anyone know what might cause this kind of error? Edit: So to test this problem, I created a local GridView in the webpart, recreating all the properties in the one that failed. It actually worked this time through... the only difference that I could identify was that I had made the gridview a static variable in another class, where as here I initiated the gridview as a local variable. I even used the same initializing function for both the original and modified version, same difference. So why would creating a GridView locally affect the ability to add it to a web part?

    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

  • Problem with ScriptManager.RegisterStartupScript in WebControl nested in UpdatePanel

    - by Chris
    Hello, I am having what I believe should be a fairly simple problem, but for the life of me I cannot see my problem. The problem is related to ScriptManager.RegisterStartupScript, something I have used many times before. The scenario I have is that I have a custom web control that has been inserted into a page. The control (and one or two others) are nested inside an UpdatePanel. They are inserted onto the page onto a PlaceHolder: <asp:UpdatePanel ID="pnlAjax" runat="server"> <ContentTemplate> <asp:PlaceHolder ID="placeholder" runat="server"> </asp:PlaceHolder> ... protected override void OnInit(EventArgs e){ placeholder.Controls.Add(Factory.CreateControl()); base.OnInit(e); } This is the only update panel on the page. The control requires some initial javascript be run for it to work correctly. The control calls: ScriptManager.RegisterStartupScript(this, GetType(), Guid.NewGuid().ToString(), script, true); and I have also tried: ScriptManager.RegisterStartupScript(Page, Page.GetType(), Guid.NewGuid().ToString(), script, true); The problem is that the script runs correctly when the page is first displayed, but does not re-run after a partial postback. I have tried the following: Calling RegisterStartupScript from CreateChildControls Calling RegisterStartupScript from OnLoad / OnPreRender Using different combinations of parameters for the first two parameters (in the example above the Control is Page and Type is GetType(), but I have tried using the control itself, etc). I have tried using persistent and new ids (not that I believe this should have a major impact either way). I have used a few breakpoints and so have verified that the Register line is being called correctly. The only thing I have not tried is using the UpdatePanel itself as the Control and Type, as I do not believe the control should be aware of the update panel (and in any case there does not seem to be a good way of getting the update panel?). Can anyone see what I might be doing wrong in the above? Thanks :)

    Read the article

  • asp.net mvc, IIS 6 vs IIS7.5, and integrated windows authentication causing javascript errors?

    - by chris
    This is a very strange one. I have an asp.net MVC 1 app. Under IIS6, with no anon access - only integrated windows auth - every thing works fine. I have the following on most of my Foo pages: <% using (Html.BeginForm()) { %> Show All: <%= Html.CheckBox("showAll", new { onClick = "$(this).parent('form:first').submit();" })%> <% } %> Clicking on the checkbox causes a post, the page is reloaded, everything is good. When I look at the access logs, that's what I see, with one oddity - the js library is requested during the page first request, but not for any subsequent page requests. Log looks like: GET / 401 GET / 200 GET /Content/Site.css 304 GET /Scripts/jquery-1.3.2.min.js 401 GET /Scripts/jquery-ui-1.7.2.custom.min.js 401 GET /Scripts/jquery.tablesorter.min.js 401 GET /Scripts/jquery-1.3.2.min.js 304 GET /Scripts/jquery-ui-1.7.2.custom.min.js 304 GET /Scripts/jquery.tablesorter.min.js 304 GET /Content/Images/logo.jpg 401 GET /Content/Images/logo.jpg 304 GET /Foo 401 GET /Foo 200 POST /Foo/Delete 302 GET /Foo/List 200 POST /Foo/List 200 This corresponds to home page, click on "Foo", delete a record, click a checkbox (which causes the 2nd POST). Under IIS7.5, it sometimes fails - the click on the check box doesn't cause a postback, but there are no obvious reasons why. I've noticed under IIS7.5 that every single page request re-issues the requests for the js libraries - the first one a 401, followed by either a 200 (OK) or 304 (not modified), as opposed to the above log extract where that only happened during the 1st request. Is there any way to eliminate the 401 requests? Could a timing issue have something to do with the click being ignored? Would increasing the number of concurrent connections help? Any other ideas? I'm at a bit of a loss to explain this.

    Read the article

  • Microsoft JScript runtime error: 'ShowDatePicker' is undefined

    - by dbobrow
    Working around an issue where my jquery datepicker does not display after postback within an update panel. The textbox (trigger) for the calendar is contained within a control, which is contained within an update panel. I found an article assisting with this issue, and it informed me to do the following Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim tScript As String = "$(function(){ Sys.WebForms.PageRequestManager.getInstance().add_endRequest(ShowDatePicker); });" Page.ClientScript.RegisterStartupScript(Me.GetType(), "async_" & Me.txtAquisition.ClientID, tScript, True) Then on the ascx I have <script type="text/javascript"> function showDatePicker(sender, args) { var control = document.getElementById("<%=txtAquisition.ClientID %>") alert(control); $(control).each(function() { $(this).datepicker({ showOn: 'focus' }); }); } </script> but am getting an undefined error. Am I approaching this in the correct manner? Any other suggestions to ensure my datepicker remains usable within the update panel? Thinking this may be due to the fact that I have the controls nested within an update panel... several of them in fact. Any help on this is greatly appreciated.

    Read the article

  • ASP.NET validation not executing in a JavaScript showModalDialog call

    - by Michael Kniskern
    I currently open a pop up window from my parent page using using a JavaScript .showModalDialog function. The pop up window contains some ASP.NET validation controls which do not display when the user clicks the ASP.NET button to submit the form. If there is an error on the page, the validation message(s) do not display, the record is not updated on the server side and the pop window closes. (The asp.net validation controls do not stop the pop up window from doing a server postback) Has anyone expereinced this behavior before and is there any way to prevent it? Here is my showModalDialong call source code: function OpenChildWindow(id) { var sFeatures = sFeatures="dialogHeight: 525px;"; sFeatures += "dialogWidth: 900px;"; sFeatures += "scroll: yes;"; sFeatures += "status: no;"; sFeatures += "resizeable: no;"; var url = "MyPopUp.aspx?ID=" + id; var childName = "ChildForm"; entryWindow = window.showModalDialog(url, childName, sFeatures); if (entryWindow == true) { window.document.getElementById("<%= btnUpdateParent.ClientID %>").click(); } } Note: When the pop up modal is closed, a ASP.NET button is "clicked" to update an ASP.NET UpdatePanel on the parent to show the changes to the record modified in the pop up window.

    Read the article

  • Why is the UpdatePanel Response size changing on alternate requests?

    - by Decker
    We are using UpdatePanel in a small portion of a large page and have noticed a performance problem where IE7 becomes CPU bound and the control within the UpdatePanel takes a long time (upwards of 30 seconds) to render. We also noticed that Firefox does not seem to suffer from these delays. We ran both Fiddler (for IE) and Firebug (for Firefox) and noticed that the real problem lied with the amount of data being returned in update panel responses. Within the UpdatePanel control there is a table that contains a number of ListBox controls. The real problem is that EVERY OTHER TIME the response (from making ListBox selections) alternates from 30K to 430K. Firefox handles the 400+K response in a reasonable amount of time. For whatever reason, IE7 goes CPU bound while it is presumably processing this data. So irrespective of whether or not we should be using an UpdatePanel or not, we'd like to figure out why every other async postback response is larger by a factor of more than 10 than the previous one. When the response is in the 30K range, IE updates the display within a second. On the alternate times, the response time is well over 10 times longer. Any idea why this alternating behavior should be happening with an UpdatePanel?

    Read the article

  • Telerik RadAlert back button cache problem

    - by Michael VS
    Hi, I'm sure you have had this one before so if you could point me to something similar.... I have a server side creation of a RadAlert window using the usual Sys.Application.remove_load and add_load procedure however the alert keeps popping up as it seems to be caching when the user hits the back button after it has been activated. I have tried to put a onclick event on a button to clear the function using remove_load before it moves to the next page however it still doesn't seem to clear it. Its used in validation so if a user inputs failed validation it pops up. If they then go and enter correct validation it then moves onto the next page. If they then use back button this is where it pops up again. Any ideas? Server side: private void Page_Load(object sender, System.EventArgs e) { if (!IsPostBack) { btnSearch.Attributes.Add("onclick", "Sys.Application.remove_load(f);"); } } private void btnSearch_Click(object sender, System.EventArgs e) { string radalertscript = "(function(){var f = function(){radalert('Welcome to RadWindow Prometheus!', 330, 210); Sys.Application.remove_load(f);};Sys.Application.add_load(f);})()"; RadAjaxManager1.ResponseScripts.Add(radalertscript); } Ive also tried using RadAjaxManager1.ResponseScripts.Clear(); before it moves on to the next page on the postback event

    Read the article

  • ASP.NET MVC and ViewState

    - by nickyt
    Now I've seen some questions like this, but it's not exactly what I want to ask, so for all those screaming duplicate, I apologize :). I've barely touched ASP.NET MVC but from what I understand there is no ViewState/ControlState... fine. So my question is what is the alternative to retaining a control's state? Do we go back to old school ASP where we might simulate what ASP.NET ViewState/ControlState does by creating hidden form inputs with the control's state, or with MVC, do we just assume AJAX always and retain all state client-side and make AJAX calls to update? This question has some answers, http://stackoverflow.com/questions/1285547/maintaining-viewstate-in-asp-net-mvc, but not exactly what I'm looking for in an answer. UPDATE: Thanks for all the answers so far. Just to clear up what I'm not looking for and what I'm looking for: Not looking for: Session solution Cookie solution Not looking to mimic WebForms in MVC What I am/was looking for: A method that only retains the state on postback if data is not rebound to a control. Think WebForms with the scenario of only binding a grid on the initial page load, i.e. only rebinding the data when necessary. As I mentioned, I'm not trying to mimic WebForms, just wondering what mechanisms MVC offers.

    Read the article

  • UpdatePanel not working in IE or Chrome

    - by gevjen
    I have an updatepanel on my masterpage. Within the contentplace holder I have my update progress control. When a user clicks on the button I load some data into a gridview. This works perfectly in FireFox. User clicks the button, the loading image in my updateprogress fires and loads the gridview. When I test this in IE 6 or 7 or in Chrome. It does a full postback and the updateprogress is never shown. So the updatepanel doesnt seem to be working in these two browsers. Code is below. Again...it works perfect in FireFox. ***From Masterpage *** <asp:UpdatePanel ID="UpdatePanel" runat="server"> <contenttemplate> <asp:contentplaceholder id="holder" runat="server" /> </contenttemplate> </asp:UpdatePanel> **From aspx page **** <asp:UpdateProgress ID="UpdateProgress1" runat="server"> <ProgressTemplate> <img src="ajax-loader.gif" /> </ProgressTemplate> </asp:UpdateProgress>

    Read the article

  • Gridview buttonfield works LinkButton doesn't

    - by Karsten
    I've been fighting this problem for many hours now and could really use some help :-) This is the grid <asp:GridView ID="annonceView" runat="server" AutoGenerateColumns="False" DataKeyNames="Id" DataSourceID="dataSourceAnnoncer"> <Columns> <asp:BoundField DataField="Productname" HeaderText="Productname" /> <asp:buttonfield buttontype="Link" commandname="Delete" text="Delete"/> <asp:TemplateField HeaderText="Administration"> <ItemTemplate> <asp:LinkButton ID="lnkBtnDelete" runat="server" Text="Delete" CausesValidation="False" CommandName="Delete" OnClientClick="return confirm('Delete?')" /> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> <asp:LinqDataSource ID="dataSourceAnnoncer" runat="server" ContextTypeName="Namespcae.TheContext" EnableDelete="True" TableName="Annoncer"> </asp:LinqDataSource> Clicking the buttonfield deletes the record just fine. Clicking the LinkButton doesn't work. I get a postback and the grid is shown as empty and no record is deleted. Seems like an empty databinding. I have tried to create a custom OnClick, OnCommand event for the LinkButton, but neither are fired. The OnRowCommand isn't fired either. I don't manually DataBind in the codebehind.

    Read the article

  • ASP.NET Timer Event

    - by K Ratnajyothi
    protected void SubmitButtonClicked(object sender, EventArgs e) { System.Timers.Timer timer = new System.Timers.Timer(); --- --- //line 1 get_datasource(); String message = "submitted."; ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "popupAlert", "popupAlert(' " + message + " ');", true); timer.Interval = 30000; timer.Elapsed += new ElapsedEventHandler(timer_tick); // Only raise the event the first time Interval elapses. timer.AutoReset = false; timer.Enabled = true; } } protected void timer_tick(object sender, EventArgs e) { //line 2 get_datasource(); GridView2.DataBind(); } The problem is with the data in the grid view that is being displayed... since when get_datasource which is after line 1 is called the updated data is displayed in the grid view since it is a postback event but when the timer event handler is calling the timer_tick event the get_datasource function is called but after that the updated data is not visible in the grid view. It is nnot getting updated since the timer_tick is not a post back event

    Read the article

  • Uploading image with AsynFileUpload(ACT Control) and changing Image Url of an Image Control??

    - by mahdiahmadirad
    Hi! I Used AsyncFileUpload(one of Ajac Control Toolkit Controls) to Uploading User's Image. this works well. But i want to change the image url of an image contorl to uploaded image url. how can i perform that? I put Image control in a Update Panel: <asp:UpdatePanel ID="UpdatePanelNew" runat="server"> <ContentTemplate> <asp:Image ID="Image1" ImageUrl="~/Images/Categories/NoCategory.png" runat="server" /> </ContentTemplate> </asp:UpdatePanel> <asp:AsyncFileUpload OnClientUploadError="uploadError" OnClientUploadComplete="uploadComplete" runat="server" ID="AsyncFileUpload1" UploadingBackColor="#CCFFFF" ThrobberID="myThrobber" /> &nbsp; <asp:Label ID="myThrobber" runat="server" Style="display: none;"> <img align="middle" alt="Working..." src="../../Images/App/uploading.gif" /> </asp:Label> in C# code I wrote these: protected void Page_Init() { AsyncFileUpload1.UploadedComplete += new EventHandler<AsyncFileUploadEventArgs>(AsyncFileUpload1_UploadedComplete); } void AsyncFileUpload1_UploadedComplete(object sender, AsyncFileUploadEventArgs e) { ScriptManager.RegisterStartupScript(this, this.GetType(), "size", "top.$get(\"" + uploadResult.ClientID + "\").innerHTML = 'Uploaded size: " + AsyncFileUpload1.FileBytes.Length.ToString() + "';", true); string savePath = MapPath("~/Images/Categories/" + Path.GetFileName(e.filename)); ImageOperations.ResizeFromStream(savePath, 128, AsyncFileUpload1.FileContent); Image1.ImageUrl = "~/Images/Categories/" + AsyncFileUpload1.FileName; //AsyncFileUpload1.SaveAs(savePath); } But it does not work. can you help me? Note that ImageOperations.ResizeFromStream() method resizes and saves the image to a specefic folder. actually I should trigger a Postback to Update the Update Panel but How to do that. I used UpdatePanelNew.Update(); but it does not work!

    Read the article

  • Using Javascript to detect when a user has selected an item in an ASP.NET listbox

    - by Amr Bekhit
    Hello all, I am developing an ASP.NET web application that incorporates google maps. I have an ASP.NET listbox on my page which contains a list of items. When the user selects one of the items, I'd like to show this item on the map. The main complication lies in the fact that google maps uses javascript to control it and the listbox is a server control. I can think of two ways to do this. The first would involve the listbox calling a javascript function when the user selects a new item. I can then write this function to perform the necessary map operations. Unfortunately, the OnSelectedIndexChanged property of the listbox doesn't seem to support javascript functions. The second involves wrapping an UpdatePanel around the listbox and getting the listbox to perform a postback. In the SelectedIndexChanged event in VB/C#, I would the need to somehow make a call to a javascript function which would then update the map. Which solution can I use? Thanks --Amr

    Read the article

  • Trigger element's onclick method with JQuery [ASP.NET]

    - by blu
    I have an ASP.NET server control that inherits from CheckBoxList that renders the controls with a UL and LIs. The control is set to AutoPostBack. Markup: <div id="foo"> <ul> <li> <input type="checkbox" onclick="javascript:setTimeout('__doPostBack(..." ... /> <label ... /> </li> </ul> </div> I would like to trigger the JavaScript that is rendered on the CheckBox when the parent LI is clicked. Here is what I have so far: $("#foo li").click(function() { $(this).find("input:eq(0)").trigger("click"); }); This fires a postback in FF 3.x but the event handler in the codebehind is not fired. In IE 7 a script error comes up and the browser just kind of hangs there for a bit then reloads the page. How should I be doing this?

    Read the article

  • ASP MVC: Submitting a form with nested user controls

    - by Nigel
    I'm fairly new to ASP MVC so go easy :). I have a form that contains a number of user controls (partial views, as in System.Web.Mvc.ViewUserControl), each with their own view models, and some of those user controls have nested user controls within them. I intended to reuse these user controls so I built up the form using a hierarchy in this way and pass the form a parent view model that contains all the user controls' view models within it. For example: Parent Page (with form and ParentViewModel) -->ChildControl1 (uses ViewModel1 which is passed from ParentViewModel.ViewModel1 property) -->ChildControl2 (uses ViewModel2 which is passed from ParentViewModel.ViewModel2 property) -->ChildControl3 (uses ViewModel3 which is passed from ViewModel2.ViewModel3 property) I hope this makes sense... My question is how do I retrieve the view data when the form is submitted? It seems the view data cannot bind to the ParentViewModel: public string Save(ParentViewModel viewData)... as viewData.ViewModel1 and viewData.ViewModel2 are always null. Is there a way I can perform a custom binding? Ultimately I need the form to be able to cope with a dynamic number of user controls and perform an asynchronous submission without postback. I'll cross those bridges when I come to them but I mention it now so any answer won't preclude this functionality. Many thanks.

    Read the article

  • Update panel and usercontrols

    - by Charlie Brown
    I have two web user controls nested inside of an update panel. The events inside the user controls do not appear to trigger the panel. For testing, I have set the method the fires to sleep for 3 seconds, and added an update progress panel to the page. The update progress panel never comes up and the page reflashes as usual. The user controls work correctly and do what they need to do, but I would like to make them ajaxy and pretty. Is there a special method for adding usercontrols to an update so the postback works correctly? <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:UpdateProgress ID="UpdateProgress1" runat="server" DisplayAfter="100"> <ProgressTemplate> UPDATING...</ProgressTemplate> </asp:UpdateProgress> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <div id="order"> <keg:BeerList runat="server" ID="uxBeerList" /> <kegcart:ShoppingCart runat="server" ID="uxCustomerCart" /> <br class="clearfloat" /> </div> </ContentTemplate> </asp:UpdatePanel> Protected Sub uxBeerList_AddItem(ByVal item As KegData.IOrderableItem) Handles uxBeerList.AddItem uxCustomerCart.AddItemToOrder(item) System.Threading.Thread.Sleep(5000) End Sub

    Read the article

  • Best practice when using WebMethods and session

    - by Abdel Olakara
    Hi all, I want to reduce postback in one of my application page and use ajax instead. I used the WebMethod to do so.. I have a static WebMethod that needs to access the session variables and modify. and on the client side, i am calling this method using jQuery. I tried accessing the session as follows: [WebMethod] public static void TestWebMethod() { if (HttpContext.Current.Session["pitems"] != null) { log.Debug("Using the existing list"); Product prod = (Product)HttpContext.Current.Session["pitems"]; List<Configs> confs = cart.GetConfigs(); foreach (Configs citem in confis) { log.Info(citem.Description); } } log.Info("Inside the method!"); } The values are displayed correctly and seems to work.. but i would like to know if this practice is allowed as the method is a static methods and would like to know how it will behave if multiple people access the application. I would also like to know how developers do these kind of tasks in ASP if this is not the right method. Thanks in advance for your suggestions and ideas, Abdel Olakara

    Read the article

  • Asp.net PopupControlExtender inside UpdatePabel

    - by user296422
    Hi, So i use PopupControlExtender (to edit some of the fields) inside ListViewControl which itself is embeded inside an UpdatePanel. The problem is as follows whenever you cause partail postback the popup panels are created client side outside the updatepanel. And you get more clientside controls with the same clientside ID. When you postback with popup panel the server side control eg. Texbox has Text = clientsidecontrol1.text, clientsidecontrol2.text, clientsidecontrol.text3 Is there a way to prevent this. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Test.aspx.cs" Inherits="Secure_Test" %> <%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %> <!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></title> </head> <body> <form id="form1" runat="server"> <cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"> </cc1:ToolkitScriptManager> <div> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:Label ID="InputLabel" runat="server" Text="Whatever you put in the textbox"></asp:Label> <br /> <asp:Label runat="server"> <%= DateTime.Now.ToString() %></asp:Label> <br /> <asp:Button ID="Button1" runat="server" Text="Refresh" /> <br /> <asp:LinkButton ID="PopupLB" runat="server">Popup</asp:LinkButton> <br /> <cc1:PopupControlExtender ID="PopupControlExtender1" runat="server" PopupControlID="Panel1" TargetControlID="PopupLB" CommitProperty="Value"> </cc1:PopupControlExtender> <asp:Panel ID="Panel1" runat="server"> <asp:UpdatePanel ID="UpdatePanel2" runat="server"> <ContentTemplate> <asp:TextBox ID="InputTB" runat="server"></asp:TextBox> <asp:Button ID="SubmitBTN" runat="server" Text="Submit" onclick="SubmitBTN_Click" UseSubmitBehavior="false" /> </ContentTemplate> </asp:UpdatePanel> </asp:Panel> </ContentTemplate> </asp:UpdatePanel> </div> </form> </body> </html> using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using AjaxControlToolkit; public partial class Secure_Test : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void SubmitBTN_Click(object sender, EventArgs e) { PopupControlExtender pce = AjaxControlToolkit.PopupControlExtender.GetProxyForCurrentPopup(Page); pce.Commit("Popup"); InputLabel.Text = InputTB.Text; } } To make it easier to test i post the code of an example page i used for testing. To make myself clear here is an example: i click Popup. Type "asdf" in the textbox and click Submit. InputPanel dispalys "asdf" i click Popup again. Type "qwerty" in the textbox and click Submit. InputPanel now displays "qwerty,asdf" When you check it the firebug you get this: <form id="form1" action="Test.aspx" method="post" name="form1"> <div> <input type="hidden" value=";;AjaxControlToolkit, Version=3.0.30930.21526, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e:pl-PL:c83bc095-c5d9-40da-b175-dc46338fcc3a:865923e8:91bd373d:596d588c:411fea1c:e7c87f07:bbfda34c:30a78ec5:42b7c466;" id="ToolkitScriptManager1_HiddenField" name="ToolkitScriptManager1_HiddenField"> </div> <script type="text/javascript"> //&lt;![CDATA[ var theForm = document.forms['form1']; if (!theForm) { theForm = document.form1; } function __doPostBack(eventTarget, eventArgument) { if (!theForm.onsubmit || (theForm.onsubmit() != false)) { theForm.__EVENTTARGET.value = eventTarget; theForm.__EVENTARGUMENT.value = eventArgument; theForm.submit(); } } //]]&gt; </script> <script type="text/javascript" src="/WebResource.axd?d=B2RAZw_YugtketKJqWIbXA2&amp;t=634051184591131846"></script> <script type="text/javascript" src="/ScriptResource.axd?d=zifZiisoqXYJSwLXuAZ4DmtrWVvn9x0W1r7qfDo40UU7q9QYoa5ChdBZD6dDL66f0flKVDmPL2woIPesut_FUpsFZUN2A5sDN7IOqPUOZO41&amp;t=1a45d080"></script> <script type="text/javascript"> //&lt;![CDATA[ if (typeof(Sys) === 'undefined') throw new Error('Ladowanie struktury strony klienta ASP.NET Ajax nie powiodlo sie.'); //]]&gt; </script> <script type="text/javascript" src="/ScriptResource.axd?d=zifZiisoqXYJSwLXuAZ4DmtrWVvn9x0W1r7qfDo40UU7q9QYoa5ChdBZD6dDL66fyxEJaYB3uJEQ0r_TmOPczeBZ1gpFH5a6x4ug130lptsKAcGA3S1vt08sHQo5sFtH0&amp;t=1a45d080"></script> <script type="text/javascript" src="/Secure/Test.aspx?_TSM_HiddenField_=ToolkitScriptManager1_HiddenField&amp;_TSM_CombinedScripts_=%3b%3bAjaxControlToolkit%2c+Version%3d3.0.30930.21526%2c+Culture%3dneutral%2c+PublicKeyToken%3d28f01b0e84b6d53e%3apl-PL%3ac83bc095-c5d9-40da-b175-dc46338fcc3a%3a865923e8%3a91bd373d%3a596d588c%3a411fea1c%3ae7c87f07%3abbfda34c%3a30a78ec5%3a42b7c466"></script> <div> </div> <script type="text/javascript"> //&lt;![CDATA[ Sys.WebForms.PageRequestManager._initialize('ToolkitScriptManager1', document.getElementById('form1')); Sys.WebForms.PageRequestManager.getInstance()._updateControls(['tUpdatePanel1','tUpdatePanel2'], [], [], 90); //]]&gt; </script> <div> <div id="UpdatePanel1"> <span id="InputLabel">qwerty,asdf</span> <br> <span>2010-06-15 18:26:50</span> <br> <input type="submit" id="Button1" value="Refresh" name="Button1"> <br> <a href="javascript:__doPostBack('PopupLB','')" id="PopupLB">Popup</a> <br> </div> </div> <script type="text/javascript"> //&lt;![CDATA[ (function() {var fn = function() {$get('ToolkitScriptManager1_HiddenField').value = '';Sys.Application.remove_init(fn);};Sys.Application.add_init(fn);})();Sys.Application.initialize(); Sys.Application.add_init(function() { $create(AjaxControlToolkit.PopupControlBehavior, {"CommitProperty":"Value","PopupControlID":"Panel1","dynamicServicePath":"/Secure/Test.aspx","id":"PopupControlExtender1"}, null, null, $get("PopupLB")); }); //]]&gt; </script> <div id="Panel1" style="position: absolute; left: 8px; top: 73px; z-index: 1000; display: none; visibility: hidden;"> <div id="UpdatePanel2"> <input type="text" id="InputTB" name="InputTB"> <input type="button" id="SubmitBTN" onclick="javascript:__doPostBack('SubmitBTN','')" value="Submit" name="SubmitBTN"> </div> </div><span style="display: none ! important;"><input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value=""></span><span style="display: none ! important;"><input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value=""></span><span style="display: none ! important;"><input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJMTkwNzc2NzAzD2QWAgIDD2QWAgIDD2QWAmYPZBYCAgEPDxYCHgRUZXh0BQtxd2VydHksYXNkZmRkZApLPc2nZUC+UkZsCrByuofHMah5"></span><span style="display: none ! important;"><input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWBQLi2qWdAwKM54rGBgKIkJujDQKbjp+pDQKc7v+tArliNtJzeG8HrfsGBBXIViJAUGMz"></span><div id="Panel1" style="visibility: hidden; position: absolute; left: 8px; top: 73px; z-index: 1000; display: none;"> <div id="UpdatePanel2"> <input type="text" id="InputTB" value="asdf" name="InputTB"> <input type="button" id="SubmitBTN" onclick="javascript:__doPostBack('SubmitBTN','')" value="Submit" name="SubmitBTN"> </div> </div><div id="Panel1" style="display: none; visibility: hidden; position: absolute;"> <div id="UpdatePanel2"> <input type="text" id="InputTB" value="qwerty,asdf" name="InputTB"> <input type="button" id="SubmitBTN" onclick="javascript:__doPostBack('SubmitBTN','')" value="Submit" name="SubmitBTN"> </div> </div></form> InputTB and Panel1 where generated 3 time.

    Read the article

< Previous Page | 20 21 22 23 24 25 26 27 28 29 30  | Next Page >