Showing posts with label inside. Show all posts
Showing posts with label inside. Show all posts

Wednesday, March 28, 2012

Postback inside of AJAX Rounded Corners Extender problem

Hello everyone. I have learned alot through this site and finally joined because I can't seem to find a fix for my problem and I was hoping that you guys could help me out.

I have a DropDownList with a SqlDataSource inside a panel with an AJAX rounder corners extender. It seems that the page shows itself without the extenders applied but then flashes and shows the extenders applied to the controls.

If I take the DropDownList and SqlDataSource out of the panel I know longer get the screen flash, but the extenders do take a second to show on the controls.

What is the fix for the Screen flash? And, If possible, how can I delay the display of the controls so that the AJAX extenders are applied before showing the controls?

Thanks for your help!

Rusty

Try putting Panel in a UpdatePanel

Thanks for the suggestion, but putting the Panel in an Update Panel didn't work. The screen still flashes. Here is my code with the update panel.

<

divid="master_page"><asp:UpdatePanelID="UpdatePanel1"runat="server"><ContentTemplate><cc1:RoundedCornersExtenderID="RoundedCornersExtender2"runat="server"TargetControlID="Panel2"Radius="10"></cc1:RoundedCornersExtender><asp:PanelID="Panel2"runat="server"Height="1000"Width="100%"BackColor="ForestGreen"><asp:SqlDataSourceID="SqlDataSource1"runat="server"ConnectionString="<%$ ConnectionStrings:MyConnectionString %>"SelectCommand=""></asp:SqlDataSource><asp:DropDownListID="InfoDDLB"runat="server"AutoPostBack="True"DataSourceID="SqlDataSource1"DataTextField="Name"DataValueField="ID"OnTextChanged="GetInfo"Width="100"><asp:ListItemSelected="True"Value="0">Select Something...</asp:ListItem></asp:DropDownList></asp:Panel></ContentTemplate></asp:UpdatePanel><asp:contentplaceholderid="ContentPlaceHolder1"runat="server"></asp:contentplaceholder></div>
Anything else I can try?

1. When I put your code in UpdatePanel there wasno flash when I changed value in DropDownList.

2. The RoundedCornersExtender should have ajaxtoolkit prefix, unless you have changed tag attribute in your web.config file

3. Depending on how much data you are fetching in the dropdown list, it will take longer to apply rounded corners effect.

The simple reason is javascript executed by rounded corner starts executing after you panel is completely loaded and size (height and width) is determined. Also, the more javascript/ajax calls you use the slower it gets, as javascript gets slower and slower as size increases.

PS: You can turn off debugging in web.config file by setting <compilation debug="false">. This will speed up Ajax scripts as they don't make any debug calls. And you won't see a delay.


2. I have the following entry in my web.config file for the AJAX controls:

<

addtagPrefix="cc1"namespace="AjaxControlToolkit"assembly="AjaxControlToolkit"/>

3. I am not fetching anything into the dropdown list.

I also turned off the debugger.

I have done further investigation and it turns out that I don't need the SqlDataSource tied to the DropDownList to get the flash. The only control that makes the screen flash is this DropDownList. When replaced with a textbox or button there is no flash. The first Example below shows the flash when the page is loaded and the "Push Me" Butotn is clicked. The second example has the DropDownList outside of the Panel and doesn't have a flash when the page loads or the "Push Me" button is clicked.

EXAMPLE 1: (SCREEN FLASH - OnPage load and 'Push Me' Button Clicked)

<%@. Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
<!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 runat="server" id="ScriptManager1" />
<div align="right" style="margin-right: 10px">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<cc1:DropShadowExtender ID="DropShadowExtender1" Opacity=".5" Radius="2" TargetControlID="Panel5" runat="server" Rounded="True">
</cc1:DropShadowExtender>
<asp:Panel backcolor="orange" id="Panel5" runat="server" Height="100px" Width="200px">
<asp:DropDownList ID="DropDownList1" runat="server">
</asp:DropDownList>
<asp:Button ID="Button1" runat="server" Text="Push Me" />
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
</body>
</html>

EXAMPLE 2: (NO SCREEN FLASH - OnPage load and 'Push Me' Button Clicked)

<%@. Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
<!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 runat="server" id="ScriptManager1" />
<div align="right" style="margin-right: 10px">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<cc1:DropShadowExtender ID="DropShadowExtender1" Opacity=".5" Radius="2" TargetControlID="Panel5" runat="server" Rounded="True">
</cc1:DropShadowExtender>
<asp:DropDownList ID="DropDownList1" runat="server">
</asp:DropDownList>
<asp:Panel backcolor="orange" id="Panel5" runat="server" Height="100px" Width="200px">
<asp:Button ID="Button1" runat="server" Text="Push Me" />
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
</body>
</html>

Thanks for your help!

Rusty


I tried your code same results both times no flash. Although as I said before, it takes fraction of a second(1/10 or even less) to apply the DropDownExtender (being a javascript). It is not noticable at all.

What browser you are using? I've read many complaints related to AJAX and IE 6. I'm using IE 7.

Please try with other browsers and see you have the same issue.

Let me know. Will be glad to help you out.


Yes, that's what it was. I updated from IE6 to IE7 on one of my computers and tried the page and there is no flashing issues. So, is there a recommendation for a solution for IE6 users when viewing my website?

Your help is greatly appreciated!

-Rusty


for IE 6 you can use filter instead of RoundedExtendedCorners.

<DIV ID="oFilterDIV" STYLE="cursor:hand;height:160px; padding:10px; font:bold 13pt verdana;
filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=5, OffY=5,
Color='gray', Positive='true')" onclick="fnDepress();">
This is the DIV content.</DIV>

More about filters is herehttp://msdn.microsoft.com/library/default.asp?url=/workshop/author/filter/reference/filters/dropshadow.asp

Now on server-side you can check Browser's version (Request.Browser.Version) and then enable/disable RoundedCornerExtender as well as set CSSClass or Style property of the Asp:Panel control to use or not use filters.

Filters are specific to IE. They don't work in FireFox or other browsers.


postback inside modalpopupextender

I want to show a modalpopupextender that contains: a textbox ,A button, gridview, ok button , close button: when the user click on A button the gridview must be populated , I need this behavior inside the modalpopupextender but it seems like modalpopupextender does not support any control that make a postback, How can I manage this??

