C# - ViewState Doesn't Work When Control Become Enable=False

May 26, 2010

Why when a control does contain value but it's set to .Enable=False that all controls become disable (that's ok) but why that the ViewState doesn't retain the data on the next post back? If I get the UserControl without modifing its Enable state, the ViewState work between post back.

How can we disable a UserControl that all its control become disable (this part work) but all of them KEEP use the ViewState (this doesn't work)?

Clarification:

1)In the aspx.cs click button EDIT:

myControl.Enabled = false;
//This produce to have all controls in myControl to be disabled.

2)In the asp.cs: click Save to leave the EDIT state:

myControl.Enabled = true;
//This produce that all controls inside myControl are blank : no viewstate!

Other postback works because we do not put myControl.Enable to false.

View 3 Replies


Similar Messages:

MVC :: Enable Client Validation Doesn't Work On Formviewmodel

Jun 6, 2010

well the thing i am doing is that and returning a formviewdal ,there is a page refresh while performing validation ( it work fine when i return only modal ,but is not working

when i am returning formviewmodal i.e doing a page refresh) ,What might be wrong. Review the create below as it is returning viewmodal class

My View

[Code]....

View 5 Replies

CreateUserWizard's LoginCreatedUser=false And Email Sending Doesn't Work?

Mar 11, 2011

In CreateUserWizard I have set:

DisableCreatedUser="True"
LoginCreatedUser="False"

but the user is logged on after it is created.and also for sending a verification email I have added:

<MailDefinition BodyFileName="~/EmailTemplates/NewAccountTemplate.htm" From="info@test.com" IsBodyHtml="True" Subject="Registration">
</MailDefinition>

but no email is sent and even OnSendingMail is not fired.

View 1 Replies

Button Inside Updatepanel / Try To Enable The BtnAddSecurity.Enabled = True It Simply Doesn't Work

Jan 19, 2011

I have two update panels and in the second update panel i have asp.net button and onclick of the button in codebehind i have disabled it like btnAddSecurity.Enabled = false;

When I disable the button i enable a cancel button before it and on cancel button when i try to enable the btnAddSecurity.Enabled = true it simply doesn't work. Both of my updatepanels updatemode is conditional. what is the problem?

View 1 Replies

Form Validation - OnClientClick="return False;" Doesn't Work

Oct 8, 2010

I just want to add some client side (JQuery Javascript) validation in a web user control. I put an OnClientClick handler and the function gets called. BUT, even if I return "false", the OnClick method always get fired. What am I doing wrong ?

I'm with VS 2010, targeting the 4.0 framework with JQuery 1.4.2. and JQuery UI 1.8.4.

Here's a sample code :

<td style="text-align:right"><asp:Button ID="btnAddSave" OnClientClick="return ValidateMail();" OnClick="btnAddSave_Click" runat="server" Text="Submit" /></td>[code]...

If I put a breakpoint in the Page_Load event, I see that I get in and the btnAddSave_Click event is also executed.

View 1 Replies

ValidateRequest="false" Doesn't Work In 4?

Apr 20, 2010

I have a form at which I use ckeditor. This form worked fine but now doesn't work in Asp.Net 4. I have ValidateRequest="false" directive.

View 3 Replies

Client Side Click Event Of Control In User Control Doesn't Work?

Jun 14, 2010

I have a webdayview control (Infragistics proprietary ASP.net control) on my page. On the aspx source I've inserted some javascript (webdayview_click - clientside click event) that calls a webmethod in the codebehind. This seems to work fine, but when I
insert this webdayview control into a user control and move the corresponding javascript into the aspx of the user control, it doesn't work. I can't even insert a breakpoint into the javascript function to debug it. Is there a way to make it work? I want to enable the click event of the webdayview control so that when I click on it, the javascript function calls the webmethod. Here's my code (remember it is inside a user control):

[code]...

I posted this question on the Infragistics forum but didn't get any replies. Hopefully I'll get some here. :)

View 2 Replies

AJAX :: Control Doesn't Work When Other Search Control Is Present On The Page?

