List Info

Thread: TreeView without PostBack?




TreeView without PostBack?
user name
2006-04-19 01:00:36
I don't think there is anyway to pre-select something prior
to doing a
postback.  Selecting a node in the tree will cause a
postback
immediately. 

One option you could use, though, would be to embed the
control within
an <atlas:updatepanel>, which would avoid you
refreshing the entire
page.  You could then use an Ajax based selection model to
get a
smoother client experience.

Hope this helps,

Scott

-----Original Message-----
From: Discussion of building .NET applications targeted for
the Web
[mailtoOTNET-WE
BDISCUSS.DEVELOP.COM] On Behalf Of Shawn Wildermuth
Sent: Tuesday, April 18, 2006 5:20 PM
To: DOTNET-WEBDISCUSS.DEVELOP.COM
Subject: [DOTNET-WEB] TreeView without PostBack?

I thought I wanted was simple.  I want to use a TreeView as
a selection
control, but only to select a single leaf node in a
hierarchy.  So after
searching google, I thought this would work:

<asp:TreeView runat=server id=foo AutoPostBack=false
/>

But to no avail.  AutoPostBack is no longer a property. 
Anyone know
why?

I want certain nodes to be 'selectable', but I want the
control to hold
hte
selection state so I can get it when I postback an entire
form, not
postback
immediately (even if it just flickers the user screen).  Is
this
possible?
I have *no* events (server or clientside) registered so I
have no idea
why
its posting back anyway.  I've tried a couple of different
hacks:

1.      Set the SelectAction to None (but this removes the
ability to
select)

2.      Set the NaviateUrl to javascript:none(0), but the
postbacks
still
happen (and the link inlcudes the postback).

TIA



Thanks,

Shawn Wildermuth
 <blocked::http://adoguy.com/> http://adoguy.com
C# MVP, MCSD.NET, Author and Speaker



===================================
This list is hosted by DevelopMentor(r)  http://www.develop.com

View archives and manage your subscription(s) at
http://discuss.develop.com


===================================
This list is hosted by DevelopMentorŪ  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

TreeView without PostBack?
user name
2006-04-19 01:07:13
That's unfortunate.  I am handing this code off to a
less-experienced set of
developers that I don't want to introduce too many new
concepts (e.g. Ajax),
otherwise that might be ok.  I have to say I am not
completely sure of what
you say.  For example, before the post-back the item gets
'visually'
selected (e.g. the Selected style is applied).  I know of
one user that
right before then rendered the control, when and stripped
all the
"__dopostback" stuff, but that's too much of a
hack, even for me ;)

It seems to me that two things are at odds here:

- It's a navigation control normally, so having to do a
postback just to
hyperlink somewhere seems wasteful, but perhaps that's not
what is
happening.  I wish that setting the NavigateUrl with a blank
Target would
avoid posting back entirely (in the navigation situation).
- THere are times when using the control as a data gathering
tool would be
very useful (I know the checkboxes are meant to do that, but
the JavaScript
required to keep one and only one checkbox from ever being
selected is
painful too).

For 3.0, I'd love to put in a suggestion that expanded on
the TreeView
concepts a bit.

Thanks,

Shawn Wildermuth
http://adoguy.com
C# MVP, MCSD.NET, Author and Speaker


-----Original Message-----
From: Discussion of building .NET applications targeted for
the Web
[mailtoOTNET-WE
BDISCUSS.DEVELOP.COM] On Behalf Of Scott Guthrie
Sent: Tuesday, April 18, 2006 9:01 PM
To: DOTNET-WEBDISCUSS.DEVELOP.COM
Subject: Re: [DOTNET-WEB] TreeView without PostBack?

I don't think there is anyway to pre-select something prior
to doing a
postback.  Selecting a node in the tree will cause a
postback immediately.

One option you could use, though, would be to embed the
control within an
<atlas:updatepanel>, which would avoid you refreshing
the entire page.  You
could then use an Ajax based selection model to get a
smoother client
experience.

Hope this helps,

Scott

-----Original Message-----
From: Discussion of building .NET applications targeted for
the Web
[mailtoOTNET-WE
BDISCUSS.DEVELOP.COM] On Behalf Of Shawn Wildermuth
Sent: Tuesday, April 18, 2006 5:20 PM
To: DOTNET-WEBDISCUSS.DEVELOP.COM
Subject: [DOTNET-WEB] TreeView without PostBack?

I thought I wanted was simple.  I want to use a TreeView as
a selection
control, but only to select a single leaf node in a
hierarchy.  So after
searching google, I thought this would work:

<asp:TreeView runat=server id=foo AutoPostBack=false
/>

But to no avail.  AutoPostBack is no longer a property. 
Anyone know why?

I want certain nodes to be 'selectable', but I want the
control to hold hte
selection state so I can get it when I postback an entire
form, not postback
immediately (even if it just flickers the user screen).  Is
this possible?
I have *no* events (server or clientside) registered so I
have no idea why
its posting back anyway.  I've tried a couple of different
hacks:

1.      Set the SelectAction to None (but this removes the
ability to
select)

2.      Set the NaviateUrl to javascript:none(0), but the
postbacks
still
happen (and the link inlcudes the postback).

TIA



Thanks,

Shawn Wildermuth
 <blocked::http://adoguy.com/> http://adoguy.com C# MVP,