Best Regards

Joseph

I already have done this what you need to do is,

let say. btnSearch popups your ModalpopupExtender,

when you click in side the control do one thing only in the code behind, of that click event either grid pageindexchange, sortiung, any button click in the last. that is.

ModalPopupExtender1.Show()

it will keep showing the popup until you click close button or call a method.

ModalPopupExtender1.Hide()

It is trial and tested, even I have done more than this in my application.

IF THIS MAKES ANSWER PLEASE CLICK ANSWER ON MY POSTING

Regards,


Hi Killerjocker,

My understanding of your issue is that you want to show some controls include the GridView and generate(update) the content inside it when click on the Button which is associated with the ModalPopupExtender. If I have misunderstood, please feel free to let me know.

In my opnion, I think the easiest way for your situation is adding a UpdatePanel into the Panel which is associated with the ModalPopupExtender and the GridView is put inside the added UpdatePanel. When user click on the Button, the UpdatePanel will be refreshed by sending a asynchronous post and then the shows the ModalPopupExtender. Here is a sample:

<%@. 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>
<style>
.modalBackground {
background-color:Gray;
filter:alpha(opacity=70);
opacity:0.7;
}

.modalPopup {
background-color:#FFD9D5;
border-width:3px;
border-style:solid;
border-color:Gray;
padding:3px;
width:250px;
}
</style>

</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:Button ID="Button2" runat="server" Text="Button" Enabled="false" style="display:none"/>
<asp:Panel ID="Panel1" runat="server" CssClass="modalPopup" Height="50px" Width="235px" style="display:none" DefaultButton="Button4">
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<%=DateTime.Now.ToString()%>
</ContentTemplate>
</asp:UpdatePanel>
<asp:Button ID="Button1" runat="server" Text="Cancel" />
<asp:Button ID="Button4" runat="server" Text="Button" />
</asp:Panel>

<ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="Button2" PopupControlID="Panel1" CancelControlID="Button1" DropShadow="true" BackgroundCssClass="modalBackground">
</ajaxToolkit:ModalPopupExtender>
<input id="Button3" type="button" value="Click Me" onclick="showModalPopup()"/>
<script type="text/javascript" language="javascript">
function showModalPopup(){
__doPostBack('<%=UpdatePanel1.UniqueID%>','');
$find("<%= this.ModalPopupExtender1.ClientID%>").show();
}
</script>
</form>
</body>
</html>

I hope this help.

Best regards,

Jonathan

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 problem using a usercontrol inside an update panel that is inside a masterpage

Hi all,

I have been messing around with this all day and its starting to get on my nerves i'm probably missing something really simple but I was hoping someone could shed some light on it or perhaps point me in the right direction..

As I said in thesubject of the post, I have a user control inside an update panel, that resides in the master page, now my problem is when the user control goes to perform a post back I get that nasty "Invalid callback or postback argument error" Can someone help me to rectify this issue? Basically all the control needs to do is hide one panel inside it and show another on a link buttons click even.. There is other code in there too..

The simplified code for the master page is as follows..

<%

@dotnet.itags.org.MasterLanguage="VB"CodeFile="redcellar.master.vb"Inherits="redcellar" %>

<%

@dotnet.itags.org.RegisterAssembly="AjaxControlToolkit"Namespace="AjaxControlToolkit"TagPrefix="ajaxToolkit" %>

<%

@dotnet.itags.org.RegisterSrc="login.ascx"TagName="login"TagPrefix="uc2" %>

<%

@dotnet.itags.org.RegisterSrc="controls/memberdeals.ascx"TagName="memberdeals"TagPrefix="uc1" %>

<!

DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<

htmlxmlns="http://www.w3.org/1999/xhtml"xml:lang="en"lang="en">

<

headrunat="server"><metahttp-equiv="content-type"content="text/html;charset=utf-8"/><linkrel="stylesheet"type="text/css"media="screen, projection"href="stylesheets/screen.css"/><!--[if lte IE 6]>

<link rel="stylesheet" type="text/css" media="screen, projection" href="http://links.10026.com/?link=stylesheets/screen-ie.css" /><![endif]-->

<linkrel="stylesheet"type="text/css"media="screen, projection"href="stylesheets/order.css"/><!--[if lte IE 6]>

<link rel="stylesheet" type="text/css" media="screen, projection" href="http://links.10026.com/?link=stylesheets/order-ie.css" /><![endif]-->

<scripttype="text/javascript"src="scripts/borders.js"></script><scripttype="text/javascript"src="scripts/misc.js"></script><title></title>

</

head>

<

body><formid="form1"runat="server"><asp:ScriptManagerEnablePartialRendering="true"ID="masterScriptManager"runat="server"/><asp:UpdatePanelID="masterUpdatePanel"runat="server"><ContentTemplate><!-- container --><divid="container">

<p>page content is here</p>

</div><uc2:loginID="Login1"runat="server"/></ContentTemplate></asp:UpdatePanel>

And the code for the control is:

<%

@dotnet.itags.org.ControlLanguage="VB"Debug="true"AutoEventWireup="false"CodeFile="login.ascx.vb"Inherits="login"Strict="true" %><asp:PanelID="pnlLoginContainer"CssClass="modalPopup"runat="server"><divid="normal"><asp:PanelID="pnlLogin"runat="server"style="overflow: auto;"><divstyle="width: 160px; float: right;"><asp:linkbuttonID="lbClose"cssclass="modalClose"Text=""runat="server"/><asp:ImageID="Image1"runat="server"ImageUrl="~/images/member-red-large.gif"/></div><div><br/><h3id="normalpage_heading">

Member sign in.

