Showing posts with label refresh. Show all posts
Showing posts with label refresh. Show all posts

Wednesday, March 28, 2012

Link Click refresh effect?

I got a master page and 2 content page.

the menu links are on the left content page.

How can i get refresh effect on the right content page when i click on the links on the left page?

http://code.google.com/webtoolkit/documentation/examples/kitchensink/demo.htmlHi,

one approach is to use theUpdatePaneltogether with theMultiViewcontrol.
Thanks very much,i got it.
sorry, can i get that kind of effect just click a link on the page without MultView?

eg. i put a link on the left content page. the right content page will refresh when i click the link?

Hi Joytony,

When you click the link, do you want to display a totally new page?? could you post the code you use for the links?

Greetings,

Dennis


Thanks Dennis,

This is the demo i did.

1 master page contain 2 links on it.
while i have 2 content page

~/Default2.aspx
~/Default3.aspx
How can i get the refresh effect in this model?
<%@. Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>"-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">Untitled Page"server"> "form1" runat="server"> "scriptmanager1" EnablePartialRendering="true" runat="Server" /> "up1" runat="server">

"HyperLink1" runat="server" NavigateUrl="~/Default2.aspx">HyperLink "HyperLink2" runat="server" NavigateUrl="~/Default3.aspx">HyperLink

"ContentPlaceHolder1" runat="server">

"Progress" runat="server"> Loading...

sorry, put the code again.
<form id="form1" runat="server"> <atlas:ScriptManager ID="scriptmanager1" EnablePartialRendering="true" runat="Server" /> <atlas:UpdatePanel ID="up1" runat="server"> <ContentTemplate> <div> <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/Default2.aspx">HyperLink</asp:HyperLink> <asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl="~/Default3.aspx">HyperLink</asp:HyperLink> <asp:LinkButton ID="LinkButton1" runat="server">LinkButton</asp:LinkButton> <asp:LinkButton ID="LinkButton2" runat="server">LinkButton</asp:LinkButton> </div> <div> <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server"> </asp:ContentPlaceHolder> </div> </ContentTemplate> </atlas:UpdatePanel> <atlas:UpdateProgress ID="Progress" runat="server"> <ProgressTemplate> Loading... </ProgressTemplate> </atlas:UpdateProgress> </form>

Hi JoyTony,

I don't think that its possible to open a new page in another frame without a full postback. (If this is want you want to achieve). I think that Atlas is useful when you want parts of a webpage to be updated not whole pages. I think that the suggestion above with the multiview is the only option. Is there a reason that you don't want to use multiview??

Greetings,

Dennis


Hi Again,

What is the reason that you put your buttons in the update panel? These controls shoudn't be updated right?

Regards


Hmm, it seems you're kinda misusing the concept., although I do see what you're trying to do i think. If I'm not mistaken you're trying to only get the non master portion to refresh, similar to what one would achieve using frames? If so, other than the fact that it's probably not going to work, your pages will not be picked up by search engines, which is really bad unless its an intranet site.

It would be real nice if ATLAS did solve the problem of same masterpage markup being sent back with every page though, but i guess with a well designed site that should be very minimal.

Nick


Thanks Dennis andnicksh.

The reason why i don't want to use multiple view is i've done many pages there.

I just leave it there at the moment untill we really want to change. Thanks.

List controls not refreshing in UpdatePanels

I'm trying to figure out why when I click Remove on any listbox the postback doesn't refresh the listbox to show the change. I thought that every updatepanel refreshes. If this is so, then why isn't my listbox automatically reloading the updated list after I remove an item? I end up having to refresh the whole page manually in order to see any removed items from my listboxes

<%@dotnet.itags.org. Control Language="vb" AutoEventWireup="false" CodeBehind="Main.ascx.vb" Inherits="xxxx" %>

<asp:scriptmanager id="ScriptManager1" runat="server" />

<table class="medium" border="0" cellpadding="0" cellspacing="0" width="100%">

<tr style="padding-left 5px;">

<!-- Left Content Bucket -->

<td valign="top">

<table align="left" border="0" cellpadding="0" cellspacing="2" width="100%">

<tr>

<td height="20"></td>

</tr>

<tr>

<td class="tableHdrBlack" colspan="2">

<asp:label id="GeneralInformationHeader" runat="server" />

</td>

</tr>

<tr>

<td height="10"></td>

</tr>

<tr>

<td align="right" valign="top">

<asp:label id="Program" runat="server" />

</td>

<td align="left" valign="top">

<asp:dropdownlist id="ddlPrograms" runat="server" width="300px" />

