Refresh Page Isn't Working Using Treeview

May 30, 2010

I am trying to refresh an asp.net page using this command:

<meta http-equiv="Refresh" content="10"/>

On that page I have 2 treeviews. The refresh works ok when I just open the page, but when I click on one of the treeviews and expand it, the refresh stopps working and the page isnt being refreshed. Is there any connection to the treeview being expanded? Here is the full code of the page:

public partial class Results : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
// Function that moves reviewed yellow card to reviewed tree
protected void ycActiveTree_SelectedNodeChanged(object sender, EventArgs e)
{
ycActiveTree.SelectedNode.Text = "Move To Active";
ycReviewedTree.PopulateNodesFromClient = false;
ycReviewedTree.Nodes[ycReviewedTree.Nodes.Count - 1].ChildNodes.Add(ycActiveTree.SelectedNode.Parent);
Application["reviewedTree"] = new ArrayList();
int count = ((ArrayList)Application["activeTree"]).Count;
// Move all the nodes from activeTree application to reviewedTree application
for (int i = 0; Application["activeTree"] != null && i < count; i++)
{
((ArrayList)Application["reviewedTree"]).Add(((ArrayList)Application["activeTree"])[i]);
((ArrayList)Application["activeTree"]).RemoveAt(0);
}
}
protected void ycActiveTree_TreeNodePopulate(object sender, TreeNodeEventArgs e)
{
if (Application["idList"] != null && e.Node.Depth == 0)
{
string[] words = ((String)Application["idList"]).Split(' '); // Yellow Card details
TreeNode child = new TreeNode("");
// Go over all the yellow card details and populate the treeview
for (int i = 1; i < words.Length; i++)
{
child.SelectAction = TreeNodeSelectAction.None;
// Same yellow card
if (words[i] != "*")
{
// End of details and start of point ip's
if (words[i] == "$")
{
// Add the yellow card node
TreeNode yellowCardNode = new TreeNode(child.Text);
yellowCardNode.SelectAction = TreeNodeSelectAction.Expand;
e.Node.ChildNodes.Add(yellowCardNode);
child.Text = "";
}
// yellow card details
else
{
child.Text = child.Text + words[i] + " ";
}
}
// End of yellow card
else
{
child.PopulateOnDemand = false;
child.SelectAction = TreeNodeSelectAction.None;
// Populate the yellow card node
e.Node.ChildNodes[e.Node.ChildNodes.Count - 1].ChildNodes.Add(child);
TreeNode moveChild = new TreeNode("Move To Reviewed");
moveChild.PopulateOnDemand = false;
moveChild.SelectAction = TreeNodeSelectAction.Select;
e.Node.ChildNodes[e.Node.ChildNodes.Count - 1].ChildNodes.Add(moveChild);
child = new TreeNode("");
Application["activeTree"] = new ArrayList();
((ArrayList)Application["activeTree"]).Add(e.Node.ChildNodes[e.Node.ChildNodes.Count - 1]);
}
}
}
// If there arent new yellow cards
else if (Application["activeTree"] != null)
{
// Populate the active tree
for (int i = 0; i < ((ArrayList)Application["activeTree"]).Count; i++)
{
e.Node.ChildNodes.Add((TreeNode)((ArrayList)Application["activeTree"])[i]);
}
}
// If there were new yellow cards and nodes that moved from reviewed tree to active tree
if (Application["idList"] != null && Application["activeTree"] != null && e.Node.ChildNodes.Count != ((ArrayList)Application["activeTree"]).Count)
{
for (int i = e.Node.ChildNodes.Count; i < ((ArrayList)Application["activeTree"]).Count; i++)
{
e.Node.ChildNodes.Add((TreeNode)((ArrayList)Application["activeTree"])[i]);
}
}
// Nullify the yellow card id's
Application["idList"] = null;
}
protected void ycReviewedTree_SelectedNodeChanged(object sender, EventArgs e)
{
ycActiveTree.PopulateNodesFromClient = false;
ycReviewedTree.SelectedNode.Text = "Move To Reviewed";
ycActiveTree.Nodes[ycActiveTree.Nodes.Count - 1].ChildNodes.Add(ycReviewedTree.SelectedNode.Parent);
int count = ((ArrayList)Application["reviewedTree"]).Count;
// Move all the nodes from reviewedTree application to activeTree application
for (int i = 0; Application["reviewedTree"] != null && i < count; i++)
{
((ArrayList)Application["activeTree"]).Add(((ArrayList)Application["reviewedTree"])[i]);
((ArrayList)Application["reviewedTree"]).RemoveAt(0);
}
}
protected void ycReviewedTree_TreeNodePopulate(object sender, TreeNodeEventArgs e)
{
if (Application["reviewedTree"] != null)
{
// Populate the reviewed tree
for (int i = 0; i < ((ArrayList)Application["reviewedTree"]).Count; i++)
{
e.Node.ChildNodes.Add((TreeNode)((ArrayList)Application["reviewedTree"])[i]);
}
}
}
}

