postback

jquery accordion not re-initiating after an asp.Net postback

烂漫一生 提交于 2019-11-28 10:32:23
I'm firing up a jquery accordion with: $(document).ready(function(){ $('#accordion').accordion(); }); Problem is this is an .asp.NET application and if the page fires a postback is destroys the accordion. How do I re-initiate the accordion upon postback? Sorry I'm not an expert on asp.NET, and also sorry I can't give you a link to the example, this is because it's a password protected application. Thanks. Aristos You need to re-initlaize the accordion after the post back with the UpdatePanel functions as: <script type="text/javascript"> $(document).ready(function(){ var prm = Sys.WebForms

aspnet webforms disable button on submit

大城市里の小女人 提交于 2019-11-28 09:22:00
问题 I have a small problem in Webforms. I'm trying to disable the submit button on submit, to prevent double posts. The problem is, that the onclick method in codebehind is not getting called if the submit button is disabled during postback. Postback still occurs, but the buttons onclick method doesn't get called. Is there a way to get around this? Here a small demo of the problem: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="default.aspx.cs" Inherits="WebApplication2._default" %> <

Asp.net “Global” variables

被刻印的时光 ゝ 提交于 2019-11-28 08:50:39
问题 I'm writing a page in ASP.NET and am having problems following the cycle of initialization on postbacks: I have (something akin to) the following: public partial class MyClass : System.Web.UI.Page { String myString = "default"; protected void Page_Init(object o, EventArgs e) { myString = Request["passedString"]; //note that I've tried to set the default here in Init on NULL... } protected void Page_Load(object o, EventArgs e) { if(!Postback) { //code that uses myString.... } else { //more

maintainscrollpositiononpostback not working with firefox

最后都变了- 提交于 2019-11-28 08:04:54
问题 I am using VS 2008. I like the feature maintainscrollpositiononpostback. It works fine with IE 8. But it does not work consistently with Firefox. Sometimes, instead the line I click on goes to the bottom of the page. The field I am trying to refresh is with a div tag with overflow set to auto. Also I have several update panels with updatemode set to conditional. This means only the panel affected should be refreshed. This is also not working in the case on Firefox. I have searched the web for

SimpleModal breaks ASP.Net Postbacks

耗尽温柔 提交于 2019-11-28 06:49:56
I'm using jQuery and SimpleModal in an ASP.Net project to make some nice dialogs for a web app. Unfortunately, any buttons in a modal dialog can no longer execute their postbacks, which is not really acceptable. There is one source I've found with a workaround , but for the life of me I can't get it to work, mostly because I am not fully understanding all of the necessary steps. I also have a workaround, which is to replace the postbacks, but it's ugly and probably not the most reliable. I would really like to make the postbacks work again. Any ideas? UPDATE: I should clarify, the postbacks

How to keep the Text of a Read only TextBox after PostBack()?

自闭症网瘾萝莉.ら 提交于 2019-11-28 05:19:44
I have an ASP.NET TextBox and I want it to be ReadOnly . (The user modify it using another control) But when there is a PostBack() , The text get reset to an empty string. I understand that if you set the ReadOnly property to True of a TextBox it's content does not get saved through PostBack() . Is there a way to keep the content after PostBack() and make the TextBox not editable by the user? I tried to set the Enabled property to False ,But still the content doesn't save after PostBack() . Youssef Another solution I found and easier one: Add this to the Page Load method: protected void Page

How to retain f:viewParam values after postback with validation failed [duplicate]

纵饮孤独 提交于 2019-11-28 04:37:12
问题 This question already has an answer here: Retaining GET request query string parameters on JSF form submit 2 answers I have xhtml page with simple form. This page is using for several data tables. To specify data table (and so on), I use GET request parameters. xhtml page receive it through <f:metadata> <f:viewParam id="page" name="page" value="#{itemsBean.page}"/> </f:metadata> and pass again by the navigation rules like <navigation-case> <description> Global rule for going to the items page

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

心已入冬 提交于 2019-11-28 04:34:16
问题 (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

What is the difference between Page.IsPostBack and Page.IsCallBack?

感情迁移 提交于 2019-11-28 04:06:39
I've recently ran into some code that checks Page.IsCallBack but I wasn't sure how it is different from Page.IsPostBack . Can anyone enlighten me? Edit : Are they mutually exclusive or can both occur at the same time in a given situation? TStamper Page.IsCallBack It is getting a value indicating whether the page request is the result of a call back. Its a special postback, so a round-trip always occurs; however, unlike the classic postback, the script callback doesn't redraw the whole page. ViewState is not updated during a callback, it is for postback. Page.IsPostBack Checks whether the Page

Reset session timeout without doing postback in ASP.Net

岁酱吖の 提交于 2019-11-28 01:43:26
Is there any way to reset the session timeout without doing postback? In this scenario I don't just want to hide the postback from user, I need to reset the timeout with out postback. On my page I need to popup a dialog and inform the user that his session is timing out and if he wants to keep it alive he needs to click on a button. Now, when he clicks on that button I do not want to postback the page because it will cause issues with the data. (Not getting into the issues) Based on the answers I have modified the code but it's still not working. docs.google.com/open?id=0B