</h3><br/><asp:LabelID="Label1"runat="server">Welcome back!</asp:Label><br/><br/><tablecellspacing="0"><trclass="datarow"><tdclass="itemheader"><asp:LabelID="Label2"runat="server"Text="email"/></td><tdclass="itemcontent"colspan="2"><asp:TextBoxID="txtEmail"runat="server"MaxLength="255"/></td></tr><trclass="datarow"><tdclass="itemheader"><asp:LabelID="Label3"runat="server"Text="password"/></td><tdclass="itemcontent"colspan="2"><asp:TextBoxID="txtPassword"runat="server"MaxLength="50"TextMode="Password"/><asp:RequiredFieldValidatorID="RequiredFieldValidator1"runat="server"ControlToValidate="txtpassword"Display="Dynamic"ErrorMessage="*"/></td></tr><trclass="datarow"><tdclass="itemheader"> </td><tdclass="itemcontentsmall"><asp:CheckBoxID="chkRememberMe"runat="server"Text="remember me"/></td><tdclass="itemcontentsmall"style="text-align: right;"><asp:LinkButtonID="lbForgotPassword"runat="server"CausesValidation="False"Text="forget your password?"/></td></tr></table><br/><divclass="link"id="signin-link"><asp:LinkButtonID="cmdLogin"runat="server"Text="sign in"/></div><br/><asp:LabelID="lblLoginMsg"runat="server"ForeColor="Red"></asp:Label><br/></div><div><asp:LabelID="Label4"runat="server">Are you a new user? You must register</asp:Label><asp:LinkButtonID="lbRegister"runat="server"CausesValidation="False"Text="here!"ToolTip="Click here to register.">here!</asp:LinkButton></div></asp:Panel><asp:PanelID="pnlForgotPass"runat="server"Width="100%"style="overflow: auto;"Visible="False"><divstyle="width: 160px; float: right;"><asp:linkbuttonID="Linkbutton1"cssclass="modalClose"Text=""runat="server"/><asp:ImageID="Image2"runat="server"ImageUrl="~/images/member-red-large.gif"/></div><div><p>

Forgot you password?

</p><asp:LabelID="Label5"runat="server">email</asp:Label><asp:TextBoxID="txtForgotPassEmail"runat="server"></asp:TextBox><asp:RequiredFieldValidatorID="RequiredFieldValidator2"runat="server"ControlToValidate="txtForgotPassEmail"Display="Dynamic"ErrorMessage="*"></asp:RequiredFieldValidator><asp:RegularExpressionValidatorID="RegularExpressionValidator1"runat="server"ErrorMessage="You must enter a valid email!"ControlToValidate="txtForgotPassEmail"SetFocusOnError="True"ValidationExpression="^([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*@dotnet.itags.org.([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$"Display="Dynamic"></asp:RegularExpressionValidator><br/><br/><asp:LabelID="lblResponseMessage"runat="server"></asp:Label><br/><pstyle="text-align: right;"><asp:ButtonID="cmdForgotPass"runat="server"Text="submit"/> </p></div></asp:Panel></div></asp:Panel>

The relevant code behind for this is:

ProtectedSub lbForgotPassword_Click(ByVal senderAsObject,ByVal eAs System.EventArgs)Handles lbForgotPassword.Click

pnlLogin.Visible =

False

pnlForgotPass.Visible =

TrueEndSub

Some help with this would be greatly appreciated.. :)

I'm still stuck with this one :S Any ideas?


After eliminating one thing at a time in my masterpage I found that this was the culprit, commenting it out did the trick..

<form method="get" action="">
<p><label for="search">Find a wine:</label>
<input type="text" id="search" onfocus="if(value=='eg: Henschke') value=''" value="eg: Henschke" />
<input type="image" src="http://pics.10026.com/?src=images/go.gif" value="Go" id="go" /></p>
</form>


does anyone have any idea why??

Postback Slowdown

I have a page that contains a table inside an update panel. The table is 10 columns wide and when the page is initially loaded it only contains the header row and a + under the table to add a row. The problem I have is after adding 4 rows the 5th slows down a lot. And from then on addings more rows gets slower and slower. Whenever the + is clicked it causes the update panel to update and dynamically recreate the table with another row. So it starts by just creating the header. The first time you click the + it creates the header and the 1st row. The next time it creates the Header and 1st and 2nd rows.. and so on.

I cannot figure out a way to speed this up, and as the user approaches 10 rows it begins to slow down to 3 to 4 seconds after htiting the button that anything happens. I think the problem is the viewstate is getting huge and causing it to be much slower. I cannot even get update progress images to work. They don't pop up right away, and when they do pop up they go away immediatly.

Any suggestions on ways to improve the speed? Or I am stuck dealing with a slow page.

Can you post any code?


You're right. The viewstate gets sent back for every AJAX call which means that adding a row

may as well be posting the whole page to the server from the servers point of view.

Use this plugin to see what's being sent over the wire:http://www.nikhilk.net/Project.WebDevHelper.aspx

Check outhttp://smarx.com/posts/delayed-load-with-an-updatepanel.aspx

This shows the oposite of what you're doing.

What you need to do is just update the new row instead of the whole grid.

HTH,

Jonathan.


Is there a way to add a row without recreating the whole table? If I update the panel without recreating the table the table goes away right now.

Thanks for the plugin, I will have to check that out.


Try to set <compilation debug = "false" />

may it will improve some ammount of performance..


If you have each row in a div for example:

<div id="table">
 <div id="row1">hello row 1</div>
<div id="row2">Hello row 2</div>
</div>
<asp:Button ID="clickme" runat="server" OnClientClick="javascript:updateTable(); return false;" Text="Add Row" />

Then you could do the following in JavaScript:

<script type="text/javascript">
function updateTable()
{
var table = document.getElementById("table");
table.innerHTML = table.innerHTML + "<div id='row3'>hello row 3</div>";
}
</script>

HTH,

Jonathan.



I have the same problem. Luckily, after optimizing the 'retrieval time'/row, the speed was acceptable for the number of rows I wanted to display.

If you want speed, you can try using the JavaScript method above, and don't update via Updatepanel. So your buttons change the data behind the scenes (without postback), while calling the JavaScript to show the updates.

PostBack with query string...

hi,

Here is what I am trying to do, I have a user control, usercontrol is one of many being loaded in a single default.aspx, inside this user control, there are Atlas TabPanels, in several tab panels there are user controls, in these user controls, there are controls causing a postback, the problem is when page is reloaded, it returns to default tabs, I like to pass a query string that contains active tab, but how can I do this in javascript? I am not sure where to put this here or in Atlas forum. Thanks in advanced.

Hi,

I think u need to set the smartnavigation propery to true . so that focus will not be lost during the postback

Swati


Hi,

Because there is a full postback, you need to use a HiddenField to maintain the current active tab index.
After the postback completes, active the corresponding index with javascript.
Like this:
$find('<%=TabContainer1.ClientID%>').set_activeTabIndex(the value kept in the hiddenfield);