View 1 Replies


Similar Messages:

Page Refresh And Bind Not Working?

Jan 3, 2010

I've got a .aspx and in it an .ascx. In the .ascx I have a server control.

The .aspx has a list of items in a cart The .ascx has a list of some cross-sell items (fed from a custom server control) that the customer can add to the cart if desired both the list of items in cart and list of cross sell items are driven by a repeater and bound on page load. So the .aspx calls a method that rebinds the cart items on page load. And the .ascx calls a method in its page load that rebinds the cross sell items in that custom control (.cs) that is in my .ascx.

The problem I have is, when the user clicks a "add to cart" button in the repeater inside my custom control, the page refreshes and what should happen is the cart items in the .aspx AND the list of cross sells should refrsh showing that the cross sell item was moved to the cart. But even though when I debug and I see the list being rebound with the corret # of items after the move, the page still shows the old state. I have to refresh the page manually again to get it to work.

I guess I need to check for Page.IsPostback? but even if I don't check that..at the least both lists should be refreshing regardless cause I have it in my page load. So even if it's a postback, and I'm not checking for that the lists should show the new state because I'm not even checking for postback anyway. So checking for postaback I don't think is the issue here cause i want the lists to rebind and re-update on any page load....initial or if it's a postback...it doesn't matter. Reload every time. But it doesn't seem to be doing this even though I clearly see the revbind of the lists having the right count (one less on the cross sell and one additional to the cart as it was added after the user clicked the button).

Here's the sequence of events:

User is on their cart page User sees a list of cart items that they have added to their cart already (this list is bound in the Cart.aspx and rebound on every page load)User sees a list of possible cross sell items they can add to their cart somewhere on the page. This list is a custom control found in my .ascx and that .ascx is obviously in my .aspx.

The custom control is just a repeater that lists out the cross sell itemsUser clicks one of the "Add to cart" buttons on one of the cross sells Page refreshes. In the page load of the .aspx AND the .ascx, I am going out to the DB and rebinding both those lists based on the new state...that is, the new lists after the item was added to the cart which means that now the cart items should have one more added to the list and it does...I clearly see that the new list has one more.

The page comes back after the refresh but I don't see the lists reflecting the new state...I don't see the new item in the cart items list and the added cross sell removed from the cross sell list even though again both lists when I debug are showing correct set of records reflecting the new state.

View 2 Replies

JQuery :: Treeview Plugin Is Not Working With Ajax Page Load In Ie8

Aug 19, 2010

I developed a page where i m using jquery treeview plugin to generate tree. It worked fine on FF, IE8 with out ajax.But when my page loads thro' ajax call in IE8, it is not collapsing or expanding tree.

View 5 Replies

Web Forms :: Javascript On RadioButtonlist Not Working On Page Refresh?

Mar 2, 2011

I have used a radiobuttonlist to enable/disable the textbox in Grid View. I did this using javascript onclick event.

[Code]....

It is working fine when the page get refreshed too.

[Code]....

Then in a scenario, I have removed the radliobuttonlist items (items 2 and 3) dynamically. For the first time when its loaded its working without flaws. After a page is refreshing due to any serverside events, the javascript to enable/disable textbox is not working.

[Code]....

I have verified the HTML file, the radiobuttonlist is loaded without the onclick event.

View 1 Replies

Web Forms :: Page Refresh Not Working After Inserting Records Into Database

Oct 28, 2012

I've a function named fillgrid() which fills the grid with data.This function works correctly on pageload,but after inserting into database i've called this function again, which is not getting executed.This issue happens only in real time server not in my local system,I'm not getting any error and i cannot recognize why fillgrid() function is not getting called??I've used update panel.This is the code for insert function which inserts over 500records.

DataTable dtMob = new DataTable();
dtMob = dtMobilizn.Copy();
DataSet dsMobilizn=new DataSet("dsMobilization");

[code]....

View 1 Replies

Web Forms :: TreeView Refresh On Things Like A Filte?

Apr 12, 2010

TreeView controls are a little Hairy when using them for display of things like Hierarchical data.In my case, I am using it for the display of Roots and Leaf Nodes (Child Nodes) and everything in between to get chains of selected nodes back to the Root Node (final Parent Node) in a detail list that is another database call for the Detail Sheet on the"Checked" boxes of chained branches in the TreeView.

View 2 Replies

JQuery :: Clear/reload/refresh Async Treeview?