MCSD.NET, Author
and Speaker



===================================
This list is hosted by DevelopMentor(r)  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com


===================================
This list is hosted by DevelopMentor.  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com


===================================
This list is hosted by DevelopMentorŪ  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

TreeView without PostBack?
user name
2006-04-22 19:09:46
Hi ,
Could someone give a hint about which trigger to use for
treeview
SelectedNodeChanged event if we used Atlas framework as
Scott
suggested?

I have been unsuccessful while trying to update some text
box with the
treeviews selected node's value.I have tried Click,
SelectedNodeChanged, NodeChanged in
<atlas:ControlEventTrigger
ControlID="TreeView1"
EventName="??????"/>.

I get the error
The EventName must be set to a valid event name on the
associated control.


source code
<atlas:UpdatePanel ID="first"
runat="server">
            <Triggers>
                <atlas:ControlEventTrigger
ControlID="btnYolla"
EventName="Click" />
                <atlas:ControlEventTrigger
ControlID="TreeView1"
EventName="??????"/>
            </Triggers>
            <ContentTemplate>
                <table>
                    <tr>
                        <td>
                            <asp:TextBox
ID="txtAd" runat="server"
Text="5" /></td>
                        <td>
                            <asp:Button
ID="btnYolla" runat="server"
Text="yolla"
OnClick="btnYolla_Onclick" /></td>
                    </tr>
                    <tr>
                        <td>
                            <asp:TreeView
ID="TreeView1"
runat="server"
OnSelectedNodeChanged="Treeview1_OnSelectedNodeChanged
">
                                <Nodes>
                                    <asp:TreeNode
Text="New Node1"
Value="New Node1"></asp:TreeNode>
                                    <asp:TreeNode
Text="New Node2"
Value="New Node2"></asp:TreeNode>
                                </Nodes>
                            </asp:TreeView>
                        </td>
                    </tr>
                </table>
            </ContentTemplate>
        </atlas:UpdatePanel>

On 4/19/06, Scott Guthrie <scottgumicrosoft.com> wrote:
> I don't think there is anyway to pre-select something
prior to doing a
> postback.  Selecting a node in the tree will cause a
postback
> immediately.
>
> One option you could use, though, would be to embed the
control within
> an <atlas:updatepanel>, which would avoid you
refreshing the entire
> page.  You could then use an Ajax based selection model
to get a
> smoother client experience.
>
> Hope this helps,
>
> Scott
>
> -----Original Message-----
> From: Discussion of building .NET applications targeted
for the Web
> [mailtoOTNET-WE
BDISCUSS.DEVELOP.COM] On Behalf Of Shawn Wildermuth
> Sent: Tuesday, April 18, 2006 5:20 PM
> To: DOTNET-WEBDISCUSS.DEVELOP.COM
> Subject: [DOTNET-WEB] TreeView without PostBack?
>
> I thought I wanted was simple.  I want to use a
TreeView as a selection
> control, but only to select a single leaf node in a
hierarchy.  So after
> searching google, I thought this would work:
>
> <asp:TreeView runat=server id=foo AutoPostBack=false
/>
>
> But to no avail.  AutoPostBack is no longer a property.
 Anyone know
> why?
>
> I want certain nodes to be 'selectable', but I want
the control to hold
> hte
> selection state so I can get it when I postback an
entire form, not
> postback
> immediately (even if it just flickers the user screen).
 Is this
> possible?
> I have *no* events (server or clientside) registered so
I have no idea
> why
> its posting back anyway.  I've tried a couple of
different hacks:
>
> 1.      Set the SelectAction to None (but this removes
the ability to
> select)
>
> 2.      Set the NaviateUrl to javascript:none(0), but
the postbacks
> still
> happen (and the link inlcudes the postback).
>
> TIA
>
>
>
> Thanks,
>
> Shawn Wildermuth
>  <blocked::http://adoguy.com/> http://adoguy.com
> C# MVP, MCSD.NET, Author and Speaker
>
>
>
> ===================================
> This list is hosted by DevelopMentor(r)  http://www.develop.com
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com

>
> ===================================
> This list is hosted by DevelopMentor(r)  http://www.develop.com
>
> View archives and manage your subscription(s) at http://discuss.develop.com

>


--
Devrim Baris Acar
Software Develeper
http://www.barisacar.com

===================================
This list is hosted by DevelopMentorŪ  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

TreeView without PostBack?
user name
2006-04-23 07:01:30
You don't need the <Triggers> section at all. Since
the control that's
throwing the events is inside the update panel, it
automatically causes
partial rendering. Make sure you have partial rendering
enabled on your
<atlas:ScriptManager>.

On 4/22/06, Baris Acar <devrimbarisgmail.com> wrote:
>
> Hi ,
> Could someone give a hint about which trigger to use
for treeview
> SelectedNodeChanged event if we used Atlas framework as
Scott
> suggested?
>
Calendar Control alternatives
user name
2006-04-23 18:22:43
Does anyone know of any good alternatives to the calendar
control?  The
time taken by the postback really irritates my customers,
but Id just as
soon not roll my own solution with ddlb's, etc.
Thanks, Mark

--
====================
Mark Aurit
MarkAuritgmail.com

===================================
This list is hosted by DevelopMentorŪ  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

[1-5]

about | contact  Other archives ( Real Estate discussion Medical topics )