Hope this 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

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

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

Probblem with Menu control inside an update panel

Hi,

I have a master page with a script manager ,update panel and Content Palce Holder. in the default page which uses the masterpage I have added a menu control, textbox and a button. I have two problems which I have seen in the past in other versions of ajax. I have not coded anything other than just these controls on a page

1) I could click on button all day long and there is no java script error but as soon as I click on a menu item I get javascript error saying:

Line:221

Char:20

Error '0.cells' is null or not an object

code: 0

2) I can not get my CSS sheet work in my app theme for the background images. I have the following code in my CSS

.Menu1BackGround

{

background-image:url(/Images/Menu1_Background.bmp);

}

and I have assigned the it to the menu. Nothing happens as if it does not recognize the image path. I could add the background:black to the code and it works fine for the color but not the image. I am not sure if thisis because of the same problem.

Any body have any ideas?

Thanks

Seehttp://ajax.asp.net/docs/overview/UpdatePanelOverview.aspx#UpdatePanelCompatibleControls. The Menu control is not supported inside an UpdatePanel.

I have been using this piece of javascript to go around the menu problem:

var oldMenu_HideItems = Menu_HideItems;if(oldMenu_HideItems){Menu_HideItems = function(items){if (!items || ((typeof(items.tagName) =="undefined") && (items instanceof Event))) { items = __rootMenuItem; }if(items && items.rows && items.rows.length == 0){ items.insertRow(0); }return oldMenu_HideItems(items);} }
I got it from the asp:menu javascript code and I hook it to "patch" the problem.
Adding it to a page where a menu resides makes the javascript error go away. 

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

HTH


Menu control is not compatable with AJAX.

I m also facing sme problem..

Saturday, March 24, 2012

Problem accessing the Items with a Cascading dropdown

I got a web page, inside there is a userControl with two cascading dropdown list, and i got a grid as well (it isn't inside the usercontrol). The cascading ddl are working fine, they get populated and everything, my problem is when I try to load a record from de grid I have to check if this record is inside the second cascading ddl (if it has been populated), and I cannot see the items inside my second cascading ddl (neither the normal ddl) so I cannot check if the record exists, Does anyone know how to tackle this? as well I presume that I will have problems trying to set the selected value once I've been able to check if it exists or not, Any ideas??

Thanks very much!!!!!!!

Hi,

I fail to reproduce the issue. Can you show me your code?

Problem getting elements by ID inside <Content> of AccordionPane

Dear All,

I've got problem on changing the content inside a <div> element inside the Content part of AccordionPane. The code is below:

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<script type="text/javascript">

function test1(){

var table = document.createElement('TABLE');
table.setAttribute('border',0);
table.setAttribute('id','sliderTable');

var tBody = document.createElement('TBODY');
table.appendChild(tBody);

var row = document.createElement('TR');

var cell = document.createElement('TD');

cell.style.backgroundColor = "#CCCCCC" ;
cell.style.width = 10+ "px";
cell.style.height = 5+ "px";

row.appendChild(cell);

tBody.appendChild(row);
}
document.getElementById('colorTable').appendChild(table);

document.getElementById('colorTable').style.display='';

}

</script>

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

<ajaxToolkit:Accordion ID="Accordion1" .....>

<Panes>

<ajaxTookit:AccordionPane...>

<Header>Color</Header>

<Content><div id='colorTable' style="display:none"></div><Content>

</ajaxToolkit:AccordionPane>

......

</Panes>

</ajaxToolkit:Accordion>

</asp:Content>

When I run the code it said there is a javascript error "Object Required". It is the script cannot locate the 'colorTable' element? And what way can I locate the element?

Thanks!!

Stard

Hello,

As you propably discoveredSmile:

function test1(){

var table = document.createElement('TABLE');
table.setAttribute('border',0);
table.setAttribute('id','sliderTable');

var tBody = document.createElement('TBODY');
table.appendChild(tBody);

var row = document.createElement('TR');

var cell = document.createElement('TD');

cell.style.backgroundColor = "#CCCCCC" ;
cell.style.width = 10+ "px";
cell.style.height = 5+ "px";

row.appendChild(cell);

tBody.appendChild(row);
} <----- syntax error
document.getElementById('colorTable').appendChild(table);

document.getElementById('colorTable').style.display='';

}

has syntax error, there is an unnecessary } /or your copy/paste was not successful/


Hi stmarti,

sorry I've got typo error in my post :) Since I just type the main structures of my code and my original one haven't got this typo error.

Btw I searched some other forum and got some solutions like document.getElementById('<%colorTable.ClientID%>') because I am working with a content page under a master page. But I get "colorTable do not have the ClientID property" error.

Any idea on this?

Many thanks.

Stard


Hi,

I have some comments maybe it helps:

a) the correct syntax is <%= colorTable.ClientID %> or <%# colorTable.ClientID %>

but I think it is unnecessary, because your div isnot a server side control so it's id won't be altered! This is only necessary when you have:

<div id='colorTable' style="display:none"runat="server" ></div>

b) The really big problem is style="display:none"andthe empty div.

Why? Because with this style yourempty div will not ever rendered in the browser(!!!) and not even part of the DOM tree! Just check this.

Try instead of: strip style="display:none" or change it style="visibility: hidden;" or use a span instead of div as a placeholder or put some content in the div. Try all these to understand how your browser render empty or display:none divs.



Hi,

Small update, start here: change your div to

<div id='colorTable' style="display: none;"> </div>

and document.getElementById( 'colorTable' ) should worksSmile

Problem getting SelectedValue of Cascading DropDown inside a Gridview

I am trying to obtain the SelectedValue from a DropDownList which is controlled by a CascadingDropDown Control both of which are inside of a gridview. The cascading dropdowns are populating correctly. The SelectedValue is also set on these dropdowns in the OnRowDataBound event.

In the OnRowUpdating event, I am grabbing the dropdownlist's selected value from the updating row using:

string strID = ((

DropDownList)gvPositions.Rows[e.RowIndex].FindControl("ddlLineEdit")).SelectedValue;

When I do this, the value is always null.

I think it might be because you don't reference the cell but only the row. I have a similar example that does work:

DropDownList ddPanes = (DropDownList)grid.Rows[e.RowIndex].Cells[2].FindControl("ddPaneNames");

Hope it helps,

Joe
That was a good thought. I don't have to do that for the other controls in the row, but I tried it. Unfortunately that still give me null as well.
Can you post the markup for your gridview?

Here is my code:

<asp:GridView ID="gvPositions" runat="server" AutoGenerateColumns="False" Width="100%" OnRowEditing="gvEdit" OnRowCancelingEdit="gvCancel" OnRowUpdating="gvUpdate" OnRowCommand="gvItemCommand" OnRowDeleting="gvDelete" OnRowDataBound="gvRowDataBind"> <Columns> <asp:TemplateField HeaderText="positionID" Visible="False"> <ItemTemplate> <asp:Label runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.positionID")%>' ID="lblpositionID"> </asp:Label> </ItemTemplate> <EditItemTemplate> <asp:Label runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.positionID")%>' ID="lblpositionID"> </asp:Label> </EditItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="TDA Version"> <ItemTemplate> <asp:Label runat="server" Text='<%# Eval("tdaName")%>' ID="lbltdaNameGrid"> </asp:Label> </ItemTemplate> <EditItemTemplate> <asp:Label runat="server" ID="lbltdaNameEdit" CssClass="label" Width="100%" Text='<%# DataBinder.Eval(Container, "DataItem.tdaName")%>'> </asp:Label> <asp:DropDownList ID="ddlTDANameEdit" runat="server" AutoPostBack="false" DataSource='<%# GetTDAList()%>' SelectedValue='<%# Eval("tdaVersionID")%>' DataTextField="tdaName" DataValueField="tdaVersionID" ></asp:DropDownList> </EditItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Paragraph"> <ItemTemplate> <asp:Label runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.paragraphTitle")%>' ID="lblParagraphNameGrid"> </asp:Label> </ItemTemplate> <EditItemTemplate> <asp:Label runat="server" ID="lblParagraphEdit" CssClass="label" Width="100%" Text='<%# DataBinder.Eval(Container, "DataItem.paragraphTitle")%>'> </asp:Label> <asp:DropDownList ID="ddlParagraphEdit" runat="server" AutoPostBack="false"></asp:DropDownList> </EditItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Line"> <ItemTemplate> <asp:Label runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.lineTitle")%>' ID="lbltitleGrid"> </asp:Label> </ItemTemplate> <EditItemTemplate> <asp:Label runat="server" ID="lbltitleEdit" CssClass="label" Width="100%" Text='<%# DataBinder.Eval(Container, "DataItem.lineTitle")%>'> </asp:Label> <asp:DropDownList ID="ddlLineEdit" runat="server" AutoPostBack="false"></asp:DropDownList> <cc1:CascadingDropDown ID="CascadingDropDownGridView" runat="server" SuppressValidationScript="true"> <cc1:CascadingDropDownProperties TargetControlID="ddlParagraphEdit" ServiceMethod="GetParagraphsByTDAID" ServicePath="~/AutoCompleteService.asmx" PromptText="Please select a paragraph" Category="tdaVersionID" ParentControlID="ddlTDANameEdit" /> <cc1:CascadingDropDownProperties TargetControlID="ddlLineEdit" ServiceMethod="GetLinesByParagraphID" ServicePath="~/AutoCompleteService.asmx" PromptText="Please select a line" Category="tdaParagraphID" ParentControlID="ddlParagraphEdit" /> </cc1:CascadingDropDown> </EditItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Directorate"> <ItemTemplate> <asp:Label runat="server" ID="lblDirectorate" Text='<%# DataBinder.Eval(Container, "DataItem.directorateSymbol")%>' width="100%"> </asp:Label> </ItemTemplate> <EditItemTemplate> <asp:DropDownList runat="server" id="ddlDirectorate" CssClass="label" Width="100%" DataSource='<%# GetDirectorateList()%>' SelectedIndex='<%# GetSelectedDirectorate(DataBinder.Eval(Container, "DataItem.directorateID").ToString())%>' DataTextField="directorateSymbol" DataValueField="directorateID"> </asp:DropDownList> </EditItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Division" ControlStyle-Width="100px"> <ItemTemplate> <asp:Label runat="server" ID="lblDivision" Text='<%# DataBinder.Eval(Container, "DataItem.officeSymbol")%>' width="100%"> </asp:Label> </ItemTemplate> <EditItemTemplate> <asp:DropDownList runat="server" id="ddlDivision" CssClass="label" Width="100%" DataSource='<%# GetDivisionList()%>' SelectedIndex='<%# GetSelectedDivision(DataBinder.Eval(Container, "DataItem.divisionID").ToString())%>' DataTextField="officeSymbol" DataValueField="divisionID"> </asp:DropDownList> </EditItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Start Date
<ItemTemplate> <asp:Label runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.dateStartText")%>' ID="lblGridDateStart"> </asp:Label> </ItemTemplate> <EditItemTemplate> <asp:TextBox runat="server" ID="txtGridDateStart" CssClass="label" Width="100%" Text='<%# DataBinder.Eval(Container, "DataItem.dateStartText")%>'> </asp:TextBox> </EditItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="End Date
<ItemTemplate> <asp:Label runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.dateEndText")%>' ID="lblGridDateEnd"> </asp:Label> </ItemTemplate> <EditItemTemplate> <asp:TextBox runat="server" ID="txtGridDateEnd" CssClass="label" Width="100%" Text='<%# DataBinder.Eval(Container, "DataItem.dateEndText")%>'> </asp:TextBox> </EditItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Current Position"> <ItemTemplate> <asp:CheckBox ID="chkbxPositionCurrentDisplay" runat="server" Checked='<%# DataBinder.Eval(Container, "DataItem.positionCurrent")%>' Enabled="false" /> </ItemTemplate> <EditItemTemplate> <asp:CheckBox ID="chkbxPositionCurrent" runat="server" Checked='<%# DataBinder.Eval(Container, "DataItem.positionCurrent")%>' /> </EditItemTemplate> </asp:TemplateField> <asp:CommandField ShowEditButton="True" CancelImageUrl="~/images/cancel.gif" ShowDeleteButton="True" DeleteImageUrl="~/images/delete.gif" EditImageUrl="~/images/edit.gif" UpdateImageUrl="~/images/save.gif" ButtonType="Image" /> </Columns> </asp:GridView>

