postback

tinymce get HTML code when postback

こ雲淡風輕ζ 提交于 2019-11-28 01:05:26
问题 I have the tinymce -control as a WYSIWYG-Editior in my asp.net page. When I have e.g. a Text in Bold, after the Postback it is shown as "<p><strong>asd</strong></p>" in the textarea instead of the bolded text. Any ideas? My code: <script type="text/javascript" src="../scripts/tiny_mce/tiny_mce.js"></script> <script type="text/javascript"> tinyMCE.init({ mode: "textareas", theme: "simple", encoding: "xml" }); </script> <textarea runat="server" id="txtareaTextActivity" name="content" cols="48"

Implementation of IsPostBack in page load

元气小坏坏 提交于 2019-11-27 22:00:06
The more I use ASP.NET, the more if (!IsPostBack) {} seems pointless... First example: For example, I just Googled an issue, they said use this as part of the solution: if (!Page.IsPostBack) { Page.LoadComplete += new EventHandler(Page_LoadComplete); } Which does exactly as coded, LoadComplete will only fire on the first load. After clicking a button, or anything that triggers a postback, the LoadComplete event is left unhooked, thus skipping the event handler. Therefore, their "fix" only works upon the first load = worthless. I promptly commented out the if (!Page.IsPostBack) {} and now the

How can I disable all setTimeout events?

北慕城南 提交于 2019-11-27 19:46:42
问题 I am using ajax and asp.net. iI have a javascript function which creates many other javascript functions with setTimeout. After asynchronous postback happenes, I want to disable all of these setTimeouted events. How can I do that? 回答1: When you call setTimeout() , store the timer ID so you can clear it. If you're creating many timeouts, then an array is a good option for storing the IDs. For example: var timeouts = []; //then, store when you create them timeouts.push( setTimeout( { ... },

GridView doesn't remember state between postbacks

好久不见. 提交于 2019-11-27 18:14:26
问题 I have a simple ASP page with databound grid (bound to an object source). The grid is within the page of a wizard and has a 'select' checkbox for each row. In one stage of the wizard, I bind the GridView: protected void Wizard1_NextButtonClick(object sender, WizardNavigationEventArgs e) { ... // Bind and display matches GridViewMatches.EnableViewState = true; GridViewMatches.DataSource = getEmailRecipients(); GridViewMatches.DataBind(); And when the finish button is clicked, I iterate through

How to let Html Link (anchor) do a postback to be like LinkButton?

别等时光非礼了梦想. 提交于 2019-11-27 17:59:52
问题 I would like to ask how can i make an html anchor (a element) or even any object to do a postback or to execute an server side method? I want to create a custom button (a wrapped with some divs to do some custom them) and i want to implement OnClick to be look like the ASP.NET LinkButton? Like <a href="#" onclick="RunServerSideMethod()">Just a simple link button</a> 回答1: By default, controls use __doPostBack to do the postback to the server. __doPostBack takes the UniqueID of the control (or

Forcing a postback

蹲街弑〆低调 提交于 2019-11-27 17:32:30
问题 Is there a way to force a postback in code? I'm looking to force the raising of a postback from a method in the c# code behind my asp.net web application. 回答1: A postback is triggered after a form submission, so it's related to a client action... take a look here for an explanation: ASP.NET - Is it possible to trigger a postback from server code? and here for a solution: http://forums.asp.net/t/928411.aspx/1 回答2: You can try redirecting to same page. Response.Redirect(Request.RawUrl); 回答3:

Hidden value assigned in js lost after postback

岁酱吖の 提交于 2019-11-27 16:38:56
问题 Here's my problem. I have a hidden field whose value I change through a javascript method. The problem is after postback the value is lost. How can I persist the value after postback? Thanks! .aspx File <asp:HiddenField ID="HiddenField1" runat="server" /> <asp:Button ID="BtnGuardar" runat="server" OnClick="BtnGuardar_Click" OnClientClick="return GridUpdateInfoOK()" /> .js file document.getElementById('<%= HiddenField1.ClientID %>').value = 'TEST'; .aspx.cs file protected void BtnGuardar_Click

Partial postback with Javascript

感情迁移 提交于 2019-11-27 14:54:15
问题 I couldn't find something similar in SO. In ASP.NET, is there any way that on cue I can cause a partial postback with Javascript in an UpdatePanel? I tried __doPostBack() but it does a full postback. I can trick it with a dummy button and fire click() then handle the partial postback that way, but I want a more graceful way than trickery. Thanks. Edit: I found this disturbedbuddha.wordpress.com/2007/11/26/… but I can't get it to work =( I would love for this method to work; it's perfect for

Retrieving data from a POST method in ASP.NET

淺唱寂寞╮ 提交于 2019-11-27 14:23:30
问题 I am using ASP.NET. There is a system that needs to POST data to my site and all they asked for is for me to provide them with a URL. So I gave them my URL http://www.example.com/Test.aspx. Now I do not know exactly how they POST it but now on my Test.aspx page I need to write code that will save that data to a database. But how would this work and what must I do on my Test.aspx page? I wrote some code in my Page Load Event that sends me an email on Page Load to see if they actually hit the

Maintain scroll position of a div within a page on postback

梦想的初衷 提交于 2019-11-27 14:03:34
问题 I have a div within an aspx page with overflow set to auto. The contents of the div are dynamically created and consists of a list of link buttons. <div id="div1" style="overflow: auto; height: 100%;"> ..... </div> When I scoll down in the div and click on any of the link buttons, the page reload loses the scroll position inside the div and takes me to the top of the div. Is there any way to prevent that? Note that this is for a div inside the page. Page.MaintainScrollPositionOnPostBack()