I have atlas update panel with mode=conditional which means that it should refresh the gridView only when trigger is fired.
I create a trigger which fires when selectedValue is changed on dropdownlist.
But gridView is refreshed only first time, when dropDownList is changed. All other changes in dropDown - gridView remains the same. AnyBody know why?
If I change Mode to always than gridView is refreshed on every dropDown change.
Here is the example:
<
asp:DropDownListID="DropDownList2"runat="server"AutoPostBack="True"><asp:ListItemValue="False">Active</asp:ListItem><asp:ListItemValue="True">Completed</asp:ListItem></asp:DropDownList><
atlas:UpdatePanelID="p1"runat="server"Mode="Conditional"><ContentTemplate><asp:GridViewID="GridView1"CssClass="gridView"AlternatingRowStyle-CssClass="even"GridLines="None"runat="server"AllowPaging="True"AllowSorting="True"AutoGenerateColumns="False"DataKeyNames="taskID"DataSourceID="ObjectDataSource1"><Columns><asp:CommandFieldShowEditButton="True"/><asp:BoundFieldDataField="name"HeaderText="name"SortExpression="name"/><asp:CheckBoxFieldDataField="complete"HeaderText="complete"SortExpression="complete"/></Columns><AlternatingRowStyleCssClass="even"/></asp:GridView></ContentTemplate><Triggers><atlas:ControlValueTriggerControlID="DropDownList2"PropertyName="SelectedValue"/></Triggers></atlas:UpdatePanel>
Regards,S
hello.
does this page work there:
<%@. Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<asp:DropDownList runat="server" id="drop" AutoPostBack="true">
<asp:ListItem Text="True" />
<asp:ListItem Text="False" />
</asp:DropDownList>
<atlas:ScriptManager runat="server" id="manager" EnablePartialRendering="true" />
<atlas:UpdatePanel runat="server" ID="panel">
<ContentTemplate>
<%=DateTime.Now.ToString() %>
</ContentTemplate>
<Triggers>
<atlas:ControlEventTrigger ControlID="drop" EventName="SelectedIndexChanged" />
</Triggers>
</atlas:UpdatePanel>
</form>
</body>
</html>
Hello,
yes, your example works.
In fact if I change value trigger with event trigger then my example also works.
Replace:
<atlas:ControlValueTrigger ControlID="DropDownList2" PropertyName="SelectedIndex" />
with
<atlas:ControlEventTrigger ControlID="DropDownList2" EventName="SelectedIndexChanged" />
What is wrong with ControlValueTrigger? I found this example at your page from video demonstration.
Regards,Simon
hello.
i think that replacing the controleventtrigger with the controlvaluetrigger still works in the code i've posted previouslly...doesn't it tun there when you use that trigger?
If I use your example with:
<atlas:ControlValueTrigger ControlID="drop" PropertyName="SelectedValue"/>
OR
<atlas:ControlValueTrigger ControlID="drop" PropertyName="SelectedIndex" />
It works only when selectedValue is not True, so, when you not select first option.
So, it refresh time every second attempt.
If you add more options into your example:
<asp:ListItem Text="True"/>
<asp:ListItem Text="False"/>
<asp:ListItem Text="Test"/>
<asp:ListItem Text="Test1" />
it works for all other options too, only if selectedIndex>0(if selectedValue<>"True").
Why?
Thanks,Simon
hello again.
are you saying that changing from true to false causes a partial postback but changing from false to true doesn't? that's not what i'm seeing here...btw, i've used this:
<atlas:ControlValueTrigger ControlID="drop" PropertyName="SelectedIndex" />
Yes, that is exactly what is happening.
First I change value to false and partial postback is happened.
Then I change value to True, no partial postback.
Then I change value to false, partial postback is happened.
Then I change value to True, no partial postback.
and so on...
Every change of dropdown to first choice(selectedIndex=0) creates no postback.
My code is exactly the same as yours.I copied it from here.
No master page, no any other code.
I install atlassetup.msi from
http://www.microsoft.com/downloads/details.aspx?FamilyId=B01DC501-B3C1-4EC0-93F0-7DAC68D2F787&displaylang=en
and create empty atlas web project.
Create test page and put your script into it.
Any idea? I can send you my web.cofig file and my page if you want.
Regards,Simon
hello again.
just to be sure, here's the code i'm running:
<%@. Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<asp:DropDownList runat="server" id="drop" AutoPostBack="true">
<asp:ListItem Text="True" />
<asp:ListItem Text="False" />
</asp:DropDownList>
<atlas:ScriptManager runat="server" id="manager" EnablePartialRendering="true" />
<atlas:UpdatePanel runat="server" ID="panel">
<ContentTemplate>
<%=DateTime.Now.ToString() %>
</ContentTemplate>
<Triggers>
<atlas:ControlValueTrigger ControlID="drop" PropertyName="SelectedIndex" />
</Triggers>
</atlas:UpdatePanel>
<%=DateTime.Now.ToString() %>
</form>
</body>
</html>
Hello,
well my code is exact the same only that I use code behind.
So, only difference is top most line:
<%@.PageLanguage="C#"AutoEventWireup="true"CodeFile="test.aspx.cs"Inherits="test" %>
Do you know, how to include atlas into existing web application? Set references to atlas.dll and what else?
When creating new web site it's simple, just select atlas web site.
Regards,Simon
hello.
well, normally you must also add some entries on the web.config. if you look at the your atlas installation path, you'll find a web.config file that has the necessary entries. copying those entries to your web.config should be enough. you might also need to configure IIS if you're using bridges and you have not installed atlas msi on the server that is hosting your app.
No comments:
Post a Comment