The code I listed above us on a Web User Control called by another Web User Control which is called by a Web Form. I recreated the Gridview on a new page this morning with all the code behind and it worked.

So I am wondering if this has to do with when the Page_Load get called for each control. I would really like to get it to work on the control.


Could this be a symptom the cause of work item 640?

Problem in Binding Gridview through Modal popup

Hi,

I have a gridview inside a Panel which i being is shown byModalPopupExtender, and i am also using

DynamicServiceMethod -- to call a code_behind method , which inturn binds data from a data set to the gridview inside the panel.

But at the front end, i am unable to see any grid, all that i can see is just the empty pop-up(Modal). Need help on how

to bind dynamic data to modal pop.

thanks

Vishaal

It is the continuation of above problem

<ajaxToolkit:ModalPopupExtender

ID="ModalPopupExtender"runat="server"TargetControlID="imgBtnContinue"PopupControlID="pnlDiscounts"BackgroundCssClass="modalBackground"OkControlID="OkButton"OnOkScript="onOk()"CancelControlID="CancelButton"DropShadow="true"PopupDragHandleControlID="Panel3"DynamicServiceMethod="test()" (code behind method)DynamicControlID="gvDiscountDisplay" (grid inside panel) />

when i am clicking "imgBtnContinue" .. an javascript error is raised " Sys.ArgumentException: Value must not be null for Controls and Behaviors.

Parameter name:element


<ajaxToolkit:ModalPopupExtender

ID="ModalPopupExtender"

runat="server"

TargetControlID=" <Set target Id to some dummy control id>"

PopupControlID="pnlDiscounts"

BackgroundCssClass="modalBackground"

OkControlID="OkButton"

OnOkScript="onOk()"

CancelControlID="CancelButton"

DropShadow="true"

PopupDragHandleControlID="Panel3"/>

And in the actual Button click(Code-behind) invoke theModalPopupExtender.show()

-Vishaal

Wednesday, March 21, 2012

Problem in using Atlas with UserControl

Hi,

I have a UserControl named as cppCombo.ascx , that is used inside another combo named as welcome.ascx, and this welcome.ascx is again used in Loginmaster.ascx and finally used in a aspx page.

Now the problem is that at the aspx page i am unable to know the EventName .

If you have any other better option then please post that.

Thanks & regards

shrikant

Try to use the triggers of a asp:UpdatePanel to trigger the events of a user control as the following codes.
<asp:UpdatePanel ID="upnlUserControl" runat="server">
????<ContentTemplate>
?????????<uc1:WebUserControl0 ID="WebUserControl0_1" runat="server" />
????</ContentTemplate>
????<Triggers>
?????????<asp:PostBackTrigger ControlID="WebUserControl0_1" />
????</Triggers>
</asp:UpdatePanel>
Wish this could help you.

I used the same but it shows an error.

Unknown server tag 'asp:PostBackTrigger'.

How should i solve this .


It is impossible that says "Unknown server tag 'asp:PostBackTrigger'" in Ajax Beta 2 or Ajax RC 1.0.Do you download the latest Ajax package and install it in your PC?If not,try to download it from this website - http://ajax.asp.net/default.aspx?tabid=47&subtabid=471 and install it in your PC.It should work fine.If not,can you post some codes here? I'd like to test it.

Actually i was using ATLAS and their was no such tag but now i have downloaded AJAX from the site you provided thanks for this.

Now the problem is that i have to implement AJAX in an already built website. With atlas i just took the ATLAS.dll and put that the bin folder of

my wesite and using its fascility . But now with AJAX i am confused , How should i embed it in the website.

Thanks and Regards

Shrikant


Don't worry about it.If create an old website with Atlas, you can take a look at this materials to upgrade it to the new Ajax RC 1 - http://ajax.asp.net/

Hi, I did the same as it was directed in the URL but now i have received another problem . now it gives an error that,

Sys.WebForms.PageRequestmanagerParserErrorException: The message Received from the server could not be parsed.

Common cause for the error are when the responseis modified by the calls to Response.Write(),response

filters, HttpModules, or server trace is enabled.

Details: Error parsing near '<script language='ja'.


Try to send your ajax website to my email box: v-jicwan@.microsoft.com? I'd like to test it.

Hi, Sorry i cant send you the project as it is not my personal. One reason that could behind this error may be the use of Response.Write

in the project , so now i am trying to replace it some how, soon i will tell you about the status .

Thanks & Regards

Shrikant


Hi, After replacing the Response.Write() now its not showing that error but Show an error from Java Script

Unknown Runtime Error.

Thanks & Regards

Shrikant


You can not use Response.Write method in behind code if you develop a web application based on Ajax framework. Can you post a simple web page with "javascript Unknown Runtime Error"? There are many reasons which can lead to javascript error. It is difficult to fix what causes it.

Hi, At present i am even confused whether i will be able to convert project from ASP.Net 2.0 to AJAX

The code gives error at this line.

updatePanelElement.innerHTML = rendering

Below is the value contained in updatePanelElement.innerHTML

Any other option that can help you to help me, please suggest..

<TABLE id=Table1 height=\"99%\" cellSpacing=0 cellPadding=0 width=\"100%\" border=0>

<TBODY>

<TR>

<TD width=141>

<P align=left>

<DIV id=contentContainer1_ctl00_Welcome1_pnlMain><LINK href=\"..\CSS\CPP.css\" type=text/css rel=stylesheet>

<TABLE id=Table1 style=\"Z-INDEX: 101; LEFT: 8px; WIDTH: 152px; POSITION: absolute; TOP: 2px; HEIGHT: 106.05%\" cellSpacing=0 cellPadding=0 width=152 align=left border=0>

<TBODY>

<TR>

<TD vAlign=top width=141>

<TABLE id=Table2 cellSpacing=0 cellPadding=0 width=\"100%\" border=0>

<TBODY>

<TR>

<TD height=30> </TD></TR>

<TR>

<TD vAlign=top align=left height=108><IMG id=contentContainer1_ctl00_Welcome1_Image1 style=\"BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px\" src=\"Images/Company_Logo.gif\"><A href=\"WelcomeSadmin.htm\" target=mainFrame></A></TD></TR></TBODY></TABLE>