</td>

</tr>

<tr>

<td height="10"></td>

</tr>

<tr>

<td align="right" valign="top">

<asp:label id="Cuent" runat="server" />

</td>

<td align="left" valign="top">

<asp:updatepanel id="CuentUpdatePanel" runat="server">

<contenttemplate>

<asp:listbox id="lbCuent" runat="server" width="214px" /><br />

</contenttemplate>

</asp:updatepanel>

</td>

</tr>

<tr>

<td height="10"></td>

</tr>

<tr>

<td align="right" valign="top">

<asp:label id="ApdCs" runat="server" />

</td>

<asp:updatepanel id="ApdCsUpdatepanel" runat="server">

<contenttemplate>

<td align="left" valign="top">

<asp:listbox id="lbApdCs" runat="server" width="214px" /><br />

<asp:button id="btnAddApdCs" runat="server" width="63px" />

<asp:button id="btnRemoveApdCs" runat="server" width="83px" />

</td>

</tr>

<asp:panel id="pnlAddApdCs" runat="server" visible="false">

<tr>

<td>

</td>

<td>

<table>

<tr>

<td>

<asp:dropdownlist id="ddlAddApdCs" runat="server" width="90px" />

</td>

<td>

<asp:button id="btnInsertApdCs" runat="server" width="50px" />

</td>

</tr>

</table>

</td>

</tr>

</asp:panel>

</contenttemplate>

</asp:updatepanel>

<tr>

<td height="10"></td>

</tr>

<tr>

<td align="right" valign="top">

<asp:label id="FtyMang" runat="server" />

</td>

<td align="left" valign="top">

<asp:listbox id="lbFtyMang" runat="server" width="214px" />

</td>

</tr>

<tr>

<td height="10"></td>

</tr>

<tr>

<td align="right" valign="top">

<asp:label id="lHDee" runat="server" />

</td>

<td align="left" valign="top">

<asp:updatepanel id="HDee" runat="server">

<contenttemplate>

<asp:listbox id="lbHDee" runat="server" width="214px" /><br />

<asp:button id="btnAddHDee" runat="server" width="63px" />

<asp:button id="btnRemoveHDee" runat="server" width="83px" />

</contenttemplate>

</asp:updatepanel>

</td>

</tr>

<asp:panel id="pnlAddHDee" runat="server" visible="false">

<tr>

<td>

</td>

<td>

<table>

<tr>

<td>

<asp:dropdownlist id="ddlAddHDee" runat="server" width="90px" />

</td>

<td>

<asp:button id="btnInsertHDee" runat="server" width="50px" />

</td>

</tr>

</table>

</td>

</tr>

</asp:panel>

<tr>

<td height="10"></td>

</tr>

<tr>

<td align="right" valign="top">

<asp:label id="Ces" runat="server"></asp:label>

</td>

<td align="left" valign="top">

<asp:updatepanel id="CesUpdatepanel" runat="server">

<contenttemplate>

<asp:listbox id="lbCes" runat="server" width="214px" /><br />

<asp:button id="btnAddCes" runat="server" width="63px" />

<asp:button id="btnRemoveCes" runat="server" width="83px" />

</contenttemplate>

</asp:updatepanel>

</td>

</tr>

<asp:panel id="pnlAddCes" runat="server" visible="false">

<tr>

<td>

</td>

<td>

<table>

<tr>

<td>

<asp:dropdownlist id="ddlAddCes" runat="server" width="90px" />

</td>

<td>

<asp:button id="btnInsertCes" runat="server" width="50px" />

</td>

</tr>

</table>

</td>

</tr>

</asp:panel>

</table>

</td>

<td width="10px"></td>

<!-- Right Content Bucket -->

<td valign="top">

<asp:updatepanel id="FtyUpdatePanel" runat="server">

<contenttemplate>

<table align="left" border="0" cellpadding="0" cellspacing="2" width="100%">

<tr>

<td height="20"></td>

</tr>

<tr>

<td colspan="3" class="tableHdrBlack">

<asp:label id="FtyHeader" runat="server" />

</td>

</tr>

<tr>

<td height="10"></td>

</tr>

<tr>

<td align="left" valign="top" colspan="3">

<asp:label id="RealName" runat="server" />

</td>

</tr>

<tr>

<td></td>

<td align="left" colspan="3">

<table align="left" border="0" cellpadding="0" cellspacing="2">

<tr>

<td>

<asp:label id="lblFirstName" runat="server" />

</td>

<td align="left">

<asp:textbox id="FirstName" runat="server" width="150px" />