Jun 24, 2010

I've implemented the JQuery Async Treeview (in APS.NET MVC2) and it works fine, but the problem is when the user adds new nodes to a tree (via another interface), there is no way to reload the tree and reflect the new tree structure.

The only way to see the changes in the tree is to shut down the browser (IE8). Trying .empty() on the tree on every reload doesnt do anything.

Heres the page source:

[Code]....

the URL /OrganizationStructure/Browse is only called when the tree is being built the first time..i cant for the life of me get it to rebuild even when the browsers "Refresh/Reload" button is clicked.

View 2 Replies

AJAX :: Refresh The ContentPlaceHolder , Not The Entire MasterPage When A Link Is Clicked On The TreeView?

May 5, 2010

I have an app that uses masterpages. On the masterPages I have a TreeView. I would like to only refresh the ContentPlaceHolder & not the Entire masterPage when a link is clicked on the treeView.

I have placed the contentplaceholder in an Updatepanel. I would like to if possible avoid including the menu in the update panel.

Using

VS2008 C#

AJAX Control toolkit Version 3.0.30512.20315

View 2 Replies

Web Forms :: Treeview .each Node In A Treeview Will Need To Display Different Page?

Nov 15, 2010

I have a treeview which will be generated dynamically which need to be displayed on left side and when user clicks on a node it need to open a page on the right side of the same page. and each node has different aspx page. so whenever user selects a node the page details should be displayed on the right side .we can use an iframe on the page which will display the different pages clicked on the node.Is there any alternative i can use to display different pages based on the user selection on the right side without using iframe.

View 5 Replies

Forms Data Controls :: How To Refresh Page Without Going To Top Of Page When Refresh Is Done

Nov 3, 2010

I have a table on my page. I need to scroll down a little to get to that table. In that table i have som data that i edit and save to database. When the save is done i need to refresh the page( Response.Redirect(Request.RawUrl )) so it loads the new data to that table. When the refresh is done the page is on top again so that i need to scroll down again to see the table. This makes it very unusable for the user.

How can i refresh the page without it going back to top again? I tryed wrapping an updatepanel around the table but it didnt

View 1 Replies

Refresh Small Part Of The Webpage Without Refresh The Entire Page In C# ?

Mar 11, 2011

how we can refresh small part of the web page without refresh the entire page in C# ?

View 2 Replies

Web Forms :: Make An Ifrom Refresh Without Having To Refresh The Whole Page?

Jan 18, 2010

1. Is there anyway to make an ifrom refresh without having to refresh the whole page?

2. My iframe just wont display when I run it. It just displays a grey screen with the file name in the middle.

<
iframe
runat="server"
id="IframeOne"
src="~/Test.aspx"></iframe>

View 3 Replies

Page.Refresh Type Of Command To Refresh A Page?

Feb 10, 2010

Is there a Page.Refresh type of Command to refresh a page? I don't want to redirect to the page or refresh in javascript.

View 4 Replies

Treeview - TreeNodeCheckChanged Is Not Working In Application

Jan 12, 2011

TreeNodeCheckChanged is not working in my ASP.Net application.
<asp:TreeView ID="TreeView1" ShowCheckBoxes="All" runat="server"
OnTreeNodeCheckChanged="TreeView1_TreeNodeCheckChanged">
</asp:TreeView>
protected void Page_Load(object sender, EventArgs e)
{
if (!this.Page.IsPostBack)
{
TreeView(); //bind manually
}
}

View 1 Replies

AJAX :: Treeview In Update Panel Is Not Working?

Jun 15, 2010

I am having a treeview in Masterpage,all tree items are associated with different page,when i click on any of the tree item,i the respective page should be displayed in the ContentPlaceHolder of the masterpage without postback,

i kept the treeview and the contentplaceholder in the updatepanel,still it is not working,means entire page is posting back to server

Here is my code

<form id="form1" runat="server">
<div>
<table>
<tr>
<td valign="top">

[Code]....

View 1 Replies

Crystal Reports :: Refresh On Runtime Not Working

Nov 14, 2010

I generate report using parameters.I pass parameter on run time & report is generated. For Example: At first i am displaying A list of customers having SEX = MALE. Than I enter SEX = FEMALE. But it still displaying the MALE list Results. If i rebuild my webform and than put parameter FEMALE then it displays. So, If i generate a report once. I dont want to rebuild my webform to pass new parameter. . How it should be Done. I added one line code CrystalreportViewer1.RefreshReport(); but it did not work for me. I am using VS 2010..

View 1 Replies

Web Forms :: Update / Refresh Isn't Working - Web App Template

Dec 3, 2010