<TABLE id=Table3 cellSpacing=0 cellPadding=0 width=\"100%\" border=0>

<TBODY>

<TR>

<TD align=right>

<DIV id=contentContainer1_ctl00_Welcome1_cppcomboLanguage_pnlMain><LINK href=\"../CSS/CPP.css\" type=text/css rel=stylesheet><SELECT class=FormComponents id=contentContainer1_ctl00_Welcome1_cppcomboLanguage_objDDList style=\"WIDTH: 130px\" onchange=\"javascript:setTimeout('__doPostBack(\'contentContainer1$ctl00$Welcome1$cppcomboLanguage$objDDList\',\'\')', 0)\" name=contentContainer1$ctl00$Welcome1$cppcomboLanguage$objDDList> <OPTION value=\"Select Language\" selected>Select Language</OPTION> <OPTION value=1>English</OPTION></SELECT> </DIV></TD>

<TD> </TD></TR>

<TR>

<TD> </TD>

<TD> </TD></TR>

<TR>

<TD>

<TD></TD></TR></TBODY></TABLE></TD>

<TD width=10> </TD>

<TD vAlign=top width=1 background=imagesred.gif bgColor=#ed252a><IMG height=1 src=\"images/red.gif\" width=1></TD>

<TD width=10> </TD></TR></TBODY></TABLE></DIV>

<P></P>

<P align=left> </P></TD>

<TD>

<P>

<TABLE id=Table6 style=\"HEIGHT: 0.1%\" cellSpacing=1 cellPadding=1 width=\"100%\" align=left border=0>

<TBODY>

<TR>

<TD colSpan=2>

<P align=right>

<DIV id=contentContainer1_ctl00_Toolbar1_pnlMain><LINK href=\"..\CSS\CPP.css\" type=text/css rel=stylesheet>

<P>

<TABLE id=Table1 cellSpacing=0 cellPadding=0 width=609 border=0>

<TBODY>

<TR>

<TD width=956>

<P align=right>

<DIV id=contentContainer1_ctl00_Toolbar1_cmdBarLogin_pnlMain>

<DIV id=PT_dTooltip></DIV>

<TABLE height=\"100%\" cellSpacing=1 cellPadding=1 width=\"100%\" border=0>

<TBODY>

<TR>

<TD vAlign=top align=right height=24>

<TABLE height=24 cellSpacing=1 cellPadding=1 border=0>

<TBODY>

<TR vAlign=top>

<TD><A style=\"CURSOR: hand\" onclick=javascript:Helpdesk();><IMG alt=Helpdesk src=\"images/Helpdesk.gif\" border=0 name=imgHelpdesk></A></TD></TR></TBODY></TABLE></TD></TR>

<TR>

<TD vAlign=top align=right height=1></TD></TR></TBODY></TABLE></DIV>

<P></P></TD></TR></TBODY></TABLE></P></DIV>

<P></P></TD></TR>

<TR>

<TD colSpan=2>

<P align=left>

<DIV id=contentContainer1_ctl00_Region1_region1>

<DIV id=contentContainer1_ctl00_Region1_Login1_pnlMain>

<TABLE style=\"LEFT: 155px; WIDTH: 609px; POSITION: absolute; HEIGHT: 420px\" cellSpacing=0 cellPadding=0 width=609 align=left border=0>

<TBODY>

<TR>

<TD style=\"HEIGHT: 26px\" height=26> </TD></TR>

<TR>

<TD style=\"WIDTH: 501px\" vAlign=top>

<TABLE cellSpacing=0 cellPadding=0 width=\"609%\" border=0>

<TBODY>

<TR>

<TD style=\"HEIGHT: 58px\" height=58> </TD></TR>

<TR>

<TD>

<TABLE cellSpacing=0 cellPadding=0 width=\"100%\" align=center>

<TBODY>

<TR>

<TD style=\"WIDTH: 304px; HEIGHT: 207px\" vAlign=top align=right width=304>

<OBJECT codeBase=https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0 height=208 width=262 classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000><PARAM NAME=\"_cx\" VALUE=\"6932\"><PARAM NAME=\"_cy\" VALUE=\"5503\"><PARAM NAME=\"FlashVars\" VALUE=\"\"><PARAM NAME=\"Movie\" VALUE=\"images/home_movie.swf\"><PARAM NAME=\"Src\" VALUE=\"images/home_movie.swf\"><PARAM NAME=\"WMode\" VALUE=\"Window\"><PARAM NAME=\"Play\" VALUE=\"-1\"><PARAM NAME=\"Loop\" VALUE=\"-1\"><PARAM NAME=\"Quality\" VALUE=\"High\"><PARAM NAME=\"SAlign\" VALUE=\"LT\"><PARAM NAME=\"Menu\" VALUE=\"0\"><PARAM NAME=\"Base\" VALUE=\"\"><PARAM NAME=\"AllowScriptAccess\" VALUE=\"always\"><PARAM NAME=\"Scale\" VALUE=\"NoScale\"><PARAM NAME=\"DeviceFont\" VALUE=\"0\"><PARAM NAME=\"EmbedMovie\" VALUE=\"0\"><PARAM NAME=\"BGColor\" VALUE=\"\"><PARAM NAME=\"SWRemote\" VALUE=\"\"><PARAM NAME=\"MovieData\" VALUE=\"\"><PARAM NAME=\"SeamlessTabbing\" VALUE=\"1\"><PARAM NAME=\"Profile\" VALUE=\"0\"><PARAM NAME=\"ProfileAddress\" VA

LUE=\"\"><PARAM NAME=\"ProfilePort\" VALUE=\"0\"><PARAM NAME=\"AllowNetworking\" VALUE=\"all\">

<embed src=\"../Images/home_movie.swf\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"

width=\"262\" height=\"208px\"> </embed> </OBJECT></TD>

<TD style=\"HEIGHT: 207px\" vAlign=top bgColor=#eeeeee><FORM method=\"post\" action=\"\" name=\"form1\">

<TABLE cellSpacing=0 cellPadding=0 width=\"100%\" border=0>

<TBODY>

<TR>

<TD class=redtext style=\"WIDTH: 164px; HEIGHT: 19px\"> <IMG height=8 src=\"../Images/Icon_Login.gif\"> <SPAN id=contentContainer1_ctl00_Region1_Login1_loglblLogin style=\"DISPLAY: inline-block; WIDTH: 112px\">Login</SPAN></TD></TR>