Apr 27, 2010

I have a .aspx page in c#. There is an ajax control that shows the data company names from the xml file when the city is selected.

There is also a bing search control on the page.

The issue is that the Ajax control stops populating the data when the search control is present on the page.

The ajax control works absolutely fine when the search control is removed

View 5 Replies

ViewState Enabled - False No Affect?

Sep 15, 2011

I have a Gridview that has some controls above you can use to select how much data the Gridview displays - a week's worth, a month's worth, a year's worth etc.

And, as it's a view only grid, I thought 'I'll keep the page size down by doing this:

<asp:GridView EnableViewState="false" etc.

But, if I look at a year's worth of data and look at Page Source - the ViewState is massive. If I look at a week's work, the ViewState is small. A month's worth - a bit bigger and so on.

So, despite setting EnableViewState to false - the ViewState does seem to grow in proportion to the data being displayed in the Grid. I don't need all that data held in ViewState so why is it happening?

View 17 Replies

Web Forms :: BetterImage Control Doesn't Work?

Feb 8, 2011

The following is trimmed down from the web.config file I'm using in a website that runs in Windows 2003 R2.

<system.web>
<!-- Required to use BetterImageLink and BetterImage class -->
<httpHandlers>
<remove path="*.asmx" verb="*" />

[Code]....

I'm migrating the site to a new server running Windows 2008 R2. When I tested the site, I fould that the BetterImage control doesn't work. I use the BetterImage control liberally throughout the site, so this is a real problem for me. I emailed the developer and he responded that I have to change the location in the web.config where I register my custom handlers. How do I do that? And are there any other changes I need to be aware of? How different is the web.config between the two Windows versions?

View 1 Replies

AJAX :: Asyncfileupload Doesn't Work As Put It In A Control?

Jun 7, 2010

I can't get my <ajax:asyncfileupload> working and I don't see why...

When outside any panel or table it is working well, but as soon as I put it in a <asp:panel> or table I get a strange error which seems to be on client-side but I don't understand what's happen here. Here is the code and code-behind and Javascript.

Here's the error:

[URL]

Here's my front-code:

[Code]....

Protected Sub fupAjoutLogo_UploadedComplete(ByVal sender As Object, ByVal e As AjaxControlToolkit.AsyncFileUploadEventArgs)

View 3 Replies

AJAX :: Accordion Control Doesn't Work?

Oct 9, 2010

I am having quite a bit of trouble getting an accordion control to work. I downloaded the AJAX Control Toolkit (v 3.5), added the dll to my toolbox, and added an accordion control with the following code:

[Code]....

View 6 Replies

C# - FindControl Doesn't Work With ChangePassword Control?

Mar 1, 2011

How can I access to the CancelPushButton ?

This doesn't work ! it returns always null !!

var cancelButton = ChangeUserPassword.FindControl("CancelPushButton");

[Code]....

View 3 Replies

Web Forms :: Enable ViewState Only For Few Pages?

Mar 16, 2010

I want to disable viewstate for nearly all of my pages and I have used the element to do so in my web.config.On a page that specifically uses viewstate, I used the EnableViewState=true. However the page fails to work and the dropdownlists that depended on viewstate are not filled in the postback.How can I enable ViewState for some Pages when it is disabled in WebConfig?

View 12 Replies

Web Forms :: Button In User Control Doesn't Work?

Oct 8, 2010

My button in user control doesn't work /its click event doesn't fire/. This user control is on the page that inherits from master page. Although, the user control buttons on the master page work correctly.

View 3 Replies

Web Forms :: Focus Doesn't Work On Control In The Panel

Jan 21, 2010

In a panel (panelOrder, visible=false), there are three text box, txtA, txtB and txtC. Once click a button, code fires:

panelOrder.visible = true
txtA.focus

But, focus never work. I change to Javascript, still no luck. What is wrong?

View 5 Replies

AJAX :: Control Doesn't Work On Apache Server?

Oct 11, 2010