I am working on a small application and am using the regular web app template (w/ master page) that comes with webdev express 10. There are four pages on the site, and each of them seems to be working like I would expect. The problem is that the asp:menu that is being used for navigation (part of the template) causes the entire page to redraw every time I use it and it pretty much looks like ass. What can I do to prevent this? I have already tried putting those elements in an update panel, but that isn't working for me. I'm not getting any errors, but it could be a syntax thing.

View 8 Replies

Web Forms :: Treeview Style Doesn't Apply In The Page If That Page Is Using Mater Page

Jun 10, 2010

I've encountered a problem when I put a treeview in a page which is using master page. The treeview style doesn't apply.For example, I set the nodes with different colors in different levels. But the treeview nodes are still displayed in the default color(bule).

The treeview code is :

[Code]....

If I use these code in a page which doesn't use a master page. The nodes are shown in colors.

View 3 Replies

Forms Data Controls :: FormView Refresh Schema With ObjectDataSource Not Working

Jan 22, 2011

I'm having a problem with a FormView control that I have bound to an ObjectDataSource. The problem is that the FormView control is not automatically filled in with the public properties of the object linked by an ObjectDataSource control when I select refresh schema. Everything compiles and I can add fields manually, but there are a lot of properties in the class and I do not want to deal with adding all the fields by hand. It's not the end of the world of course if I have to add them manually, but I'm bothered more by the fact that it doesn't act the other formviews.

Has anyone ever experienced a problem like this? I have other objectdatasource controls with other formviews that properly refresh their schemas. I noticed that in the objectdatasource control that is giving me problems, the DataObjectTypeName field is not automatically set as it is in the others. However, after adding it manually it still doesn't refresh the schema. I'm using Visual Studio 2010. Defined in .aspx page:

[Code]....

The SPFModuleBLL class contains the GetModule2() method which is shown here:

[Code]....

View 3 Replies

Web Forms :: WebPartZone - Refresh, Minimize And Close Are Not Working In Chrome & Safari

Dec 20, 2010

We are using Web Part Zones to display certain Charts in our website. In the title of the Zone, we are using the below code to display the menu for Minimize, Refresh and Close buttons.

<CloseVerb ImageUrl="~/Images/Close.png" />
<MenuVerbStyle BorderColor="#5D7B9D" BorderStyle="Solid" BorderWidth="1px" ForeColor="White" />
<TitleBarVerbStyle CssClass="WPVerbBar" />[code]....

This buttons are working fine in IE and in Firefox. But the same is not working in Chorme and in Safari.We got the below script error in Chrome:

Uncaught TypeError: Object #<an HTMLElement> has no method 'attachEvent'

ScriptResource.axd?d=JgYxHqt6li1Lc12at8VRK-y-qeXK_5Wiei-tKNUi8rRE-1X5EEl-KvYEuW4m8Foj1VyIiaN7sK98_-pMwa5y7w2&t=633802855995006876:277Uncaught TypeError: Object #<an HTMLElement> has no method 'attachEvent'

View 1 Replies

Forms Data Controls :: Javascript Function Called On Click Of Treeview Is Not Working In Mozilla?

Apr 29, 2010

I want postback on click of treeview node .So i called a javascript function to do the same. I wrote the following ..On page load:

[Code]....

This is working fine in IE. But it is not working in mozilla and google chrome.

[Code]....

View 4 Replies

Page - Dont Want Full Page Refresh When Click A Button In A Web Page?

Feb 18, 2010

How can I use double buffering in asp.net C#?I want smthng like that : I dont want full page refresh when I click a button in a web page.. I think it can be solved with double buffering. When a button clicked for redirect a content page (button-in master page), current page will not go until the redirected page completely load in the background..

View 3 Replies

Web Forms :: TreeView Control /loading A New Page, Does Not Select The Node Of The Current Page?

May 1, 2010

I am experiencing an issue with the TreeView control when loading new pages. It is databound to web.sitemap, but when loading a new page, it does not select the node of the current page, just resets it to the root. THe new page loads fine, just not preserving the current navigation in the tree view.

View 2 Replies

Updatepanel - Update Panel In Master Page, Refresh Button In Content Page?

Feb 26, 2011

I have Update panel in Master page:

<asp:ScriptManager id="CartScript" runat="server"></asp:ScriptManager>
<asp:UpdatePanel id="CartBox" runat="server" updateMode="Conditional">
<ContentTemplate> [code]...

But i got same error. how I can add to my Update Panel that Button from Content Page can refresh it?

View 1 Replies

Forms Data Controls :: Go To Next Page In Gridview Without Refresh Page (wihtout Postback)?

Nov 15, 2010

how can go to next page in gridview without refresh page

i thing programmers says wihtout postback?

View 1 Replies







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