<TR>

<TD style=\"WIDTH: 164px\" height=8></TD>

<TD></TD></TR></TBODY></TABLE>

<TABLE cellSpacing=2 cellPadding=2 width=\"100%\" border=0>

<TBODY>

<TR>

<TD style=\"WIDTH: 2px; HEIGHT: 28px\" width=2> </TD>

<TD class=GreyText1 style=\"WIDTH: 93px; HEIGHT: 28px\" align=right width=93><SPAN id=contentContainer1_ctl00_Region1_Login1_loglblDisplayLogin style=\"DISPLAY: inline-block; WIDTH: 80px\">Login</SPAN></TD>

<TD class=GreyText1 style=\"WIDTH: 128px; HEIGHT: 28px\" align=right width=128>

<P align=left><INPUT class=inputText id=contentContainer1_ctl00_Region1_Login1_txtUserName style=\"WIDTH: 144px; BORDER-TOP-STYLE: groove; BORDER-RIGHT-STYLE: groove; BORDER-LEFT-STYLE: groove; HEIGHT: 24px; BORDER-BOTTOM-STYLE: groove\" name=contentContainer1$ctl00$Region1$Login1$txtUserName></P></TD>

<TD class=GreyText1 style=\"HEIGHT: 28px\"> </TD></TR>

<TR>

<TD style=\"WIDTH: 2px\" height=8></TD>

<TD style=\"WIDTH: 93px\">

<TD style=\"WIDTH: 128px\"></TD>

<TD></TD></TR>

<TR>

<TD style=\"WIDTH: 2px\"> </TD>

<TD class=GreyText1 style=\"WIDTH: 93px\" align=right><SPAN id=contentContainer1_ctl00_Region1_Login1_loglblPassword style=\"DISPLAY: inline-block; WIDTH: 80px\">Password</SPAN></TD>

<TD class=GreyText1 style=\"WIDTH: 128px\" align=right>

<P align=left><INPUT class=inputText id=contentContainer1_ctl00_Region1_Login1_txtPassword style=\"WIDTH: 144px; BORDER-TOP-STYLE: groove; BORDER-RIGHT-STYLE: groove; BORDER-LEFT-STYLE: groove; HEIGHT: 24px; BORDER-BOTTOM-STYLE: groove\" type=password maxLength=25 value=\"\" name=contentContainer1$ctl00$Region1$Login1$txtPassword></P></TD>

<TD class=GreyText1><INPUT id=contentContainer1_ctl00_Region1_Login1_imgbttnSubmit style=\"BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px\" onclick=\"if (typeof(Page_ClientValidate) == 'function') Page_ClientValidate();\" type=image src=\"Images/Submit.gif\" name=contentContainer1$ctl00$Region1$Login1$imgbttnSubmit></TD></TR>

<TR>

<TD style=\"WIDTH: 2px\"> </TD>

<TD style=\"WIDTH: 93px\"> </TD>

<TD class=RedText style=\"WIDTH: 128px\" align=right>

<P class=GreyText0 align=left><A class=HlinkText id=contentContainer1_ctl00_Region1_Login1_loglnkbttnForgotPassword style=\"DISPLAY: inline-block; WIDTH: 136px\" href=\"javascript:__doPostBack('contentContainer1$ctl00$Region1$Login1$loglnkbttnForgotPassword','')\">Forgot Password</A><A class=GreyText1 href=\"ForgotPassword.aspx\" target=\"\"></A></P></TD>

<TD> </TD></TR></TBODY></TABLE></FORM></TD></TR></TBODY></TABLE></TD></TR>

<TR>

<TD style=\"HEIGHT: 54px\" height=54> </TD></TR></TBODY></TABLE>

<TABLE id=Table1 cellSpacing=0 cellPadding=0 width=609 border=0>

<TBODY>

<TR>

<TD class=GreyText1 align=middle bgColor=#eeeeee height=24><SPAN id=contentContainer1_ctl00_Region1_Login1_loglblCopyright style=\"DISPLAY: inline-block; WIDTH: 383px\">Copyright ? Canon 2005. Best viewed in IE 6.0 and above</SPAN> <A id=contentContainer1_ctl00_Region1_Login1_loglblDownload style=\"DISPLAY: inline-block; WIDTH: 147px\" href=\"javascript:__doPostBack('contentContainer1$ctl00$Region1$Login1$loglblDownload','')\">Download IE 6.0</A></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></DIV></DIV>

<P></P></TD></TR>

<TR></TR></TBODY></TABLE></P></TD></TR></TBODY></TABLE>


I recommend you to remove the updatepanels, and validate your page. The above innerHTML value is definitely not a valid HTML content (for example multiple "Table1" values for id, using deprecated attributes etc.). When your page is validated againts some doctype (HTML 4.0 or XHTML 1.0) try again the updatepanel. Maybe this helps.


sorry, I am unable to get this.

How can i replace asp:UpdatePanel because without this how i will be able to update the page asyn.

Please make it more with some example ,if possible


I recommend to remove the updatepanels only because it help to validate your page. "Simply" comment out the updatepanel controls in the aspx file, and also comment out any updatepanel's related code in the code behind file. Then your page should work in the normal "old" way. Play with the page (try pushing your buttons etc.), and validateeachtime. Probably you will get some validation errors.

The easiest way (for me) to validate my pages in the browser (not in visual studio ide!), using firefox with the "web developer" add-in, there is also a similar add-in for ie. Or you can go to http://validator.w3.org/ directly.

At least incorrectly nested elements (if you have this error), and double ids (I think you have this error) should be corrected some way.

After you corrected the errors, "put back" the updatepanel and try again.

Problem of Validation Controls With AJAX Panel.

Hi All,

I am facing a problem when using validators inside AJAX update panel. The scenario is that i have some requiredFieldValidators inside AJAX Update Panel. When partial post back occours then validators do not show error message, its another things that page also not submites.

Can any one help me in this regard.
Thanks.

acording to me, AJAX and asp.net validation controls doent go well with each other. You try using ajax validation control


Disable the the client side scripts of those validators, otherwise checkout this threadhttp://forums.asp.net/t/1066821.aspx