Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

Assign List to view state ASP.net

$
0
0

Dears
we have .net page has Update panel

<div class="lists collaps_container "><asp:UpdatePanel runat="server" ID="upMain" UpdateMode="Always"><ContentTemplate><table style="width: 100%"><tr><td><common:Message runat="server" ID="ucMessage" /></td></tr></table><common:JalsaStatmentView runat="server" id="JalsaStatmentView" /></ContentTemplate></asp:UpdatePanel><asp:UpdateProgress runat="server" AssociatedUpdatePanelID="upMain" ID="uppMain" DisplayAfter="1"><ProgressTemplate><div class="divWaiting"><img src="/Design/images/loading.gif" height="120" width="120" /></div></ProgressTemplate></asp:UpdateProgress></div>



when we try to edit the page by this code

txtIdea.ReadOnly = ISActive;
txtIdea.CssClass = CSSClass;
txtStatement.ReadOnly = ISActive;
txtStatement.CssClass = CSSClass;
txtSubject.ReadOnly = ISActive;
txtSubject.CssClass = CSSClass;
chkIsResolved.Enabled = !ISActive;

it's work normal, but when i assign the list to view state after that the page keep its state and not change to edit mode

txtIdea.ReadOnly = ISActive;
txtIdea.CssClass = CSSClass;
txtStatement.ReadOnly = ISActive;
txtStatement.CssClass = CSSClass;
txtSubject.ReadOnly = ISActive;
txtSubject.CssClass = CSSClass;
chkIsResolved.Enabled = !ISActive;

List<RequestAttachment> AttachmentList = new List<RequestAttachment>();//dbContext.RequestAttachment.GetByQuery(x => x.EntryTypeId == 2 && x.EntryId == statementID && x.UpdatedBy != HttpContext.Current.User.Identity.Name).ToList();
ViewState.Add("AttachmentList", AttachmentList);//AttachmentList;

when i add the last tow rows to our code the page not work and stay in view mode

* when we change the assign to string like that

ViewState.Add("AttachmentList", "Hello");//AttachmentList;

the page work again and changed to the edit mode ,

My problem why when i add List of object to view state the page not change its mode


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>