Persisting State On A Master Page's Hierarchical List?
Feb 17, 2010
I'm writing an ASP.Net application (no AJAX, but maybe) and there's a requirement to have a list of companies graded under a traffic light system. I intend to have these in a collapsible hierarchical list on the Master page, e.g. Red expands to show companies, and then companies can be further expanded.
how can I keep the expanded list in the same place, with the same content visible, between page loads?
View 1 Replies
Similar Messages:
Oct 12, 2010
how can DropDownList attributes be persisted accross page Postbacks?
Example:
DropdownList1.AutoPostBack = True
DropdownList1.items(0).Attributes.Add("Attribute1","somevalue")
On Postback the attribute is no longer available (ie. attributes.count=0).
I tried persisting using the code below, but was unsuccessful:
Before PostBack: ViewState.Add("DDL","DropdownList1")
On PostBack: DropdownList1 = ViewState("DDL")
This generated the error: DropDownlist is not marked as serializable.
I than tried:
Before PostBack: Session.Add("DDL","DropdownList1")
On PostBack: DropdownList1 = Session("DDL")
This did not err but attributes were still not available.
View 4 Replies
Dec 23, 2010
Using ASP.Net 4.0, MVC 2, Visual Studio 2010.
I am building a chat control, which is a div with a background image, textarea, text box and some image. The CSS for this div on the Master Page is:
[Code]....
When a user navigates to the page where they can start a chat session by clicking on an icon, I use jQuery to change the CSS, like so:
[Code]....
The CSS for showing the chat is the same as the above CSS, only .chatWindowShow does not have the display:none property.
The problem is that once I navigate to another page, the div is hidden again, the CSS does not persist accross postbacks for some reason. What I want is that once the chat window is shown, no matter what other pages the users go to it will continue to show, until they click the close icon in the chat window.
So, how can I persist this CSS page accross all pages? I thought that removing the CSS class and adding the new one via jQuery actually modificate the inline HTML, but I guess not. Do I need to use some other jQuery to accomplish this?
Here is the HTML markup for my chat window:
[Code]....
And the jQuery which toggles the view when you click on the chatRight div:
[Code]....
View 3 Replies
Aug 2, 2010
I have a master page containing a tree and 3 dropdown lists. I am populating a context menu on right click of each node, and when clicked on any item of the context menu, it navigates to required pages.
My problem is after navigating to the required page, the selected values from the drop down lists and the selected node from the tree are getting cleared.
I can set the selected values for the dropdown lists by making some properties in master page.
But how do i maintain the selected node?
In my content page, i have got the valuepath of the right clicked node.
Or is there any other way than setting the properties in master page?
View 6 Replies
Dec 30, 2010
I have created a matser page with a two radio buttons, text box and a button. Whenever user sets some values to these control and clicks the button, i will navigating him from one content page to another based on the data he has entered. The problem is after the content page load, the values selected/given in the controls(radio button, text box) are getting cleared.
Is there some way to maintain the values ?
View 8 Replies
Jan 3, 2011
I'm building a web application that has a particular model representing some events. Users need to be able to add N number of people to a given event. Choosing people is handled by a partial view.
I'm trying to build a menu that displays when users click "add a person" to the event. Because the event hasn't been filled out completely yet, there is nothing in the database to persist between requests.
I also have validation logic on the event page.
My proposed solution is to add the form to search or add for people on the event form itself and have a submit button that sends the values that have been added back to the server, where I can store them in ViewData or Session.
Unfortunately, doing this flags the validation.
My second solution is to load a partial view responsible for loading the UI to add/search for a person. I could add a little code on the method in the controller that returns a partial view storing the existing data in a session variable or viewdata. Trouble is, I have to submit the form to do it--again tripping the validation!!!
I'm wondering if perhaps I chose the wrong tool to do this...because in webforms, there would probably be a postback and you would just perform an operation on that postback. I'd like to avoid rewriting the application in webforms and am wondering if there are ways I'm overlooking in ASP.NET MVC.
View 2 Replies
Mar 23, 2011
Suppose I have created a spgridview with the following code.
[Code].....
To persist the checkbox states between pagebacks ,currently i am using session states.It has some draw backs.Now how can I persist the checked states,when the user manually checks all the checkboxes,how can i make a check on the header checkbox?
View 1 Replies
Nov 5, 2010
I wish to persist a class object across postbacks by using a single session variable/object/whatever.
The class has about a dozen single variable properties; and about a dozen table properties; and several methods. The main table tracks rows of sporting event results. The web site will collect one row at a time for each postback. The data in the object's constructor is based on a dataset, but the data in the class will grow each time I do a postback so I don't want to loose the information in the class. The data isn't very big - it will fill a single computer screen.
Being new to programming I am thinking that I can store the dataset in the session but that would slow down the response time because I the methods would have to be called to refine the data - or maybe I can just store the entire class object in a session.
View 3 Replies
Aug 11, 2010
So here is the situation - there is data on master records - its a hierarhical view - something like (ID, IDParent, Title) and detail data - (ID, IDMaster, Details)
And like to build UI using an TreeView - binded with master data - and an GridView - binded with detail data.
Question is witch property to use to create the master/detail chain between Datasources - oh, I've forgot to tell I'm using an ObjectDataSource?
View 3 Replies
Jun 17, 2010
got [URL] - two separate apps in IIS.
Want the forms based auth to persist (they use the same database for membership)
I tried to simply add a "." before the domain name in the forms tags (see below for example) - but this didn't work - it acutally prevented me from logging in at all. how i can persist the login? Does the admin need the same values for "name", "path" and "domain" as the main site?
[code]....
View 1 Replies
Sep 15, 2010
i added a collection of data into a list box. i have another group of data with a group name.i want to add this group in to that same list box as a tree structure.
the sample list box is shown below.
item1
item2
item3
-group name
group item1
gruop item 2
gruop item 3
item 4
item 5
is there any way to do this. when clicking on the group name it must be expanded within the list box and i want to manage all these elements with an index.
View 3 Replies
Jan 2, 2011
I am using this code to pass variables from ASP.NET application to HTML Application:
[Code]....
The above code is run from page_laod event, and I am making some development changes on the Development Machine (say
http://eutdev02/ehrmd).
After the ASPX page is loaded, and I debug the javascript in the HTML (F12 under IE8), and can see the Cookie is found in the browser.
But, when I open the target HTML/Javascript web page (which will read the cookie prmStaffID), but the HTML Page is on the production machine (separate server say
http://prod01/Attendance.html), the Cookie is not found !!!
It seems to me that Cookies will persist only on one IIS Server, and will not be global.
Question:How I can persist the Cookie on the Client Machine regardless of the the Server Machine ?
For testing purposes, I want to send the cookie to the client from teh Development Server, but the target application is under HTML/Javascript, and I want to be able to read the same Cookie using Javascript.
View 5 Replies
Jan 25, 2011
just been trying to recieve the session value from multiple jquery ajax requests on the same domain name. i think i understand that each request is kind of a virtual browser request so the session is mutally exclusive to each request, but there must be a way some how, has anyone solved this. Basically this is what im trying to do:
I have tries using type: GET and POST but still no luck.
First request - Stores the product id in a session
[code]....
View 1 Replies
Oct 19, 2010
I've created a visual webpart .My user control is gridview,in which one of the column is checkbox.The checked state of my checkbox within a gridview get disappeared during postbacks. I want to maintain the checked state.
View 1 Replies
Feb 9, 2010
I've a checkbox with autopostback=true. If i check the checkbox the postback occurs and changes a label text. But if i click back in the browser the checkbox is not returning to its previous unchecked state. How can i bring back its state?
Can i write some JavaScript to persist the state of a control?
View 1 Replies
May 13, 2010
I have a simple user control containing two text boxes which I am adding to placeholder on Button Click event. I am storing the number(count) of clicks in View state and running a loop using count to create all previously added user control. I am also adding IDs to each User control (appending "UC" and count). I have also checked in view source the ids are same each time they are created. I have another button which basically does an post back. I have EnableViewState enabled ="true" in all controlls all the way up to Page Level. My problem is that User Input does not persist on postback. Should this not be happening automatically for me?
View 2 Replies
Jan 12, 2011
I have an action where I get the list from the database and pass it to the view. Now, I want that when I fire another action I can somehow get hold of that list (List). How can I do that since ViewData and the TempData is erased on each request.
View 1 Replies
Sep 14, 2010
I am getting following output in Dataset
ActivityID ParentActivityID ActivityName AcivityLevel
0 NULL Dashboard 0
1 NULL Market Trends 0
2 1 News 1
and I want to build HTML list as follow.
<ul>
<li>Dashboard</li>
<li>Market Trends[code]....
View 1 Replies
Jan 20, 2011
I read this article first to try to solve this issue, but I am already loading the controls in the Init phase of the page, yet viewstate is not persisting. Any ideas as to why? (Of note is that this is for a custom module in DNN and I do have some AJAX update panels on the page, though this section is not within an update panel, for what it's worth.)
As an overview of what I've got:
1. LoadControl.ascx - based on reading query string parameters, determines whether to load the master or the detail .ascx.
2. Master.ascx
3. Detail.ascx
In my master control I dynamically load either a master or detail sub-control in the page_Init. The detail page has a treeview control and then uses a multi-view control to display the panel associated with the depth of the node selected on the tree. On the panel being displayed I have a cascading ddl within a detailsview control which initiates a postback to select the child ddl based on the parent ddl selection. However, when the page refreshes after the postback, both ddls have resorted to their default selection.
What is interesting however, and I just realized this as I am typing, is that the Treeview is populated when the page comes back from the postback, so that is only possible if viewstate is being persisted right? (See the page_load code and you'll see that Call PopulateRootLevel(intTreeUserID) which populates the treeview, is not called on postbacks....hmmm.
Any ideas as to why the treeview maintains viewstate but not my ddls???? But though the tree is populated, I do have to explicitly select the node again and set the panel that the detailsview control is on to visible again too....
Here is the dynamically loaded control code:
[Code]....
And in the Detail.ascx page load I've got:
[Code]....
[Code]....
View 6 Replies
Apr 12, 2010
I'm having troubles remembering how to grab the list view's state, or page, so that when you leave the list, you can return to the list view page you left on. I have a data pager, and I have hyplerlinks for items in the list view that take you to a file upload or file delete page, and then returns to the list view. It returns to the list view's initial state (first page).
View 1 Replies
Mar 16, 2010
I've data which looks something like this.
[code]....
To convert the above data into unordered list based on depth, I'm using the following code
[code]...
But the resulting unordered list doesnt seem to be forming properly(using which i am constructing a tree).For example "Site " with id '180' is supposed to appear as a direct child of "Televisions" with id '1',is appearing as a direct child of 'Flash' with id '191' using my code.so in addition to considering depth,I've decided to consider itemid as well in order to get the treeview properly.Those rows of the table with itemId not equal to null are not supposed to have a child node(i.e.,they are the leaf nodes in the tree) and all the other nodes can have child nodes.
Update:
The 'itemid' column refers to the id of an item which is present in another table.This column just in identifying if an item has any sub items(i.e., 'name' in my data in this case has any other unordered lists under it).
View 1 Replies
Mar 22, 2010
I have a Web Application where I have one and only one master page and with 100's of diffrent content pages
So to speed up my Web app How can i CACHE the mater oage but not the content page??
Master page loads each time whenever content page is requested..
This thing is possible,I have seen it on many diffrent websites where the Website's Master Page Remains Intact and only the content page changes (best example would be Facebook)
How can i have the same effect in my Web Application?
View 24 Replies
Aug 29, 2010
I have applied nested master page to some page. Now i want to bind drop downlist from value selected in dropdown list in master page of master applied to that page.
the hierarchy of pages is
mypage.aspx -> main.aspx -> inner.master
I want bind dropdown list in mypage.aspx from from value selected in dropdown list in inner.master
View 2 Replies
Jan 5, 2011
Please bare with me as I am completely new to ASP.net and trying to learn the language (I am a Flash and AS3 kinda guy).
I have a master page template and I'm trying to put a hit counter on the footer for each page. I'm using VB for this code.
[Code]....
And then in the footer div I use this code
[Code]....
It appears my counter.txt file isn't even being created like it normally was on my other single .aspx pages and in turn nothing is being displayed in my Label1.
View 2 Replies
Mar 7, 2010
Is it possible filtering a list in a content page by a value set in its master page? I mean when a user clicks on a link button in master page a variable is set and then based on the value that variable, when loading a content page, a list in it is filtered?
View 1 Replies