</td>

<td>

<asp:label id="lblLastName" runat="server" />

</td>

<td align="left">

<asp:textbox id="LastName" runat="server" width="150px" />

</td>

</tr>

</table>

</td>

</tr>

<tr>

<td height="10"></td>

</tr>

<tr>

<td align="left" valign="top" colspan="3">

<asp:label id="Address" runat="server" />

</td>

</tr>

<tr>

<td></td>

<td align="left" colspan="3">

<table align="left" border="0" cellpadding="0" cellspacing="2">

<tr>

<td>

<asp:label id="lblFtyStreet" runat="server"></asp:label>

</td>

<td colspan="5">

<asp:textbox id="FtyStreet" runat="server" width="340px" />

</td>

</tr>

<tr>

<td align="right">

<asp:label id="lblFtyCity" runat="server"></asp:label>

</td>

<td width="20px">

<asp:textbox id="FtyCity" runat="server" width="100px" />

</td>

<td align="right" width="20px">

<asp:label id="lblFtyState" runat="server" />

</td>

<td>

<asp:dropdownlist id="FtyStateList" runat="server" width="50px" />

</td>

<td align="right">

<asp:label id="lblFtyZip" runat="server" />

</td>

<td align="right">

<asp:textbox id="FtyZip" runat="server" width="100px" />

</td>

</tr>

</table>

</td>

</tr>

<tr>

<td height="10"></td>

</tr>

<tr align="left">

<td></td>

<td align="left" colspan="3">

<table align="left" border="0" cellpadding="0" cellspacing="2">

<tr>

<td>

<asp:label id="Phone" runat="server" />

</td>

<td>

<asp:textbox id="AreaCode" runat="server" width="53px" />

-

<asp:textbox id="Prefix" runat="server" width="58px" />

-

<asp:textbox id="Suffix" runat="server" width="68px" />

</td>

</tr>

</table>

</td>

</tr>

<tr>

<td height="10"></td>

</tr>

<tr>

<td align="left" colspan="3" valign="top">

<asp:label id="Shipping" runat="server" />

</td>

</tr>

<tr>

<td>

</td>

<td align="left" colspan="3">

<table align="left" border="0" cellpadding="0" cellspacing="2">

<tr>

<td>

<asp:label id="lblShippingStreet" runat="server" />

</td>

<td colspan="5">

<asp:textbox id="ShippingStreet" runat="server" width="340px" />

</td>

</tr>

<tr>

<td align="right">

<asp:label id="lblShippingCity" runat="server" />

</td>

<td width="20px">

<asp:textbox id="ShippingCity" runat="server" width="126px" />

</td>

<td align="right" width="20px">

<asp:label id="lblShippingState" runat="server" />

</td>

<td>

<asp:dropdownlist id="ShippingStateList" runat="server" width="50px" />

</td>

<td align="right">

<asp:label id="lblShippingZip" runat="server" />

</td>

<td align="right">

<asp:textbox id="ShippingZip" runat="server" width="100px" />

</td>

</tr>

<tr>

<td height="10">

</td>

</tr><tr>

<td>

</td>

<td align="left">

<asp:button id="btnUpdateFPenalInfo" runat="server" width="60px" />

</td>

</tr>

</table>

</td>

</tr>

<tr>

<td height="10"></td>

</tr>

<tr>

<td align="left" class="tableHdrBlack" colspan="3">

<asp:label id="CouTauder" runat="server" />

</td>

</tr>

<tr>

<td height="10"></td>

</tr>

<tr>

<td colspan="4">

<table align="left" border="0" cellpadding="0" cellspacing="2">

<tr>

<td align="right" valign="top">

<asp:label id="LastCourse" runat="server" />

</td>

<td align="left" valign="top">

<asp:label id="LatSsionValue" runat="server"/>

</td>

</tr>

<tr>

<td align="right" valign="top">

<asp:label id="LatSsion" runat="server" />

</td>

<td align="left" valign="top">

<asp:label id="LatSsionValue" runat="server" />

</td>

</tr>

<tr>

<td align="right" valign="top">

<asp:label id="MisSeions" runat="server"/>

</td>

<td align="left">

<asp:label id="MisSeionsValue" runat="server" />

</td>

</tr>

<tr>

<td height="10">

</td>

</tr>

<tr>

<td align="left" valign="top">

<asp:label id="CourTt" runat="server" />

<br />

</td>

</tr>

<tr>

<td colspan="2">

<asp:gridview id="CourTtList" runat="server" />

</td>

</tr>

</table>

</td>

</tr>

