Showing posts with label masterpage. Show all posts
Showing posts with label masterpage. Show all posts

Wednesday, March 28, 2012

UpdateMode Conditional updates always

Hi everybody. Using MasterPage with ContentPaceholders that contains UserControls, UpdatePanels wich are all assigned an UpdateMode to conditional and some ModalPopUp extenders.

When any trigger is fired all the UpdatePanels are refreshed.

I'm I doing something wrong. Thanks in advance

I was wrong. It updates only with update method, but, always loads page and controls. Is it possible to avoid in a simple manner.

I was wrong. It updates only with update method, but, always loads page and controls.

Is it possible to avoid in a simple manner?


I also have the same problem...

any body have any idea to solve this problem???


Hey I got the solution for this problem !!!!

Set RenderMode Property of UpdatePanel to "Inline" for each UpdatePanel on page.

Also assign TargetPanelID for each UpdateProgress on page.

Cheers ,

Shekhar


Hello, this didn't help. Do I need to set "Conditional" update mode to the panels?Also, TargetControlID, not TargetPanelID I suppose, right?

UpdateMode = Conditional still refreshes!

I have a web application project running Atlas, now Ajax, with a masterpage where I have a scriptmanager.On the default page I have a scriptmanagerproxy and some usercontrols. these have updatepanels inside of them, all with updatemode=conditional and triggers for ONE button to make them refresh.

No matter which button I press, the updatepanel refreshes. It doesn't really flicker, the problem is that it refreshes the content. I've tried removing everything, I've even tried with a new website project, and with and without masterpages, no matter the result is the same.

Can someone please explain this to me? I use the web_ctp.config and run on win 2003 server. please let me know what code you require, though the very basics aren't even working, I don't see the point of posting any now.

Solution found here...

http://forums.asp.net/thread/1239062.aspx

Monday, March 26, 2012

Updatepanel / Client-Script problem

Hello,
I have a problemL
on my ContentPage(Masterpage/Contentpage-Concept) I have an Updatepanel with a couple of Controls on it. One Button of this Controls generate a Word-Document und download it to the Client. My Solution for this was in the earlier Version:
In the Click-Event on server side I registered 2 Client-Scripts.

sMsg =" function Timer(){ if (confirm(""" & sMsg &""") == true){ document.getElementById(""ctl00_CP1_MsgBox"").click();}}"

Page.ClientScript.RegisterStartupScript(Me.GetType,"msg", sMsg,True)

Page.ClientScript.RegisterClientScriptBlock(Me.GetType,"Timer"," window.setTimeout('Timer()', 50)",True)

This Scripts trigger an ClickEvent on a Button outside an Updatepanel and in his Eventhandler I create the Word-Document and send it to the Client. This works fine but now with the new CTP it doesn’t work. I try different Things

(register the Script on Sriptmanager

Dim SRefAsNew Microsoft.Web.UI.ScriptReference

SRef.Path ="~/Scripts/Script.js"

SRef.ScriptMode = Microsoft.Web.UI.ScriptMode.Auto

SMProxy.Scripts.Add(SRef)

or use the PostBackTrigger instead of an AsyncPostBackTrigger

<asp:PostBackTriggercontrolid="btnEditReport"/>

. But still don’t work. The Timer-Script starts and call the function Timer() but the Control-Reference points to NULL.

The option to put the Button outside an UpdatePanel it’s not really the Solution for me, then I use the same Concept for Messageboxes. And these also don’t work with the new CTP

now…I hung…any Solutions?

Thanks.

You now have to register your client scripts through the ScriptManager control (they have static methods that mimic ClientScript). Unfortunately, as I've found - this has a lot of backwards compat issues as well as ordering, ie registering arrays & script includes will render the arrays prior to script includes - which is different than the asp.net way.

Wednesday, March 21, 2012

UpdatePanel and Literal with IE 7 and Firefox

Hi,

I would use AJAX extensions for Visual Studio .NET 2.0 to enhance my website.

I created a MasterPage with 3 contentPlaceHolders, one column on the left for menus, one else on the top for title and one in the middle for the main content. In the the middle ContentPlaceHolder I put an UpdatePanel to refresh only this part of my website. In the UpdatePanel there is a Literal and I try to update the "text" property when the user click on the LinkButtons of the menu. The aim is to load external pages in the middle part as embedded objects without refresh or reload the whole page.

I have got two problems:

1. the whole page is reloaded when I click the first on any LinkButton, but the content of the update panel is well loaded.

2. when I click the second time on an other LinkButton, I've got this error (In French...)

Argument de publication ou de rappel non valide. La validation d'événement est activée via <pages enableEventValidation="true"/> dans la configuration ou via <%@dotnet.itags.org. Page EnableEventValidation="true" %> dans une page. Pour des raisons de sécurité, cette fonctionnalité vérifie si les arguments des événements de publication ou de rappel proviennent du contr?le serveur qui les a rendus à l'origine. Si les données sont valides et attendues, utilisez la méthode ClientScriptManager.RegisterForEventValidation afin d'inscrire les données de publication ou de rappel pour la validation

I tried to find the term "Page EnableEventValidation="true" " in my project but with no success.

But more strange, it works fine on Firefox 2.0. Only the middle part of the page is reloaded, and I've got no error on the second click.

And it is true when I try the tutorials: i.e. the Calendar tutorial, with IE 7 the whole page is reloaded but with Firefox only the UpdatePanel part is reloaded.

Here my code for the UpdatePanel

<div id="M_principal" style="left: 20%; position: absolute; top: 150px; background-color: #ffffcc; width: 80%; height:100%; vertical-align: middle;">

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="LinkButton1" EventName="Click" />
<asp:AsyncPostBackTrigger ControlID="LinkButton2" EventName="Click" />
</Triggers>
<ContentTemplate>
<asp:Literal ID="Literal1" runat="server"></asp:Literal>
</ContentTemplate>
</asp:UpdatePanel>
</div>

CodeBehind (C#) :

protected void LinkButton1_Click(object sender, EventArgs e)

{
Literal1.Text = "<object type=\"text/html\" data=\"Page1.aspx?.html\" width=\"1000\" height=\"800\">";
}

protected void LinkButton2_Click(object sender, EventArgs e)
{
Literal1.Text = "<object type=\"text/html\" data=\"Page2.aspx?.html\" width=\"1000\" height=\"800\">";
}

If somebody have an idea to solve this problem...

Thanks.

EventValidation: Go to the @.Page directive at the top of the aspx-file (Source-view).

At the end of the directive, add

EnableEventValidation="false"