Showing posts with label project. Show all posts
Showing posts with label project. Show all posts

Monday, March 26, 2012

Treeview, how to remove style on preselected node

In my .NET 2.0 project and I'm using a TreeView with Atlas so the page doesn't postback. When the page loads the first time, it also preselect a node based on a value saved in the DB. The style applied on this node doesn't change when user selects another node. However, the style on the node user selected is removed once user selects another node. I'm guessing there's a javascript variable I need to set on page load?

T"he style applied on this node doesn't change when user selects another node. However, the style on the node user selected is removed once user selects another node."

So the node loses it style when what occurs? I'm not quite sure what you mean by that?
Just so you know though the TreeView control doesn't cause a postback in terms of navigating through the tree. If you need to apply a certain style to the TreeView just look at the options for it here.

http://www.asp.net/QuickStart/aspnet/doc/ctrlref/navigation/treeview.aspx

That should give you a good starting place for how to work with the TreeView control both on the server side and client.

JoeWeb

Trigger design-time error

At the begin, is all ok: when I open my project the controls was showed normally.
After first run, when I switch from html view to design-view the updatepanel control show this error:

Error Creating Control - Content1
'Triggers' could not be initialized. Details: 'Triggers' could not be added to the collection. Details: Object does not match target type.

This is my code:

<%

@dotnet.itags.org.PageLanguage="VB"MasterPageFile="~/MasterPage.master"AutoEventWireup="false"CodeFile="Ricerche.aspx.vb"Inherits="Ricerche"title="Ricerche" %>
<asp:ContentID="Content1"ContentPlaceHolderID="ContentPlaceHolder1"runat="Server">
<atlas:ScriptManagerID="ScriptManager1"runat="server"EnablePartialRendering="true"EnableScriptGlobalization="false"></atlas:ScriptManager>
<asp:TextBoxID="TxtSearch"runat="server"></asp:TextBox>
<asp:ImageButtonID="ImageButton1"runat="server"ImageUrl="~/Images/Cerca.gif"/><br/><atlas:UpdatePanelID="UpdatePanel1"runat="server"Mode="Conditional">
<ContentTemplate>
<asp:GridViewID="GridView1"runat="server"AutoGenerateColumns="True"DataKeyNames="ID"></asp:GridView>
</ContentTemplate>
<Triggers>
<atlas:ControlEventTriggerControlID="ImageButton1"EventName="Click"/>
</Triggers>
</atlas:UpdatePanel>
</asp:Content>

I must say that I use April CTP of Atlas and Atlas controlToolkit too.
Now i try to delete triggers section and change update panel mode to always, and the page was displayed correctly. But if I insert again triggers section the error come back.
What I can do? thanks


I also just started getting the same design time error ..

Error Creating Control - Content1
'Triggers' could not be initialized. Details: 'Triggers' could not be added to the collection. Details: Object does not match target type.

And in my specific case, I have:

And .. I've been using pages that have a very similar setup for like 2 weeks without problems like this.
Then today, I started getting the 'Error Creating Control' message when I went from Source view of the asp page to the Design view.

<asp:Content id="content1"> <atlas:UpdatePanel id="updatePanel1" runat="server" mode="Conditional"> <ContentTemplate> ... <asp:GridView ... /> ... </ContentTemplate> <Triggers> <atlas:ControlEventTrigger ControlID="button1" EventName="Click" /> <atlas:ControlValueTrigger ControlID="ddl1" PropertyName="SelectedValue" /> </Triggers> </atlas:UpdatePanel> ... <asp:Button id="button1" runat="server" Text="Huh?"> ... <asp:DropDownList id="ddl1" runat="server" /> ...</asp:Content>
Need assistance with this problem .. thanks!
Hmm .. interesting, so .. I open up the project this morning. The problem I was having yesterday isn't occurring anymore. Not much has changed from yesterday to today, other than I've added more content to the page.
I believe this is a bug with the IDE not handeling the trigger well in design mode. I have had this exact same problem and fix it by restarting VS 2005.

For some reason, the error went away for me when I hit "Save"...

if that's any help

Saturday, March 24, 2012

Trouble building the TemplateVSI template project

I am having lots of trouble building theTemplateVSI template project.

I've downloaded theAjaxControlToolkit.zip source fileand extracted to this folder (as suggested by the getting started video walkthrough) :

C:\Program Files\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\AjaxControl Toolkit

I then opened the AjaxControlToolkit.sln solution file, which display the various projects in the Solution Explorer.

In VS2005, once I right-click and "Build" TemplateVSI, I get the following "access denied" type error :

Error 1 Unable to remove directory"C:\Program Files\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\AjaxControl Toolkit\TemplateVSI\bin". Access to the path'TemplateVSI.vshost.exe' is denied.

Then I manually removed the \bin\ directory (sinceWindows won't let me remove the read-only attribute), then I got thiserror :

Error 1 Could not load file or assembly'vjslib, Version=2.0.0.0, Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The systemcannot find the file specified. C:\ProgramFiles\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\Ajax ControlToolkit\TemplateVSI\TemplateVSI.csproj 52 5 TemplateVSI

I'd like to use the control kit but I need help getting started.

Thank you,

Bob

New York

<>The video also instructs me to launch TemplateVSI.vscontent, whichattempts to install "Templates & Starter Kits" but of course thezip files the installer is looking are not in my ..\Ajax ControlToolkit\TemplateVSI folder. They are not included in the originalAjaxControlToolkit.zip file I downloaded.