i am using mod_aspdotnet.so module to hosting my ASP.NET application. all was ok until i use ajax control tool kit in my aplication. I am using ajaxToolkit:CascadingDropDown to conect 2 dropdownlist in cascade. In IIS every thing works fine, but in apache there are some problems. When load the page, i got the next javascript error: 'Sys' undefined. the object signed are :

Sys.WebForms.PageRequestManager._initialize('ScriptManager1', document.getElementById('MAIN_FORM'));
Sys.Application.initialize();

How can i solve this problem?

View 2 Replies

JQuery .Show() Doesn't Work With Server Control?

Nov 1, 2010

I have 2 html TR that i make them runat="server" & visible="false" and I have a dropdownlist called citiesDropDownList

$(document).ready(function() {
$('#<%=citiesDropDownList.ClientID %>').change(function() { ValidateCity(); });
});

and on change of this dropdownlist i check if the its text equal to a string i show the 2 tr as below

function ValidateCity() {
if ($('#<%= citiesDropDownList.ClientID %> :selected').text() == identity_CityOther) {
$('#<%= otherCityTR.ClientID %>').show();
$('#<%= areasTR.ClientID %>').show();
}
var city = $('#<%= citiesDropDownList.ClientID %>').val();
return IsValid((city.length != 0), '#<%= cityDiv.ClientID %>', identity_CityRequired);
}

.show() isn't work at all and i don't the reason .. can any lead me to get the problem?

FYI : I tried $('#<%= otherCityTR.ClientID %>').show('slow'); and also $('#<%= otherCityTR.ClientID %>').css('visibility', 'visible'); but it doesn't work also.

View 3 Replies

AJAX :: Control Toolkit Doesn't Work - How To Repair It

Feb 24, 2010

i am using VS2008, 3.5 .net and have installed ajax control toolkit and added controls into toolbox, that was fine. But, i can't get any of control to work, nor it renders in design view on my page. Control source is created, page builds without errors but controls don't work. For example:

<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>

View 6 Replies

JQuery :: Datepicker Doesn't Work On Web User Control?

Feb 15, 2011

I have user control with one textbox on it and i want to apply datepicker to.

here is the code of mycontrol.ascx

[Code]....

If I click inside text box control the datepicker doesent shows.

If I use the same code for showing datepicker on webform it works. Why? Do I miss something or I need something to add on my control?

View 2 Replies

Web Forms :: EnableViewState False - Can Still Access And Maintain ViewState

Apr 21, 2014

If we set enable view state = false of a page then can we maintain the view state of that page ?

View 1 Replies

Web Forms :: Wizard Control Doesn't Work In Content Page?

Sep 24, 2010

i am using wizard control in content page.if i use it in normal aspx it works.but not in content page.i use same code for aspx and content pages

View 1 Replies

Web Forms :: What Can Remove All Info From Viewstate And Making The Ispostback Again To False

Apr 23, 2010

I have a strange problem, my webform is loading twice.

when i debug i see ispostback is showing false for both times.

what happened to the first time load , and the viewstate.

What can remove all info from viewstate and making the ispostback again to false.

i am having real difficulty figuring out what is causing this problem.

View 3 Replies

Web Forms :: Regular Expression Pattern Doesn't Work In Validation Control

Aug 5, 2010

i want to ask question i have simple regular expression pattern like "[ABC]" when i add it to me class

[Code]....

it is working good when i add A , B Or C as i need.but if i copy this pattern and paste it in my regular expression validator control it is not working

View 3 Replies

AJAX :: Showing Popup Control Via Javascript Doesn't Work On Explorer 7

Mar 19, 2010

I'm using the following function (found on this forum) to display a popup control from the server-side:

on the server:

ScriptManager.RegisterStartupScript(this, GetType(), "userInfoPopScript",
string.Format("showPopup('{0}', 2);", targetControlClientId)
, true);

on the client:

[code]....

this works great for explorer 8 , firefox, chrome but on explorer 7 my page just jumps to the left and doesn't show the popup at all.

If I remove the set__parentElementID call, then the popup is displayed but in the wrong position (of course).

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved