Showing posts with label updatepanel. Show all posts
Showing posts with label updatepanel. Show all posts

Wednesday, March 28, 2012

postback happens even when validators show error

Hi,

I am using updatepanel in my code. I give a picture of a part of my code.

Now i have a text box with some validators on it ( required field validator and regular expression validator).

I have a save button which saves the content of the text box .

The textbox is withing the update panel and the save button is outside the update panel.

Now when a wrong iput is entered , on tab out the validator shows the error messgae but on clicking th ebutton , a post back happens. in general case where a update panel is not used the button postback event doesnt happen until the validators return true.

Could you help me on this.

Regards,

Sama

any resolution to this problem yet?

this really needs to be fixed


I also have come across this problem. I have three validators on the footer row of a gridview which is in an UpdatePanel. I use the footer for insertion of new records. When I click 'Insert', the validators fire ok and I get the red asterisks and all but it still posts back. When I take the whole thing out of the UpdatePanel it works as it's supposed to, preventing the postback if no data is entered.

I am using the latest version of Atlas.

Has anyone a solution to this and is it going to be fixed in a future ctp?

Regards,

Andy.


I just investigated further and found the following strage behaviour:

When my page first loads, the gridview is populated with data. The footer is not visible on the gridview as I set ShowFooter() to false by default. There is a button at the bottom of the page "Add Item". This posts back and sets the ShowFooter() to true so that the insert line appears. In this scenario, when the user leaves the new text fields blank, the validator fires but the page still posts back - WRONG.

If I show the footer by default when the page loads, the validators fire correctly and prevent the postback - CORRECT.

Can anyone shed any light on this, I don't want to have my insert line shown by default.

Andy.


bump...

Postback issue

In my page, there are a lots of toolkit controls and gridvidw. Sometime when I postpack partially inside a UpdatePanel, I got the following message in a popup message box:

Invaid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <% Page EnableEventValidation="true" %> in page. For security purposes,this fuature verifies that arguments to postbalc or callback events originate from the server control that orginally rendered them. If the data is valid and expected, use the ClientScriptManager.RegiterForEventValidation method in order to register the postback or callback data for validation.

For example, in gridview with paging, when I click on page numnber, sometimes the above message will come out. It comes out randomly. If I refresh the page, it will fix this issue.

How to solve this issue?

The pics you posted are not visible.

A potentially dangerous Request.Form value was detected from the client (ctl00$ctl00$ctl00$ctlToAdd1$ctl00$ctlHeaderFooter$ctl00$txtPageHeader="<p>DO NOT ATTEMPT TH...").

Description: Request Validation has detected a potentially dangerous client input value, and processing of the request has been aborted. This value may indicate an attempt to compromise the security of your application, such as a cross-site scripting attack. You can disable request validation by setting validateRequest=false in the Page directive or in the configuration section. However, it is strongly recommended that your application explicitly check all inputs in this case.

Exception Details:System.Web.HttpRequestValidationException: A potentially dangerous Request.Form value was detected from the client (ctl00$ctl00$ctl00$ctlToAdd1$ctl00$ctlHeaderFooter$ctl00$txtPageHeader="<p>DO NOT ATTEMPT TH...").

Source Error:

[No relevant source lines]


Source File:c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\siteseasytest\b32181f7\172c3a32\App_Web_yzjzpobg.2.cs Line:0

Stack Trace:

[HttpRequestValidationException (0x80004005): A potentially dangerous Request.Form value was detected from the client (ctl00$ctl00$ctl00$ctlToAdd1$ctl00$ctlHeaderFooter$ctl00$txtPageHeader="<p>DO NOT ATTEMPT TH...").]

System.Web.HttpRequest.ValidateString(String s, String valueName, String collectionName) +3219550

System.Web.HttpRequest.ValidateNameValueCollection(NameValueCollection nvc, String collectionName) +108

System.Web.HttpRequest.get_Form() +119

System.Web.HttpRequest.get_HasForm() +57

System.Web.UI.Page.GetCollectionBasedOnMethod(Boolean dontReturnNull) +2025201

System.Web.UI.Page.DeterminePostBackMode() +60

System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6953

System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +154

System.Web.UI.Page.ProcessRequest() +86

System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +18

System.Web.UI.Page.ProcessRequest(HttpContext context) +49

ASP.communitydefault_aspx.ProcessRequest(HttpContext context) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\siteseasytest\b32181f7\172c3a32\App_Web_yzjzpobg.2.cs:0

System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +154

System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64


Jason, If you are using code behind to control what gets added to a PlaceHolder for instance...

In ATLAS - we simply issued the

UpdatePanelModal.Update();

Because viewstate would get mucked up. (Article on my blog about this)

In Beta - I find that anytime you issue that command - it causes the error ... I think when mode is conditional - it works but not sure - as I am being forced to use always due to databound controls dissapearing on a modal popup and have not heard any feedback on the issue...

If you are not using code behind to handle - can you post a simple code example that demonstrates the issue?


Jason, I have written down the message text in message box. Forget the pic.


jodywbcb, what's your post for my question?

postback outside updatepanel

Hello,

I have a label outside an updatepanel which i would like to update at the same time as the updatepanel.

So is there a way to do that without placing the label inside another updatepanel?

Any suggestion?

I think you cant do it unless u change 'EnablePartialRendering' property of your script manager to 'false'. which means refresh the whole page not just the update panel.


It is not possible, you have wrap the label in an update panel and set the update mode to always.

postbacktrigger

Greetings,

what is the benefit of the postbacktrigger within the updatepanel if it makes a a full postback?

since the updatepanel is specific for asynchronous postback!!!!

your help is highly appreciated

best regards.

Some controls aren't supported in update panels, so you may want to do a full postback if something happens that will cause that control to change. We had to do this with the report viewer..


PostBackTrigger control to enable controls inside anUpdatePanel to cause a postback instead of performing an asynchronous postback.

http://asp.net/AJAX/Documentation/Live/mref/T_System_Web_UI_PostBackTrigger.aspx


Thank you for the support.

so if some some controls needs to cause a full postback within updatepanel so what is the benefit in this case to use the updatepanel??

your help is highly appreciated

Best regards.


At one point a lot of the controls that aren't supported in update panels did work inside update panels, but as of the Beta releases, the update panels were changed, so it may have been to ease the transition for people who had been using previous version...as we had been doing..

There may also be some cases that other content in the update panel can be refreshed asynchronously, although it has been a while since I have worked a lot with the controls that aren't supported.


Thank you for the support

But i don't understand exactly what you say ,so you can give more details??

your help is highly appreciated

Best regards.


There were CTP releases generally monthly that were public a little over 6 months before the first Beta release. Around the second of the CTPs, the releases started to have good support in the forums and documentation, and the releases were able to be used in production websites. When Beta 1 came out, the asyncpostback changed with update panels. Upgrading to the Beta releases could take a lot of time because of the change. Most of our major issues were solved by using a different control. We ended up using the full post back in a web application we had, which was a very large page of about 5000 lines of code for the aspx and cs files. There were three different versions of that page, which all have nested update panels. In a couple of the nested panels we needed to have report viewers. All this was also live at the time that Beta 1 came out, and many different users were already used to the system, so we couldn't change it too much. Using the full postback trigger allowed us to have a button to make the report viewer visible while allowing everything else on the page to still update asynchronously.

Hopefully that helps.

Postbacktrigger problem

I am creating a vb.net/asp.net 2005 app using a tabcontrol and I am trying to use a button inside the updatepanel and inside the tab and I am using the following syntax:

<CODE>

<asp:UpdatePanelID="pnlTest"runat="server"RenderMode="Inline"UpdateMode="Conditional">

<Triggers>

<asp:AsyncPostBackTriggerControlID="TabContainer1"EventName="ActiveTabChanged"/>

<asp:PostBackTriggerControlID="btnPreview"/>

</Triggers>

<ContentTemplate>

....everything else here...tab control...

</ContentTemplate>

</CODE>

But I keep getting an error as follows:

<ERROR>

A control with ID 'btnPreview' could not be found for the trigger in UpdatePanel 'pnlTest'.

Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:System.InvalidOperationException: A control with ID 'btnPreview' could not be found for the trigger in UpdatePanel 'pnlTest'.

</ERROR>

I am very confused because I know the control is there and when I go to the vb code-behind I am able to see the code in the dropdownlist that contains all controls for the aspx page. Does anyone have an idea what I'm doing wrong? thanks

Since your button is in the UpdatePanel you do not need to create trigger for it.


Hi Myroncope,

Here is my sample code which was written in c#. It has been tested and works fine. If you install a tool named "Web Development helper", maybe an error dialog will be sent to you, don't mention it.Press continue!

<%@. Page Language="C#" AutoEventWireup="true" CodeFile="UpdatePanelTest2.aspx.cs" Inherits="UpdatePanelTest2" %><%@. Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %><!DOCTYPE html PUBLIC "-//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"><head runat="server"> <title>Untitled Page</title></head><body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:UpdatePanel ID="UpdatePanel1" runat="server" RenderMode="Inline" UpdateMode="Conditional"> <Triggers> <asp:AsyncPostBackTrigger ControlID="TabContainer1" EventName="ActiveTabChanged" /> <asp:PostBackTrigger ControlID="btnPreview" /> </Triggers> <ContentTemplate><%=DateTime.Now.ToString()%> <cc1:TabContainer ID="TabContainer1" runat="server" OnActiveTabChanged="TabContainer1_ActiveTabChanged" AutoPostBack="True" > <cc1:TabPanel ID="TabPanel1" runat="server" > <HeaderTemplate> 1111</HeaderTemplate> <ContentTemplate><%=DateTime.Now.ToString()%></ContentTemplate> </cc1:TabPanel> <cc1:TabPanel ID="TabPanel2" runat="server"> <HeaderTemplate> 2222</HeaderTemplate> <ContentTemplate><%=DateTime.Now.ToString("yyyy-MM-dd")%></ContentTemplate> </cc1:TabPanel> </cc1:TabContainer>  <asp:Button ID="btnPreview" runat="server" Text="btnPreview" /> </ContentTemplate> </asp:UpdatePanel> </form></body></html>
 By the way, my AJAX Control Toolkit version is 10618. If an error occured while you execute the code above. Suggest you check your AJAX Control Toolkit version.
If the error information still exist, please let me know.

MyronCope:

I am very confused because I know the control is there and when I go to the vb code-behind I am able to see the code in the dropdownlist that contains all controls for the aspx page. Does anyone have an idea what I'm doing wrong? thanks

Are btnPreview visible?

You could also try to use the ClientID or UniqueID value of btnPreview for postbacktrigger's ControlID attribute. Maybe one of them works.

And finally you could also tryRegisterPostBackControl(Control) method of scriptmanager in code-behind.


Hi, MyronCope

You can add an invisible button out of the updatePanel,set the invisible button as aPostBackTrigger of theUpdatePanel.

Then on the client-side click event of the 'btnPreview', trigger the click event of that invisible button.

<div style="visibility:hidden"><asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" UseSubmitBehavior="false" /></div>

<input type="button" onclick="javascript:document.getElementById('Button1').click();" name="Button1" value="Button" id="
'btnPreview'" /></div>

The same solution solved all of this kind issue!

Check the following links:

http://forums.asp.net/t/1116956.aspx

http://forums.asp.net/t/1117770.aspx

http://forums.asp.net/t/1115934.aspx

http://forums.asp.net/t/1116851.aspx

Hope this helps.

Let me know if you need more info.

Monday, March 26, 2012

Preserving focus on UpdatePanel update

Hello, ?I would like to be able to update an UpdatePanel?on?one?part?of?the?screen?while?users?are?writing?into?a?textbox?on?another?part?of?the?screen.

When I do that now, the textbox in which the user is entering text loses focus whenever UpdatePanel updates (once every 5 seconds on account of a Timer control within the updatepanel)

How can I preserve focus?

Yours
Andreas KnudsenIf the textbox is also within anoother Update Panel (or ths ame one), trye moving it out. In the worst case you can use Scriptmanager.SetFocus from the server side code.
If the textbox is also within anoother Update Panel (or ths ame one), try moving it out. In the worst case you can use Scriptmanager.SetFocus from the server side code.
The TextBox is outside any UpdatePanel,

I do not want to always set the focus to a?particular textbox, but to
preserve the focus on whichever textbox the user is using as the UpdatePanel happens to Update.

Is that possible at all?

pressing enter on a form in an updatepanel

Hi,

Im trying to fix my forms so that enter does not submit forms on IE/Mozilla/Safari but cannot find a solution. First off I used :

/*--- Disable enter key ----*/function kH(e) { var pK = e ? e.which : window.event.keyCode;return pK != 13;} document.onkeypress = kH;if (document.layers) document.captureEvents(Event.KEYPRESS);/*------------*/

on all pages but it didnt seem to work. So then I decided to try catch the keypress from forms like input and textarea and I used the following (onkeypress="return ifEnter(this,event);")

function ifEnter(field,event) { var theCode =event.keyCode ?event.keyCode :event.which ?event.which :event.charCode;if (theCode == 13) {return false; }else {return true; }}

but again it doesnt seem to work. Another thing I noticed is that it seems to submit the form as asp.net would. My default form submission is a next button which moves to another page when submitted, but when someone hits enter, the same page reloads with a standard postback i think.

What I want to know is why the javascript wont work? Is it because the form is in an updatepanel? How can I manage the user pressing enter in an update panel?

Why doesnt the user pressing enter activate the DefaultButton action of the panel which its in?

All help much appreciated!

C

Edit: never mind, I see the behavior now.

I saw the behavior with only one textbox. Adding a second set to invisible, perhttp://aspnet.4guysfromrolla.com/articles/060805-1.aspx, fixed it.

See if that helps for you.


My form allready had multiple textboxes etc.

The problem seesm to be only in firefox. Ive found a partial fix for my problem which at least submits my default button and saves the form instead of performing a callback here :

http://www.andornot.com/about/developerblog/2007/09/fix-firefox-defaultbutton-issue-with.aspx

Im still looking for a simple way to prevent enter key form posting back in certain textareas or input text boxes in firefox pretty please.

Prevent CHECKBOX in Update Panel

Hi there,i'm using CHECKBOX in Gridview Template Panel, and My Gridview is under UpdatePanel. The update panel will be refresh every 3 second using timer. how to prevent CHECKBOX from 'unchecking' when the user have already check the CHECKBOX ?Thanks.

Hi,

can you identify if it is due to slowly loading update panel or checkbox just loses its checked state on postback?

You can place just a button anywher eon the page (disable your timer before) and see if checkbox loses its checked value when you click this button.

-yuriy


The CHECKBOX just loses its checked state. I dont think palce a button anywhere is the solution for the application, since it'll have so much button. any ideas ?Thanks.

Hi,

an approach would be saving the checked boxes in an hidden field in the page. When a postback occurs, you parse the hidden field and extract the info about the checked boxes.

Since the GridView might be bound to different data each time, you have to associate an ID to each checkbox. The ID might be that of a database row, for example.

Then, when you're binding the GridView, you check whether the ID is in the list of checked boxes. If it is, you select the corresponding checkbox.

Sounds little complicated, but it should work.

Prevent child control inside the updatepanel to refresh the updatepanel

let say i have 2 UpdatePanels UP1 and UP2. Up1 contains a dropdownlist with 3000 items. When selectedindex of the dropdownlist is changed, it fires a partial postback to refresh the controls inside the UP2 which uses trigger. but at the same time it also refreshes the UP1which i want to avoid. and i also need this dropdown list to be inside the Updatepanel because the selected index is changing during partial postback.

Currently what i have done is i took this dropdownList out of updatepanel and the UP2 gets refreshed using trigger of that dropdownlist, and when it is required to update the the dropdown list i 'm injecting the javascript code in partial postback to do this.

any better work around to achieve this.

Thanks in Advance

RG

Pushed...

Prevent Modal Popup from Moving on Async Postback?

I have a draggable a panel with a ModalPopupExtender with an UpdatePanel inside it. Whenever I have an asynchronous postback run, the popup "jumps" back to to the center of the screen. Ideally it would stay in whatever position it is currently in, as the jump is jarring to the user experience.

Anyone know a way to avoid this?

Thanks!

Hi MWB,

To troubleshoot this issue, we really need the source code to reproduce the problem, so that we can investigate the issue in house. It is not necessary that you send out the complete source of your project. We just need a simplest sample to reproduce the problem. You can remove any confidential information or business logic from it.

Best regards,

Jonathan


Hi Jonathan -

Thanks very much for responding. I put together an extremely simple (and rather ugly, so forgive me) website project that reproduces the jumping modal popup behavior. Please let me know if you have any thoughts or questions. Since I can't directly upload the project files, the code is below.

Thanks again!

-Matthew

Default.aspx

<%@. Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@. Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
<style>
*
{
font-family: Verdana, Helvetica, San-Serif;
}

.popupButton
{
font-weight: bold;
color: #C00;
}

.modalPopupBackground
{
background-color: #CCC;
filter: alpha(opacity=60);
opacity: 0.6;
}

.windowTitle
{
border: solid 2px #9CF;
background-color: #369;
color: #FFF;
font-size: 16px;
text-align: center;
padding: 10px 10px 10px 10px;
}

.window
{
width: 400px;
border: solid 2px #036;
background-color: #FFF;
padding: 5px 5px 5px 5px;
}

.windowContent
{
text-align: center;
margin: 10px 10px 10px 10px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" /
<h1>Click this button</h1>
<asp:Button ID="Button_OpenPopup" runat="server" Text="Open Modal Popup" CssClass="popupButton" /
<div>
<h4>Junk text to allow dragging of Modal Popup</h4>
<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Phasellus vehicula nisi vitae elit. Vivamus metus diam, dignissim in, vehicula vitae, ultrices a, dui. Maecenas nec eros vel lacus gravida nonummy. Donec laoreet, metus vel interdum sodales, pede augue iaculis nunc, et venenatis sem mi sed elit. Donec arcu. Praesent nec magna. Nunc egestas lectus ac quam. Quisque in justo non tortor luctus faucibus. Fusce mattis dignissim diam. Phasellus gravida risus vel magna. Mauris commodo felis nec metus. Cras commodo euismod ante. Donec consectetuer nisl vitae nulla. Nam aliquet. Mauris semper velit id orci. Suspendisse elementum, pede et dictum molestie, mi ante pulvinar metus, ut varius massa dui et diam. Integer dictum fermentum ipsum. Nunc quis odio. Aenean vitae tellus.
</p>
<p>
In elit lectus, fermentum ac, fringilla accumsan, aliquam in, turpis. Praesent tempus sagittis augue. Aenean leo lectus, mattis ultricies, interdum sed, luctus ac, ligula. In hac habitasse platea dictumst. Vivamus placerat. Fusce turpis enim, tempor tempor, luctus at, bibendum id, sapien. Morbi feugiat ante eu eros. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Proin sed felis. Duis sit amet justo. Vivamus eu diam ac dui bibendum tempus. Vivamus quis neque sit amet felis rutrum tristique.
</p>
<p>
Pellentesque adipiscing accumsan est. Sed dignissim arcu nec orci. Sed euismod diam. Donec at tellus. Suspendisse mauris neque, pharetra et, pretium vitae, blandit ut, pede. Vestibulum aliquet, nisi eu varius congue, neque dolor ornare augue, ut iaculis lacus urna eget justo. Vivamus urna. Suspendisse ipsum diam, blandit sit amet, semper ut, cursus eu, leo. Cras pede lorem, rhoncus vitae, posuere ac, ultrices at, lacus. Cras in augue quis purus ultrices sollicitudin. Nam congue, magna id sodales suscipit, tortor tellus ullamcorper metus, blandit iaculis nunc eros id augue. Nam posuere erat quis est. Nunc porta leo et lorem. Nam cursus massa et arcu. Proin augue diam, blandit ut, imperdiet a, elementum nec, purus. Pellentesque metus mauris, dignissim ac, dignissim et, venenatis in, massa. Curabitur eget dui sit amet erat tincidunt volutpat. Fusce vel nibh quis erat blandit posuere. Mauris porta, erat sit amet tincidunt commodo, augue lectus porttitor nulla, nec lobortis lacus elit ut elit. Cras feugiat posuere justo.
</p>
<p>
Cras a velit id massa ornare commodo. Donec egestas. Vestibulum sed felis. Etiam aliquam, tellus sit amet consectetuer bibendum, dui ante volutpat ligula, at semper lacus tellus a lorem. Sed et elit. Integer nisi purus, suscipit ac, nonummy nec, placerat eget, diam. Nullam sodales. Quisque erat pede, ultrices non, cursus ut, euismod vel, sem. In hac habitasse platea dictumst. Ut sit amet est. Nulla pellentesque. Quisque non dolor. Vestibulum mi arcu, accumsan ac, ullamcorper mollis, dignissim eu, urna. Vestibulum metus quam, congue eget, tempus quis, pellentesque ac, eros. Suspendisse risus lectus, interdum nec, tristique ut, auctor eu, urna. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Etiam ac mi. Sed eget arcu. Curabitur eu libero sit amet odio fringilla pharetra. Aenean arcu.
</p>
<p>
Donec malesuada. Phasellus sapien risus, tristique sit amet, varius id, iaculis sit amet, purus. Morbi egestas risus et turpis. Curabitur quis quam. Vestibulum tortor sem, feugiat id, laoreet et, egestas at, metus. Aenean pellentesque tellus sed metus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Phasellus lacinia tempor erat. Vestibulum pharetra, sem vel porttitor lobortis, libero erat ultricies nulla, sed suscipit justo lorem vel nisi. Sed at sapien. Maecenas vestibulum elementum odio. Duis sagittis, diam vel posuere egestas, sapien lorem vulputate metus, faucibus rhoncus diam nulla sed est. Mauris imperdiet. Nulla sagittis. Aliquam velit arcu, facilisis in, tempus vel, hendrerit in, dolor. Ut lacinia est non neque nonummy ullamcorper.
</p>
<p>
*** sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed sit amet orci eu neque imperdiet imperdiet. Phasellus blandit mauris nonummy urna. Phasellus lacinia vestibulum felis. Fusce ullamcorper egestas sem. Donec auctor, lacus nec vulputate convallis, nunc purus vehicula erat, vitae blandit purus mi at lectus. Suspendisse tincidunt. Donec id justo. Sed eros augue, lobortis non, rhoncus quis, fermentum porta, risus. Pellentesque egestas condimentum quam. Nullam neque. Vivamus convallis tellus ut mauris. Phasellus luctus dapibus nibh. Phasellus pulvinar massa non nisi. Aenean malesuada euismod lacus. *** sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Fusce vitae tortor non diam pellentesque consectetuer. Curabitur tincidunt nunc sit amet turpis.
</p>
<p>
Donec est turpis, mattis in, scelerisque non, aliquet elementum, libero. Quisque mauris erat, rhoncus sit amet, tristique vitae, condimentum in, nunc. Vivamus quam nisl, tincidunt vel, consequat eu, sodales id, mauris. Nam eu eros id massa cursus pellentesque. Etiam quis metus in mi fringilla lacinia. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Suspendisse ac nisi. In hac habitasse platea dictumst. In hac habitasse platea dictumst. Sed sodales porttitor dolor. Vestibulum risus. Mauris augue augue, ultricies vitae, adipiscing in, elementum sit amet, nunc.
</p>
<p>
Pellentesque pulvinar dignissim quam. Donec sed justo et elit semper interdum. Duis nec leo ac urna pellentesque eleifend. Morbi consectetuer purus ut felis. Nulla euismod fermentum enim. Ut aliquet tellus at justo. Sed purus. Phasellus porttitor commodo ligula. Phasellus sem. Donec non orci. Donec in nibh in lorem lacinia sagittis. Aenean vestibulum dictum sem. Sed ligula. Maecenas pharetra laoreet velit. Nam vitae mauris nec tellus cursus tincidunt. Curabitur malesuada massa feugiat nisl. Maecenas dapibus aliquam diam. Pellentesque ac dolor. Proin sagittis ultricies dui.
</p>
<p>
Ut vel orci sagittis odio tempor porta. Cras vitae nunc. In sollicitudin pharetra sapien. Donec imperdiet. Aenean egestas dui a mi. Cras mauris velit, tincidunt sed, tempor et, sollicitudin et, arcu. Quisque turpis lorem, hendrerit quis, blandit quis, convallis eget, pede. Etiam lacus lectus, molestie vitae, egestas pellentesque, dapibus sit amet, est. Suspendisse nibh dolor, bibendum a, sollicitudin sollicitudin, pulvinar sed, magna. Proin in nunc. Praesent blandit tempus magna. Aliquam erat volutpat. Morbi mattis. Nunc pretium laoreet ante. Integer eros nisi, luctus sed, commodo quis, tincidunt quis, ipsum. Morbi magna dolor, tempor id, sagittis faucibus, adipiscing at, dui. Sed ornare, orci non lobortis viverra, nibh enim auctor lorem, at bibendum lacus massa et eros. Phasellus luctus. Suspendisse volutpat nunc eget augue.
</p>
<p>
Curabitur vulputate. Donec nunc lorem, porta accumsan, pretium nec, scelerisque aliquet, ligula. Aenean eleifend aliquam lorem. Quisque facilisis. Nullam porta. Vivamus congue dapibus libero. Vestibulum placerat bibendum enim. Sed diam eros, lobortis vel, varius a, pretium et, nibh. Nulla nisi dui, malesuada eu, lobortis tincidunt, mattis nec, leo. Proin massa mauris, interdum et, elementum vitae, ornare ut, lorem. Fusce erat massa, dignissim sed, viverra sit amet, euismod in, magna. Donec consectetuer porta odio.
</p>
</div
<asp:Panel ID="Panel_PopupWindow" runat="server" CssClass="window">
<asp:Panel ID="Panel_Panel_PopupWindowTitle" runat="server" CssClass="windowTitle">
<p><strong>Drag Me</strong></p>
<asp:Button ID="Button_ClosePopup" runat="server" Text="Close Modal Popup" />
</asp:Panel
<asp:Panel ID="Panel_PopupWindowContent" runat="server" CssClass="windowContent">
<asp:UpdatePanel ID="UpdatePanel_PopupWindowContent" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="True">
<ContentTemplate>
<div style="text-align: left;">
<p>How to reproduce the jumping Modal Popup issue:</p>
<ol>
<li>
Drag the popup using the blue box that says "Drag Me" above
so that the popup is no longer in the default centered location
</li>
<li>Click "Generate Asynchronous Postback"</li>
<li>
Note how the popup "jumps" back to the default
center location. This is the behavior I wish to avoid.
</li>
</ol>
</div>
<p><strong>Any ideas? Thanks!</strong></p>
<p><asp:Literal ID="Literal_Test" runat="server" /></p>
<asp:Button runat="server" Text="Generate Asynchronous Postback" OnClick="ShowDate" />
</ContentTemplate>
</asp:UpdatePanel>
</asp:Panel>
</asp:Panel>
<ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender" runat="server" EnableViewState="true" TargetControlID="Button_OpenPopup" PopupControlID="Panel_PopupWindow"
CancelControlID="Button_ClosePopup" PopupDragHandleControlID="Panel_Panel_PopupWindowTitle" BackgroundCssClass="modalPopupBackground" />
</form>
</body>
</html>

Default.aspx.cs

using System;
using System.Web.UI.WebControls;
public partialclass _Default : System.Web.UI.Page
{
protected void ShowDate(object sender, EventArgs e)
{
Literal_Test.Text = System.DateTime.Now.ToString();
}
}

Web.Config

<configuration>
<configSections>
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere"/>
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
</sectionGroup>
</sectionGroup>
</sectionGroup>
</configSections>
<system.web>
<pages>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit" tagPrefix="ajaxToolkit"/>
</controls>
</pages>
<compilation debug="true">
<assemblies>
<add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
</assemblies>
</compilation>
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
</httpHandlers>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</httpModules>
</system.web>
<system.web.extensions>
<scripting>
<webServices>
</webServices>
</scripting>
</system.web.extensions>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules>
<add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</modules>
<handlers>
<remove name="WebServiceHandlerFactory-Integrated"/>
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</handlers>
</system.webServer>
</configuration>

Hi MWB,

Thanks for your sample.I have reproduced your problem with your sample.

Based on my research and testing, I'm afraid that what your want is not achievable in your case.It will automaticlly reset to orignal position when a post occured.Thanks.

Best regards,

Jonathan

Preventing an UpdatePanel rendering after a Postback

Hi Everyone,

I have a page with three UpdatePanels, let's call them A, B and C and I have a control in B (a webgrid from ComponentArt) which issues a postback when one of it's rows is selected. What I would like to happen is for that event to be processed on the server, however I only want C to update its display (because in B, that row in the grid automatically changes it's appearance, so there is no need for the grid to be redrawn). Do you know if this is possible, ie to switch off the normally-useful behaviour of Atlas always refreshing the UpdatePanel containing the control that triggered the postback.

Thanks for any helpSmile [:)]

Rob.

Try insert Mode=Conditional in the Properties of UpdatePanel.

Bye.


Thanks for replying Paulo, however the mode is already set to "Conditional" for all of the UpdatePanels.


Sorry, but I don't think it's really possible.

You can cause 'C' to update by calling the Update method on that UpdatePanel in code behind, but if 'B' is causing the postback due to an event firing within it, 'B' is going to either force a full postback if its not in an UpdatePanel or a partial postback if its contained within an UpdatePanel.

The only idea I have is to change from the postback occurring on a row selected to a JavaScript command or something like tied to the onclick event to change the appearance of the row and then click a hidden button through JavaScript or something like that to cause 'C' to postback.

A partial postback is a lot like a regular postback and there's a difference in the parameter of the Render methods that determines what Html is sent back down to the browser.(Check out my blog posting on the subject.)

- Joel

I think this could be helpful (http://forums.asp.net/thread/1266249.aspx). I don't know if it's really what are you looking for but try it. I had a similar problem. I wanted to update panel B when I click on control in update panel A. The solution described in the thread works (and is very simple).

Pavel

Previous rows display when a new row add in GridView (in UpdatePanel) after hitting enter

I am having a problem in GridView using UpdatePanel. I have UpdatePanel which contains a GridView. When I enter rows in GridView and refresh a page it remove rows from Grid and if I enter again it shows only new entered row, works fine.

But when I enter few rows in Grid then click on address bar hit enter on it, it removes the rows from Grid and when I again enter a row again then it shows new with previous rows.

Can anybody tell me where am I doing a mistake.

Thanks in advance.

It works fine in debug mode but when I deploy the application on server, it shows previous records with new record.

Any idea?

Thanks in advance.

Previous ViewState being used after UpdatePanel refresh

I am not sure its a problem with a viewstate--just a guess. The problem is this:

I have a page that uses a master page. It has two updatepanels in it. One updatepanel has a dropdownlist and one has a button and a label. When the button triggers a partial postback, I set the value of the label and can see it change on the page. When the dropdownlist triggers a partial postback the label switches back to its previous value right before the partial postback. When I inspect the value in the code behind for the dropdownlist the previous value is what is in the label.

What could be causing this? Has someone else had a similar problem? Where was the previous value even stored for it to be retrieved. Does each updatepanel have a viewstate?

Due to the complexity of my master page, I cannot put the dropdownlist, button and label in the same updatepanel. Is that the source of the problem?


There's one ViewState for the entire page, and it's updated during each async postback.

Could you boil this down to a small sample (e.g. a couple UpdatePanels, one with a DropDownList, one with a Label) and paste the code here?

Also, try removing the UpdatePanels (or setting EnablePartialRendering="false" on your ScriptManager) to see if this works with regular postbacks. That may help to figure out what's going wrong.


Also make sure each UpdatePanel's UpdateMode is set to conditional.

Print button in ReportViewer not working inside UpdatePanel

The print button in the toolbar of the VS reportviewer does not work when the reportviewer is contained inside an updatepanel. Does anyone know of a workaround or fix?

My report parameters are dynamically specified via dropdowns and calendars, so they must be inside an updatepanel...

Hi

I had a similar problem. To overcome I disabled the print button in the reportviewer.

I then added a button, that needs to exist outside of the updatepanel, that on clicking the button triggers code to print to pdf

Works OK and the output capability, in my case, is limited to pdf

Hope that is of help

Michael


Thanks Michael. That seems like a possible solution for me... When you click the button, does it open up Acrobat or just bring up the print menu? Also, may I see the code for the button? Thanks!


Hi

I found the solution to this problem via the attached post. It opens up acrobat.

https://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=139828&SiteID=1

Also eliminates a new explorer window opening.

My code is:

ProtectedSub Button2_Click(ByVal senderAsObject,ByVal eAs System.EventArgs)

Try

Dim warningsAs Warning() =Nothing

Dim streamidsAsString() =Nothing

Dim mimeTypeAsString =Nothing

Dim encodingAsString =Nothing

Dim extensionAsString =Nothing

Dim bytesAsByte()

bytes = ReportViewer1.LocalReport.Render("PDF",Nothing, mimeType, encoding, extension, streamids, warnings)

Response.ContentType ="Application/pdf"

Response.Clear()

Response.ContentType = mimeType

Response.AddHeader("content-disposition","attachment; filename=Report." & extension)

Response.BinaryWrite(bytes)

Response.End()

Catch exAs Exception

EndTry

EndSub

This works for me. You will get an error though if the button is inside an update panel

Cheers

Michael

Print Problem With Updatepanel

HI,

Iam facing problem with update panel.I has a reportviewer and a updatepanel.Updatepanel consists of Reportviewer.Whenever i click on Print Option of Reportviewer,Postback ocurs But no print dialog appears.(So no print).How to Print report when it is is in updatepanel.

When i remove updatepanel Print wrks .But when i keep it in updatepanel NO PRINT ocurs

Plz help ...It is Very urgent

With regards,

Mahender

Any chance you can post the code?
<asp:UpdatePanelID="ReportViewerUpdatePanel"runat="server"UpdateMode="Conditional "ChildrenAsTriggers="true"><ContentTemplate><asp:UpdateProgressID="ReportViewerUpdateProgress"runat="server"><ProgressTemplate><divstyle="display:block; "><center>

Loading ...

<imgalt=""src="Images/Updatepanel/loading.gif"/></center></div></ProgressTemplate></asp:UpdateProgress>

<rsweb:ReportViewerID="ReportViewer1"runat="server"BackColor="WhiteSmoke"ProcessingMode="Remote"Height="100%"ShowBackButton="true"ShowFindControls="false"DocumentMapWidth="50%"ShowParameterPrompts="false"ShowRefreshButton="true"ShowReportBody="false"ShowPromptAreaButton="true"ShowToolBar="true"ShowExportControls="true"ShowZoomControl="false"Width="100%"EnableTheming="true"ShowCredentialPrompts="true"DocumentMapCollapsed="true"LinkActiveColor="Black"LinkActiveHoverColor="Chocolate"LinkDisabledColor="Gray"ExportContentDisposition="AlwaysInline"EnableViewState="true"ShowPrintButton="true"><ServerReportReportServerUrl="http://localhost/ReportServer$SQL"/></rsweb:ReportViewer>

</ContentTemplate><Triggers><asp:AsyncPostBackTriggerControlID="DropdownMenuLinkButton"EventName="Click"/>

</Triggers>

</asp:UpdatePanel>

Incode behind of One event.In my case Buttonclick

this is Code

ReportViewer1.ProcessingMode =

ProcessingMode.Remote;Uri u =newUri("http://localhost/ReportServer$SQL");

ReportViewer1.ServerReport.ReportServerUrl = u;

ReportViewer1.ServerReport.ReportPath =

"/thad/Report1";

ReportViewer1.AsyncRendering =

true;

ReportViewer1.ShowBackButton =

true;

ReportViewer1.ShowFindControls =

true;

ReportViewer1.ShowRefreshButton =

true;

ReportViewer1.ShowPrintButton =

true;

ReportViewer1.ShowReportBody =

true;

ReportViewer1.ShowPromptAreaButton =

true;

ReportViewer1.ShowToolBar =

true;// ReportViewer1.ShowExportControls = true;

ReportViewer1.ShowZoomControl =

true;

ReportViewer1.ToolTip =

"Report Viewer";

ReportViewer1.Width =

Unit.Percentage(100);

ReportViewer1.Height =

Unit.Percentage(100);//ReportViewer1.EnableTheming = true;

ReportViewer1.ShowCredentialPrompts =

true;

ReportViewer1.LinkActiveColor = System.Drawing.

Color.Black;

ReportViewer1.LinkActiveHoverColor = System.Drawing.

Color.Chocolate;

ReportViewer1.LinkDisabledColor = System.Drawing.

Color.Gray;

ReportViewer1.ShowPrintButton =

true;
<asp:UpdatePanelID="ReportViewerUpdatePanel"runat="server"UpdateMode="Conditional "ChildrenAsTriggers="true"><ContentTemplate><asp:UpdateProgressID="ReportViewerUpdateProgress"runat="server"><ProgressTemplate><divstyle="display:block; "><center>

Loading ...

<imgalt=""src="Images/Updatepanel/loading.gif"/></center></div></ProgressTemplate></asp:UpdateProgress>

<rsweb:ReportViewerID="ReportViewer1"runat="server"BackColor="WhiteSmoke"ProcessingMode="Remote"Height="100%"ShowBackButton="true"ShowFindControls="false"DocumentMapWidth="50%"ShowParameterPrompts="false"ShowRefreshButton="true"ShowReportBody="false"ShowPromptAreaButton="true"ShowToolBar="true"ShowExportControls="true"ShowZoomControl="false"Width="100%"EnableTheming="true"ShowCredentialPrompts="true"DocumentMapCollapsed="true"LinkActiveColor="Black"LinkActiveHoverColor="Chocolate"LinkDisabledColor="Gray"ExportContentDisposition="AlwaysInline"EnableViewState="true"ShowPrintButton="true"><ServerReportReportServerUrl="http://localhost/ReportServer$SQL"/></rsweb:ReportViewer>

</ContentTemplate><Triggers><asp:AsyncPostBackTriggerControlID="DropdownMenuLinkButton"EventName="Click"/>

</Triggers>

</asp:UpdatePanel>

Incode behind of One event.In my case Buttonclick

this is Code

ReportViewer1.ProcessingMode =

ProcessingMode.Remote;Uri u =newUri("http://localhost/ReportServer$SQL");

ReportViewer1.ServerReport.ReportServerUrl = u;

ReportViewer1.ServerReport.ReportPath =

"/thad/Report1";

ReportViewer1.AsyncRendering =

true;

ReportViewer1.ShowBackButton =

true;

ReportViewer1.ShowFindControls =

true;

ReportViewer1.ShowRefreshButton =

true;

ReportViewer1.ShowPrintButton =

true;

ReportViewer1.ShowReportBody =

true;

ReportViewer1.ShowPromptAreaButton =

true;

ReportViewer1.ShowToolBar =

true;// ReportViewer1.ShowExportControls = true;

ReportViewer1.ShowZoomControl =

true;

ReportViewer1.ToolTip =

"Report Viewer";

ReportViewer1.Width =

Unit.Percentage(100);

ReportViewer1.Height =

Unit.Percentage(100);//ReportViewer1.EnableTheming = true;

ReportViewer1.ShowCredentialPrompts =

true;

ReportViewer1.LinkActiveColor = System.Drawing.

Color.Black;

ReportViewer1.LinkActiveHoverColor = System.Drawing.

Color.Chocolate;

ReportViewer1.LinkDisabledColor = System.Drawing.

Color.Gray;

ReportViewer1.ShowPrintButton =

true;
<asp:UpdatePanelID="ReportViewerUpdatePanel"runat="server"UpdateMode="Conditional "ChildrenAsTriggers="true"><ContentTemplate><asp:UpdateProgressID="ReportViewerUpdateProgress"runat="server"><ProgressTemplate><divstyle="display:block; "><center>

Loading ...

<imgalt=""src="Images/Updatepanel/loading.gif"/></center></div></ProgressTemplate></asp:UpdateProgress>

<rsweb:ReportViewerID="ReportViewer1"runat="server"BackColor="WhiteSmoke"ProcessingMode="Remote"Height="100%"ShowBackButton="true"ShowFindControls="false"DocumentMapWidth="50%"ShowParameterPrompts="false"ShowRefreshButton="true"ShowReportBody="false"ShowPromptAreaButton="true"ShowToolBar="true"ShowExportControls="true"ShowZoomControl="false"Width="100%"EnableTheming="true"ShowCredentialPrompts="true"DocumentMapCollapsed="true"LinkActiveColor="Black"LinkActiveHoverColor="Chocolate"LinkDisabledColor="Gray"ExportContentDisposition="AlwaysInline"EnableViewState="true"ShowPrintButton="true"><ServerReportReportServerUrl="http://localhost/ReportServer$SQL"/></rsweb:ReportViewer>

</ContentTemplate><Triggers><asp:AsyncPostBackTriggerControlID="DropdownMenuLinkButton"EventName="Click"/>

</Triggers>

</asp:UpdatePanel>

Incode behind of One event.In my case Buttonclick

this is Code

ReportViewer1.ProcessingMode =

ProcessingMode.Remote;Uri u =newUri("http://localhost/ReportServer$SQL");

ReportViewer1.ServerReport.ReportServerUrl = u;

ReportViewer1.ServerReport.ReportPath =

"/thad/Report1";

ReportViewer1.AsyncRendering =

true;

ReportViewer1.ShowBackButton =

true;

ReportViewer1.ShowFindControls =

true;

ReportViewer1.ShowRefreshButton =

true;

ReportViewer1.ShowPrintButton =

true;

ReportViewer1.ShowReportBody =

true;

ReportViewer1.ShowPromptAreaButton =

true;

ReportViewer1.ShowToolBar =

true;// ReportViewer1.ShowExportControls = true;

ReportViewer1.ShowZoomControl =

true;

ReportViewer1.ToolTip =

"Report Viewer";

ReportViewer1.Width =

Unit.Percentage(100);

ReportViewer1.Height =

Unit.Percentage(100);//ReportViewer1.EnableTheming = true;

ReportViewer1.ShowCredentialPrompts =

true;

ReportViewer1.LinkActiveColor = System.Drawing.

Color.Black;

ReportViewer1.LinkActiveHoverColor = System.Drawing.

Color.Chocolate;

ReportViewer1.LinkDisabledColor = System.Drawing.

Color.Gray;

ReportViewer1.ShowPrintButton =

true;

PRM_ParseErrorDetails null or not an object.

I'm getting the following javascript error in my page whenver i try to use an UpdatePanel:

"Sys.WebForms.Res.PRM_ParseErrorDetails is null or not an object."

I have the RC1 dll in my bin folder, all the relevant entries in my web.config, and this worked fine before, but suddenly it's gone kaput!

Any help would be great.

Can you repro this error again? Try to post some codes?to?repro?this?error here.
Try to debug javascript error according to the following steps.
Steps:
1.Create a file based web site
2.Add a JavaScript file called MyScript.js to the root of the project
In this file, add the following:
function MyCustomFunction()
{
//doing custom work
alert("MyCustomFunction ran!!!");
}
if (typeof('Sys') !== 'undefined') Sys.Application.notifyScriptLoaded();
3.Add an ASPX page to the application
4.Add a ScriptManager to the page and add the above script the Scripts collection
<asp:ScriptManager ID="ScriptManager1" runat="server">
<Scripts>
<asp:ScriptReference Path="~/MyScript.js" />
</Scripts>
</asp:ScriptManager>
5.Ensure that the Disable Script Debugging options are unchecked in Internet Explorer's Advanced Properties.
6.Set a breakpoint on the alert("MyCustomFunction ran!!!"); line in the MyScript.js file
7.Ensure that Internet Explorer is configured for debugging using information from this lesson
8.Press F5 to start debugging.
Does the breakpoint get hit?
Which processes does Visual Studio attach to? (hint: check Debug | Attach to Process..)
9.Add the following HTML to the <body> of the ASPX page:
<input type="button" value="Call Function" onclick="MyCustomFunction()" />
10.Press F5 to start debugging.
Does the breakpoint get hit?
Which processes does Visual Studio attach to? (hint: check Debug | Attach to Process..)
11.Add each item listed below after the alert(); in MyCustomFunction() one at a time and Press F5 to debug the page. i.e. Add item "a" from the list, press F5. Remove item a and add item "b" and repeat. Answer the following:
Does the breakpoint get hit?
Which processes does Visual Studio attach to? (hint: check Debug | Attach to Process..)
a.debug.assert(false, "That wasn't supposed to happen!", true);
b.debug.fail("Did I break?");
c.debug._traceDump(Sys.Application, 'object name', true, '... ');
d.debug.trace("Is this a trace or what?");
12.While you're attached to the iexplore.exe process, take a look at the Script Explorer (Debug menu, Windows, Script Explorer).

Wish the above can help you.

Problem about UpdatePanel Triggers with SelectedNodeChanged event

Hi,everyone

I have a problem when use UpdatePanel , when debugging ,cannot run ,but no error tips,who can help me .Thanks very much!

<asp:UpdatePanel ID="AjaxMapPanel" runat="server">
<Triggers>

<asp:AsyncPostBackTrigger ControlID="DataTreeView" EventName="SelectedNodeChanged" />
</Triggers>
<ContentTemplate>
<asp:ImageButton ID="imgMap" runat="server" Height="672px" Width="864px" BorderWidth="1px">
</asp:ImageButton>
</ContentTemplate>

</asp:UpdatePanel>

Hi,

Would you mind elaborating it?

What happened when you tried to debug it?

Can you successfully build it?

Or please show me a simple repro.

Saturday, March 24, 2012

Problem displaying Label in UpdatePanel

I'm having a problem displaying a Label control in a FormView which is within an UpdatePanel. The Label displays fine if the FormView is moved out of the UpdatePanel.

I'm getting the error:

Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.

I don't have any Response.Writes.

I see that quite a lot of people are experiencing the same error but so far none for exactly the
same reason as me.

Hi,

please check ifthis post helps.

Problem forcing an UpdatePanel to post from client-side code (javascript)...

Here's what I'm trying to achieve. I have a rather complex web page that allows data entry. The page utilizes Atlas UpdatePanels for partial reposts. When the user clicks on certain buttons, the data is validated (server-side), and then the user is given the option to save or abandon the changes. To do this, I use RegisterJavaScript to insert a client-side call to a javascript function which calls a vbscript function to display a msgbox (we're only using IE). The vbscript function returns the msgbox value back to the javascript function which then sets an ASP HiddenField. The next step is where I'm having problems. I need the javascript function to force a partial postback so that the server-side code can evaluate the msgbox results (in the hidden field), and respond accordingly. I don't want to repost the entire form because I loose data from other asynchronous client-side page modifications.

So the real question is; how can I force an UpdatePanel to post from client-side code? I've read a number of other threads on this subject and a suggested solution is to call the click event of a hidden LinkButton within the UpdatePanel. So I tried this and it worked! At least it worked for a while. This is the most frustrating part. At some point, and I have no idea what changed to cause this, the code stopped working. Now, when I call the click event, I get an undefined error in the doPostBack function and the form will no long post at all.

If anyone has any suggestions on what is causing this problem, or a better way to force an UpdatePanel to partial post, it would be greatly appreciated!

Here's some of my code;

<atlas:UpdatePanel ID="upConfirmActivitySave" runat="server" Mode="conditional"><ContentTemplate> <asp:HiddenField ID="hfConfirmActivitySave" runat="server" /> <asp:LinkButton ID="lnkDoPostBack" runat="server" style="display:none"></asp:LinkButton></ContentTemplate></atlas:UpdatePanel><script language="javascript" type="text/javascript"><!--function confirmActivitySave() { document.getElementById('hfConfirmActivitySave').value = ConfirmActivitySaveMsgbox(); document.getElementById('lnkDoPostBack').click();} // --></script><script language="vbscript" type="text/vbscript"><!--Function ConfirmActivitySaveMsgbox()'This only works for IEConfirmActivitySaveMsgbox = MsgBox("Do you wish to save?",35)End Function// --></script>

I decided to simplify things and created a new aspx page with a single UpdatePanel and two ASP ImageButtons, one inside the UpdatePanel and the other outside the UpdatePanel. The client-side code for the button outside the UP calls the click method for the button inside the UP. And sure enough, I get a partial post. So this tells me there's something wrong with my main project page. I wonder if I've hit some sort of atlas bug or limitation?


This just gets weirder and weirder. I restored my project to a prior version – one that the partial post code still worked. I compared the differences in the html between the working and non working versions and the only changes were some controls that were renamed (all within UpdatePanels) and a single control (an asp:HyperLink) that moved from outside to inside an UpdatePanel. So, from the working code, I moved the one control (using cut/past) and sure enough the page fails during the client-side partial post; "unknown runtime error". And get this; if I delete the control, the page still fails. By the way, all references to this control (client-side and server-side) have been removed. Essentially, the control is unused. But if I delete it, the page fails. What gives? I can remove other controls, or add and remove controls with no problem. It's almost like there's some reference that's not getting deleted correctly. Any ideas? Anyone?

Problem getting SelectedIndex from CascadingDropDown in an UpdatePanel

Hey everyone, I'm having an issue with my AJAX page. I have a CascadingDropDown that once a value is selected, trigger the population of another CascadingDropDown that resides in an UpdatePanel. I'm attempting to have the second CascadingDropDown populate a textbox based on its .SelectedIndex. For some reason, I can grab the .SelectedValue, but getting .SelectedIndex always returns 0.

Does anyone else have this problem, or know how to solve it. Any help would be greatly appreciated.

Did you find a solution for your problem? Coz I also have the same problem

hi,

please refer :http://ajax.asp.net/ajaxtoolkit/CascadingDropDown/CascadingDropDown.aspx

please post the code, so that i can help you to solve your problem.

Thanks

Kishore.

www.relgo.com


hello invisible man,

thanks for the reply, here is my scenario... i have two cascadingdropdown control on my page, and then I have a dynamicpopulate control (which is binded or the targetcontrol is a textbox) that is dependent on the selected value of the two cascadingdropdown control. The problem is passing the value of both the cascadeddropdown control to the dynamicpopulate control.

here is my aspx code (i did not include the master page)

123<%@.4Page Language="C#"5MasterPageFile="~/NOCMasterPage.master"6AutoEventWireup="true"7CodeFile="ApplicationForm.aspx.cs"8Inherits="ApplicationForm"9Title="Sharjah NOC Application Form"10EnableEventValidation="false" %>1112<%@. Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>1314"ApplicationFormContent" ContentPlaceHolderID="cphNOCMasterPage" Runat="Server">15 "smApplicationForm" runat="server">1617 "text/javascript">18 function SelectFromDDL(ddPlotNumberID, ddAreaNameID)19 {20 alert(document.getElementsByName(ddPlotNumberID));21 var e = document.getElementsByName(ddPlotNumberID);// get ddPlotNumber element22 alert(eval([e.selectedIndex].text));2324 }2526 function fnContextValue(strSelectedAreaNameSelectedPlotNo)27 {28 var behaviorId = $find('dpePlotAreaID');29if (behaviorId)30 {31 behaviorId.populate(strSelectedAreaNameSelectedPlotNo);32 }3334 }3536

3738 39 "lblAreaName" runat="server" Text="Area Name" Width="238px" Font-Names="Arial" ForeColor="MidnightBlue">40 "ddAreaName" runat="server" EnableViewState="false">4142 "cddAreaName" runat="server"43 PromptText="Please select the Area in Manhattan"44 LoadingText="Loading ...."45 TargetControlID="ddAreaName"46 ServicePath ="PlotAreaService.asmx"47 ServiceMethod ="GetAreaName"48 Category="AreaName">4950

51

52 53 "lblPlotNumber" runat="server" Text="Plot Number" Width="238px" Font-Names="Arial" ForeColor="MidnightBlue">54 55 "ddPlotNumber" runat="server">565758 "cddPlotNo" runat="server"59 TargetControlID="ddPlotNumber"60 ParentControlID="ddAreaName"61 PromptText="Please select Plot Number inside the selected Area"62 ServicePath ="PlotAreaService.asmx"63 ServiceMethod ="GetPlotNo" Category="PlotNo">6465

66

67 68 "lblPlotArea" runat="server" Text="Area of Plot" Width="238px" Font-Names="Arial" ForeColor="MidnightBlue">69 70 "txtPlotArea" runat="server" Width="205px">71 "dpePlotArea" runat="server"72 ServicePath="PlotAreaService.asmx"73 ServiceMethod="GetPlotArea"74 TargetControlID="txtPlotArea"75 ContextKey=""76 ClearContentsDuringUpdate="true"77 BehaviorID="dpePlotAreaID">787980

8182838485page code behind8687using System;88using System.Data;89using System.Configuration;90using System.Collections;91using System.Web;92using System.Web.Security;93using System.Web.UI;94using System.Web.UI.WebControls;95using System.Web.UI.WebControls.WebParts;96using System.Web.UI.HtmlControls;97using System.Data.OleDb;98using System.Data.SqlClient;99using System.Collections.Specialized;100using System.Workflow.Runtime;101using System.Workflow.Runtime.Hosting;102using AjaxControlToolkit;103104105public partialclass ApplicationForm : System.Web.UI.Page106// Use BasePage.cs as code file for parameter getting and107// access to Module.cs108//public partial class ApplicationForm : BasePage109{110protected void Page_Load(object sender, EventArgs e)111 {112113string strPlotNumberID ="ctl00_cphNOCMasterPage_cddPlotNo_ClientState";114//string strAreaNameID = cddAreaName.ID;115 // CascadingAreaName Id not the dropdown116string strAreaNameID ="ctl00_cphNOCMasterPage_cddAreaName_ClientState";117 ddPlotNumber.Attributes.Add("OnChange","return SelectFromDDL(" + strPlotNumberID +"," + strAreaNameID +" )");118 }119120121}122123124125web service code126127using System;128using System.Web;129using System.Collections;130using System.Collections.Specialized;131using System.Collections.Generic;132using System.Xml;133using System.Web.Services;134using System.Web.Services.Protocols;135using System.Data;136using System.Data.OleDb;137using System.Data.SqlClient;138using AjaxControlToolkit;139140/// <summary>141/// Summary description for PlotAreaService142/// </summary>143[WebService(Namespace ="http://tempuri.org/")]144[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]145[System.Web.Script.Services.ScriptService]146public class PlotAreaService : System.Web.Services.WebService147{148 string strConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=****data table name ******;Data Source=*** Database Server Instance name****";149 string strTableName = "dbo.sharjah_area_name";150 string fldAreaName = "area_name";151 string fldPlotNo = "area_plot_number";152 string fldAreaOfPlot = "area_of_plot";153154public PlotAreaService()155 {156157//Uncomment the following line if using designed components158 //InitializeComponent();159 }160161162/*************************************163 * Required by cascading drop down164 * parameter name and type should not be changed165 * ***********************************/166 [WebMethod]167public CascadingDropDownNameValue[] GetAreaName(string knownCategoryValues,string category)168 {169170 dsAreaNameTableAdapters.sharjah_area_nameTableAdapter objAreaNameAdapter =new dsAreaNameTableAdapters.sharjah_area_nameTableAdapter();171 List lstAreaName =new List();172173foreach (DataRow drAreaNameTempin objAreaNameAdapter.dtGetDataAreaName())174 {175string strAreaName = drAreaNameTemp[fldAreaName].ToString();176 lstAreaName.Add(new CascadingDropDownNameValue(strAreaName, strAreaName));177178 }179180return lstAreaName.ToArray();181 }182183 [WebMethod]184public CascadingDropDownNameValue[] GetPlotNo(string knownCategoryValues,string category)185186 {187string[] arrChosenAreaName = knownCategoryValues.Split(':',';');188string strChosenAreaName = arrChosenAreaName[1];189 dsPlotNoTableAdapters.sharjah_area_nameTableAdapter objPlotNoAdapter =new dsPlotNoTableAdapters.sharjah_area_nameTableAdapter();190 List lstPlotNo =new List();191foreach (DataRow drPlotNoin objPlotNoAdapter.dtPlotNoData(strChosenAreaName))192 {193string strPlotNo = drPlotNo[fldPlotNo].ToString();194 lstPlotNo.Add(new CascadingDropDownNameValue(strPlotNo, strPlotNo));195196 }197return lstPlotNo.ToArray();198 }199200 [WebMethod]201public string GetPlotArea(string contextKey)202 {203 System.Threading.Thread.Sleep(250);204string strPlotArea =string.Empty;205string[] arrContextKey = contextKey.Split(',');206string strAreaName = arrContextKey[0];207string strPlotNo = arrContextKey[1];208 dsPlotAreaTableAdapters.sharjah_area_nameTableAdapter objPlotAreaAdapter =new dsPlotAreaTableAdapters.sharjah_area_nameTableAdapter();209210foreach (DataRow drPlotAreain objPlotAreaAdapter.dtPlotAreaData(strAreaName, strPlotNo))211 {212 strPlotArea = drPlotArea[fldAreaOfPlot].ToString();213 }214return strPlotArea;215 }216}217218219220