postback

ASP.net sensitive information storage

让人想犯罪 __ 提交于 2019-11-29 11:57:15
I'm having a small trouble with ASP.net. I have a small DataTable that i need to be page dependent and also user inaccessible. What i mean is: If i store the data from the DataTable inside a Hiddenfield, the hiddenfield is page dependent (different values for multiple same page requests) but its not user inaccessible since a user can modify its content and then post back. If i store the Datatable in session, that is user inaccessible (which is good) but since some of the content from the page depends on this value, if a user opens the page multiple times (in different tabs) then the session is

Staying on current jQuery tab across post back?

ⅰ亾dé卋堺 提交于 2019-11-29 11:09:33
问题 I am using jQuery tabs and an ASP.NET listview to display and edit some information. My problem is that when a user inserts a new record in one of the listview items my jQuery tabs go back to the first tab. Is there a way to keep track of which tab I am on or keep it from resting on post back? 回答1: In ASP.NET, you can store it in a hidden field without having to use a cookie (no need for the jQuery cookie reference). Use this: $(function () { $("#tabs").tabs({ activate: function() { var

DropdownList.selectedIndex always 0 (yes, I do have !isPostBack)

限于喜欢 提交于 2019-11-29 10:51:09
(Scroll down to bottom of post to find solution.) Got a asp.net page which contains a Datalist. Inside this datalist, there is a template containing a dropdownlist and each time the datalist is filled with an item, a ItemCreatedCommand is called. The itemCreatedCommand is responsible for databinding the dropdownlist. I think the problem lies here, that I'm using ItemCreatedCommand to populate it - but the strange things is that if I choose the color "green", the page will autopostback, and I will see that the dropdown is still on the color green, but when trying to use it's SelectedIndex, I

DatePicker disappears after postback

坚强是说给别人听的谎言 提交于 2019-11-29 09:23:05
问题 I have an asp:TextBox associated to a jquery DatePicker. This input has a onTextChangedEvent that updates a Literal Control. All this code is inside an UpdatePanel so the Literal Control changes but the page doesn't refresh. The problem I'm facing is that when the event fires, the image that displays the DatePicker disappears. Here's a piece of my code: <asp:UpdatePanel ID="UpdatePanel" runat="server"> <ContentTemplate> <asp:TextBox runat="server" OnTextChanged="EditFromDate_TextChanged"

tinymce get HTML code when postback

廉价感情. 提交于 2019-11-29 07:33:04
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" rows="5"> </textarea> I also had the same problem. But fixed it by decoding the textarea text each time

Callback after __doPostBack()?

时光毁灭记忆、已成空白 提交于 2019-11-29 04:25:46
I am refreshing an UpdatePanel with Javscript by calling a method like so: reloadDropDown = function (newValue) { __doPostBack("DropDown1", ""); selectNewValueInDropDown(newValue); } Inside my UpdatePanel is a <select> box that I need to select an <option> with a newValue . My problem is that my selectNewValueInDropDown method is being called prior to the __doPostBack from completing. Is there a way I can "wait" for the postback before calling my selectNewValueInDropDown method? To make my comment more concrete, here's the idea: reloadDropDown = function (newValue) { var requestManager = Sys

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

余生长醉 提交于 2019-11-29 03:58:42
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> Brian Mains By default, controls use __doPostBack to do the postback to the server. __doPostBack takes the UniqueID of the control (or in HTML, the name property of the HTML element). The second parameter is the name of the command

Forcing a postback

岁酱吖の 提交于 2019-11-29 03:23:48
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. mamoo 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 live-love You can try redirecting to same page. Response.Redirect(Request.RawUrl); Simpler: ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "DoPostBack", "__doPostBack

Hidden value assigned in js lost after postback

牧云@^-^@ 提交于 2019-11-29 02:06:36
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(object sender, EventArgs e) { String test = HiddenField1.Value; } You don't need to have the hidden

Partial postback with Javascript

≡放荡痞女 提交于 2019-11-28 23:21:08
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 me! So far what I can do using this last method is gain reference to the timer. With the timer