</table>

</contenttemplate>

</asp:updatepanel>

</td>

</tr>

</table>

Hello,

How do you get the data into the listbox? Try this:
for example the list box inside this updatePanel

<asp:updatepanel id="CuentUpdatePanel" runat="server">
<contenttemplate>
<asp:listbox id="lbCuent" runat="server" width="214px" /><br />
</contenttemplate>
</asp:updatepanel>

After you click Remove, for sure you have to call a function right? In that function, also call: CuentUpdatePanel.Update()
This will update the UpdatePanel ... and if your list box uses a ObjectDataSource ... example below

<asp:updatepanel id="CuentUpdatePanel" runat="server">
<contenttemplate>
<asp:listbox id="lbCuent" runat="server" DataSourceID="GetListITems" width="214px" /><br />
</contenttemplate>
</asp:updatepanel>

then in your function, you do this: lbCuent.Databind();

Hope it helps ... by the way, next time don't bother post all of your HTML in here, too much, waste your time. =) just the part that you have problem is enough already ... and the code behind that is related to it ... Cheers


The problem is that I didn't rebind my listbox after whatever event (insert, delete, etc.)


I didn't even have to call the .Update() manually, it all works fine now after the obvious missing rebind of my listbox controls

Monday, March 26, 2012

ListView Chunky Refresh -- Bug or Feature?

Currently the ListView re-renders itself in chunks of 5 items. Meaning that if you had a ten items in your list the control would be rendered twice: once after 5 items and again after 10. This is hard-coded in Atlas.js on line 10271. (see code below.)

Right now I am using the ListView to generate an html table and the refresh is rather clunky and unattractive. I would rather have the entire table refreshed in one go. Does anyone have any suggestions?

// Atlas.js:10271
// note the hardcoded "5"
var lastElementToRender = Math.min(itemLength, _currentIndex + 5);
for (; _currentIndex < lastElementToRender; _currentIndex++) {
var item = _data.getItem(_currentIndex);
// items added to DOM, then rendered
}

Nick Schrock

CareEvolution RHIO Technology PlatformCareEvolution

hello.

i've noticed that too. open a request and ask for a property which let's you influence the number of items that are to be generated,,,

Saturday, March 24, 2012

Load in-line javascript functions after UpdatePanel refresh

I have a lot of user controls that have in-line javascript functions specific to the content of the user control, validations and automated reactions. This javascript is written mostly by client side developers. Is there any way to allow them to keep writting their in-line javascript on the user controls, but still have that javascript be active after an updatepanel conditionally makes the user control visible? For example imagine a page with a button and the user control. The user control is in an update panel tiggered by the button click. When clicked the user control has its visibility set to true and the user interacts with the newly visible controls contained within. Because the user control was initially in an update panel, the original page source does not contain the in-line javascript functions so they are never evaluated by the browser. In order to keep the client side group's functionali i've had to recreate the client side code on the server side by building a large string that references controls using the control.ClientID property (just like the client side group does with inline scriplets $get(<%= control.ClientId %>) and then registering this string on the page with ScriptManager. This is too inefficient a process and having the javascript placed on every page that uses the user control seems counter productive with regard to user controls. Placing all the javascript in external files that get loaded by ScriptManager is also not an option as the javascript is often control specfic. Is there no way to get the browser to recognise the in-line javascript after an update panel loads it? Is this something that is planned for the future if not?

Well, I don't know if it is the final solution, but I figured that I could use display:none and display:block on a panel wrapping the user control instead of using the Visible property on the control itself. This way the control (and most importantly the javascript) is initially rendered, but not browser visible. If there is still some way to use the built in Visible property to do what I want, please let me know. I like that the inital page load using the Visible property doesn't have the extra weight of controls that are not usuable.


You can give this approach a try:http://blogs.msdn.com/sburke/archive/2007/06/13/how-to-make-tab-control-panels-load-on-demand.aspx

-Damien


I believe that approach will suffer from the same issue. The tabcontainer content will not be initially visible and so any inline javascript contained in a tabcontainer will not be evaluated by the browser.


Sorry about that I miss read your question. If the JS is embedded in the usercontrols they need to be loaded, so your solution works. I'm a bit confused why you need the JS loaded if they are control specific. Sounds like there may be a design problem with your solution.

-Damien

load page without refresh

at first excuse me if my english is bad

i need load pages without refresh page

for example in page a i click link (page b) now i want load page b without refresh page

You would want to use iframes or have user controls for every page. I have not used either, but saw various posts about doing that. It ends up getting very hacky though so we avoid that.