Showing posts with label panel. Show all posts
Showing posts with label panel. Show all posts

Wednesday, March 28, 2012

control inside an update panel not updated

i have a dropdown list inside an update panel of ajax, i have a button that says "Add" on the click event of the button i will load a pop-up screen. the popup screen works as entry area of the drop down list i have mentioned. upon saving and unloading the pop-up screen, it should update the dropdown list contents. any help please, this is my first time to handle ajax..

Hi,

You question is about cross window scripting.

First, find the dropdownlist in the parent control.

var ddl = window.opener.document.getElementById("id of the ddl");

then add new item into it:

ddl.options.add("new value");

Hope this helps.

Control focus on autopostback in UpdatePanel

I have an Update Panel with a bunch of textboxes, and have code for the _onTextChanged events of some of them, so I have enabled AutoPostBack=true.
This is a data entry screen, so the TabIndex is critical. In Mozilla, when the textbox posts back, the TabIndex moves to the next box as expected. In IE, the reload of the page seems to reset the TabIndex to the first textbox.

Any ideas on how I can make my code behave in IE like it does in Mozilla?

ThanksActually, I asked same question yesterday. Unfortunately, no answers yet.
You could use Control.Focus(), to manually set the focus to the next control (either in the server code or with javascript).
That's the strange thing about it... I already had that, and I watch it work in stepping through the _onTextChanged of the control, but then the focus just gets changed/set to nothing after my code set it properly...

control cannot be created because visual studio cannot find the controls type in the contr

Just installed Ajax extensions and ajax control toolkit for Vs2005.All fine.

I can drag drop update panel or script manager.

But if I do so with ajax toolkit controls I get a a error as : "control cannot be created because visual studio cannot find the control's type in the control assembly".

I have downloaded and worked with the toolkit at my home comp and it works all fine. But here at my work its giving me this problem.

I googled up to see any solutions but dint find much help!!

So any help with this would be appreciated!! Thanks!!


Hey guys!!

Anyone for the solution??


Did you remember to register it in the GAC? On your work PC, it may not have done that automagically.


Hey thanks for that.

It did work out.

Strange I have added toolkit on couple of PC's and never saw this error.

Just added the Dll to Gac and the problem is solved on my box.

Thanks.

Content Page Problem

Hi;

I have a masterpage with a script manager and a collapse panel.

It works fine but the Content page I created containing an update panel for a grid just ignores the atlas updatepanel.

If I remove the association with the master page and add a script manger the updatepanel works fine.

I can't seem to find the problem, can anyone give me some guidance on this problem?

Thanks

Without much to go on, I'd guess that you might need to use aScriptManagerProxy.


I tried a script manager proxy it didn't help, but I was unsure of what needed to be set also I am only using the basic implementation of the updatepanel and not using any additional scripts. It seems that the master isn't communicating properly with the content page.

Here is the part of the master with the scriptmanager:

<%@.MasterLanguage="VB"CodeFile="HypnosMasterPage.master.vb"Inherits="HypnosMasterPage" %>

<%@.RegisterAssembly="AtlasControlToolkit"Namespace="AtlasControlToolkit"TagPrefix="cc1" %>

<!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<htmlxmlns="http://www.w3.org/1999/xhtml">

<headrunat="server">

<title>Untitled Page</title>

<atlas:ScriptManagerID="ScriptManager1"runat="server"></atlas:ScriptManager>

</head>

<body>

<formid="form1"runat="server">

Here is the pertinent part of contentpage: Also it is in a subfolder one level below the location of the master page

<%@.PageLanguage="VB"MasterPageFile="~/HypnosMasterPage.master"AutoEventWireup="false"CodeFile="UserLookup.aspx.cs"Inherits="UserLookup"Title="UserLookup" %>

<%@.RegisterAssembly="AtlasControlToolkit"Namespace="AtlasControlToolkit"TagPrefix="atlasToolkit" %>

<asp:ContentID="Content1"ContentPlaceHolderID="ContentPlaceHolder1"Runat="Server">

<atlas:UpdatePanelID="UpdatePanel1"runat="server"Mode="Conditional">

<ContentTemplate>

<asp:GridViewrunat="server"ID="grid"></asp:GridView>

</ContentTemplate>

<Triggers>

<atlas:ControlEventTriggerControlID="btnGo"EventName="Click"/>

<atlas:ControlEventTriggerControlID="txtPatientSearch"EventName="TextChanged"/>

</Triggers>

</atlas:UpdatePanel>

Any thoughts?

Len


When I looked at the html again I found my own problem missing enable attribute, sorry to take up your time thanks for the tips.

Len

Content disapears on update of updatepanel inside of another updatepanel! Plz help.

Hi i have a problem, i have a UpdatePanel(UpdatePanel3) with a Panel(contentPanel)inside after clicking on the LinkButton(homeLinkButton)I add a Control(home.ascx) to Panel(contentPanel) in that control i have another UpdatePanel(homeUpdatePanel) and a Button(Button1), when i click on that button the whole content of Panel(contenPanel) disapears, how do i solve it and get a update of the dynamicly added UpdatePanel(homeUpdatePanel) inside of Panel(contentPanel)?

Default.aspx

1<form id="form1" runat="server">2 <asp:ScriptManager ID="ScriptManager1" runat="server" />3 <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">4 <ContentTemplate>5 <table style="width: 584px; height: 248px">6 <tr>7 <td style="width: 162px; height: 175px" valign="top">8 <asp:LinkButton ID="homeLinkButton" runat="server" OnClick="homeLinkButton_Click">Home</asp:LinkButton><br />9 <asp:LinkButton ID="uploadLinkButton" runat="server" OnClick="LinkButton3_Click">Upload</asp:LinkButton>10 <br />11 <asp:LinkButton ID="zoekenLinkButton" runat="server">Zoeken</asp:LinkButton></td>12 <td rowspan="2" valign="top">13 <asp:UpdatePanel ID="UpdatePanel3" runat="server" UpdateMode="Conditional">14 <ContentTemplate>15 <asp:Panel ID="contentPanel" runat="server" Height="184px" Width="392px">16  </asp:Panel>17 </ContentTemplate>18 <Triggers>19 <asp:AsyncPostBackTrigger ControlID="homeLinkButton" />20 </Triggers>21 </asp:UpdatePanel>22 </td>23 </tr>24 <tr>25 <td style="width: 162px">26 </td>27 </tr>28 </table>29 </ContentTemplate>30 </asp:UpdatePanel>31 </form>
Default.aspx.vb
12Protected Sub homeLinkButton_Click(ByVal senderAs Object,ByVal eAs System.EventArgs)3Dim clAs Control4 cl = LoadControl("home.ascx")5 contentPanel.Controls.Add(cl)6 UpdatePanel3.Update()7End Sub8
home.ascx
1<%@dotnet.itags.org. Control Language="VB" AutoEventWireup="false" CodeFile="home.ascx.vb" Inherits="home" %>2Dit is dan onze Home pagina die dymanisch wordt opgeladen.<br />3Pagina was geladen op4<asp:Label ID="pageLoadLabel" runat="server"></asp:Label><br />5<asp:UpdatePanel ID="homeUpdatePanel" runat="server" UpdateMode="Conditional">6 <ContentTemplate>7<asp:Label ID="timeLabel" runat="server"></asp:Label>8 </ContentTemplate>9 <Triggers>10 <asp:AsyncPostBackTrigger ControlID="Button1" />11 </Triggers>12</asp:UpdatePanel>13<asp:Button ID="Button1" runat="server" Text="Button" Width="160px" />
home.ascx.vb
1Protected Sub Page_Load(ByVal senderAs Object,ByVal eAs System.EventArgs)Handles Me.Load2 timeLabel.Text = DateTime.Now3 pageLoadLabel.Text = DateTime.Now4End Sub56 Protected Sub Button1_Click(ByVal senderAs Object,ByVal eAs System.EventArgs)Handles Button1.Click7 timeLabel.Text = DateTime.Now8End Sub
Thx, Me

Hi,

Thank you for your post!

I think this is a known issue,It is something about Dynamicaly loading User Controls into UpdatePanel.

You can see the following threads too:

http://forums.asp.net/p/1156704/1906671.aspx#1906671

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

If you have further questions,let me know.

Best Regards,

Monday, March 26, 2012

Conflict between IE7 and AJAX update panel

I think I found a bug in Microsoft Explorer 7. When I launch a modal popupwindow or a java alert box (using ScriptManager.RegisterClientScriptBlock) from within an Update Panel, the whole screen is being pushed about 15 pixels downwards, if the page has a masterpage. It seems to work alright for pages without masterpages.

I have tested my application in IE6, IE7 and Mozilla Firefox. Internet Explorer 7 is the only browser having this issue. It doesn't matter if the update panel encapsulates just the button or everything in the content page, the problem is still there. It seems to me now that my only option is to detach all content pages with this issue from the master page by creating duplicate menus.

If anyone knows something please let me know.

Can you post some codes here??I'd?like?to?test?it?in?IF?7.0.

I discovered that the problem occurs even when a button is clicked.

Steps to replicate the error.

1. Go New Website, ASP.NET AJAX CTP enabled website/Visual Basic

2. Create MasterPage.master

3. Create Default2.aspx with MasterPage.master as masterpage

4. Copy the following block to Default.aspx(Source)

<%@. Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="Default2.aspx.vb" Inherits="Default2" title="Untitled Page" %><asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <asp:Panel ID="Panel1" runat="server" Height="50px" Width="125px"> <asp:UpdatePanel id="x" runat="server"> <ContentTemplate><asp:Button id="Button1" runat="server" Text="Button" ></asp:Button> </ContentTemplate> </asp:UpdatePanel> </asp:Panel></asp:Content>

5. Copy the following block to MasterPage.master(Source)

<%@. Master Language="VB" CodeFile="MasterPage.master.vb" Inherits="MasterPage" %><!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 id="Head1" runat="server"> <title>Untitled Page</title> </head><body> <form id="form1" runat="server"> <asp:ScriptManager ID="ModalPopUpTestExScriptmanager" runat="server"> </asp:ScriptManager> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> </asp:UpdatePanel> <asp:contentplaceholder id="ContentPlaceHolder1" runat="server"> </asp:contentplaceholder> </form></body></html>

6. Start the application and click the button. If you use IE7 as a browser the button will be relocated when you click it the first time. It works for me in Firefox and IE6.


Correction: Item no 4 should be: "4. Copy the following block to Default2.aspx(Source)" and nothing else


When I remove the update panel from the master page everything function normally. The problem seems to happen in IE7 especially when both the content page and master page have an update panel each. Personally, I don't need an update panel in my masterpage. The update panel in my masterpage was completely redundant and unnecessary. The reason I had it there at all is that I was experimenting some time ago with top menus in update panels and I must have forgotten to remove it. Thanks
I installed Visual Studio .NET 2005 with Ajax RC 1.0 and Futures Dec CTP in my PC and tested your codes in your?last?post. I?found?it?worked?fine?in?IE?7.0.
Try to add "<asp:ScriptManagerProxy runat="server"></asp:ScriptManagerProxy>" to the content page?as?the?following and check if it works.
<%@. Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="Default2.aspx.vb" Inherits="Default2" title="Untitled Page" %
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:ScriptManagerProxy runat="server"></asp:ScriptManagerProxy>
<asp:Panel ID="Panel1" runat="server" Height="50px" Width="125px">
<asp:UpdatePanel id="x" runat="server">
<ContentTemplate>
<asp:Button id="Button1" runat="server" Text="Button" ></asp:Button>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Panel>
</asp:Content>
Wish the above can help you.
I installed Visual Studio .NET 2005 with Ajax RC 1.0 and Futures Dec CTP in my PC and tested your codes in your?last?post. I?found?it?worked?fine?in?IE?7.0.
Try to add "<asp:ScriptManagerProxy runat="server"></asp:ScriptManagerProxy>" to the content page?as?the?following and check if it works.
<%@. Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="Default2.aspx.vb" Inherits="Default2" title="Untitled Page" %
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:ScriptManagerProxy runat="server"></asp:ScriptManagerProxy>
<asp:Panel ID="Panel1" runat="server" Height="50px" Width="125px">
<asp:UpdatePanel id="x" runat="server">
<ContentTemplate>
<asp:Button id="Button1" runat="server" Text="Button" ></asp:Button>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Panel>
</asp:Content>
Wish the above can help you.

ConfirmButton not working

Hi,

I have a page with an update panel and a repeater inside the panel. I have a multi view inside the repeater item template. In that multiview, I have a view with a delete button and a confirm button extender. When you click on the delete button, the confirm alert appears (not always), but at the same time an asyncrhonous postback occurs, the record is deleted by the code behind page and the page is refeshed, but you have not clicked 'OK' nor "Cancel" yet.

Note: Using Beta

Here is the web page:

<%@dotnet.itags.org. Page Language="C#" AutoEventWireup="true" CodeFile="Templates.aspx.cs" Inherits="Templates" %>
<%@dotnet.itags.org. Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>

<!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">
<div>
<asp:ScriptManager ID="sm" runat = "server" />
<asp:ObjectDataSource ID="CategoriesDataSource" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetCategories" TypeName="DataLayer.ProtocolCategory"></asp:ObjectDataSource>
Select a category:
<asp:DropDownList ID="CategoriesDropDown" runat="server"
DataSourceID="CategoriesDataSource" DataTextField="CategoryName"
DataValueField="CategoryID" Width="250px"
AutoPostBack = "true" />
<br /><br /><hr /><br />
<asp:UpdatePanel ID="up" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:ObjectDataSource ID="TemplatesDataSource" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetTemplates" TypeName="DataLayer.ProtocolTemplate">
<SelectParameters>
<asp:ControlParameter ControlID="CategoriesDropDown" DefaultValue="0" Name="CategoryID"
PropertyName="SelectedValue" Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
<table border="1" width="100%" >
<thead>
<tr>
<td align="center" colspan="4">Available templates</td>
</tr>
<tr>
<td width="25%">Name</td>
<td width="70%">Description</td>
</tr>
</thead>
<tbody>
<asp:Repeater ID="TemplatesRepeater" runat="server"
DataSourceID="TemplatesDataSource" OnItemCommand="TemplatesRepeater_ItemCommand" >
<ItemTemplate>
<tr>
<asp:MultiView ID="ItemMultiView" runat="server" ActiveViewIndex="0">
<asp:View ID="ReadOnlyView" runat = "server">
<td>
<asp:Label ID="NameLabel" runat="server"
Text= '<%# Eval("TemplateName") %>' />
</td>
<td>
<asp:Label ID="DescriptionLabel" runat="server"
Text = '<%# Eval("Description") %>' />
</td>
<td>
<asp:Button ID="EditButton" runat ="server"
CommandName="edit" Text="Edit" />
</td>
<td>
<asp:Button ID="DeleteButton" runat = "server" UseSubmitBehavior="false"
CommandName = "delete" Text= "Delete"
CommandArgument = '<%# Eval("TemplateID") %>' />
<ajaxToolkit:ConfirmButtonExtender ID ="ConfirmButton" runat="server"
ConfirmText = "You are about to delete this template. Click ok to proceed"
TargetControlID = "DeleteButton" />
</td>
</asp:View>
<asp:View ID="EditView" runat="server">
<td>
<asp:TextBox ID="NameTextBox" runat ="server"
Text= '<%# Eval("TemplateName") %>' />
</td>
<td>
<asp:TextBox ID="DescriptionTextBox" runat="server"
Text = '<%# Eval("Description") %>' />
</td>
<td>
<asp:Button ID = "SaveButton" runat = "server"
CommandName= "save" Text = "Save"
CommandArgument = '<%# Eval("TemplateID") %>' />
</td>
<td>
<asp:Button ID = "CancelButton" runat = "server"
CommandName = "cancel" Text = "Cancel" />
</td>
</asp:View>
</asp:MultiView>
</tr>
</ItemTemplate>
<FooterTemplate>
<td>
<asp:TextBox ID="NameTextBox" runat ="server"
Text= '<%# Eval("TemplateName") %>' />
</td>
<td>
<asp:TextBox ID="DescriptionTextBox" runat="server"
Text = '<%# Eval("Description") %>' />
</td>
<td>
<asp:Button ID = "AddButton" runat = "server"
CommandName= "add" Text = "Add" />
</td>
</FooterTemplate>
</asp:Repeater>
</tbody>
</table>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="CategoriesDropDown" EventName="SelectedIndexChanged" />
</Triggers>

</asp:UpdatePanel>
</div>
</form>
</body>
</html>

And a fraction of code behind:

protected void TemplatesRepeater_ItemCommand(object source, RepeaterCommandEventArgs e)
{
if (e.CommandName == "edit")
EditItem(e);
else if (e.CommandName == "cancel")
CancelItem(e);
else if (e.CommandName == "save")
SaveItem(e);
else if (e.CommandName == "delete")
DeleteItem(e);
else if (e.CommandName == "add")
AddItem(e);

}

private void DeleteItem(RepeaterCommandEventArgs e)
{
int TemplateID = int.Parse((string) e.CommandArgument);
DataLayer.ProtocolTemplate.DeleteTemplate(TemplateID);
this.TemplatesRepeater.DataBind();
}

I have removed the update panel, but still does not work.

The first time the page is rendered (HTTP GET) no AjaxControlToolkit.ConfirmButtonBehavior are created.

When you click on the delete button a regular postback occurs, the row is deleted and I get the following error on a browser alert:

Line: 1960
Error: Sys.ArgumentException:Value must not be null for Controls and Behaviors
Parameter name:element

The page source code contains the following javascript code:

Sys.Application.add_init(function() {
$create(AjaxControlToolkit.ConfirmButtonBehavior, {"ConfirmText":"You are about to delete this template. Click ok to proceed","id":"ConfirmButton"}, null, null, $get('DeleteButton'));
});
Sys.Application.add_init(function() {
$create(AjaxControlToolkit.ConfirmButtonBehavior, {"ConfirmText":"You are about to delete this template. Click ok to proceed","id":"TemplatesRepeater_ctl00_ConfirmButton"}, null, null, $get('TemplatesRepeater_ctl00_DeleteButton'));
});
Sys.Application.add_init(function() {
$create(AjaxControlToolkit.ConfirmButtonBehavior, {"ConfirmText":"You are about to delete this template. Click ok to proceed","id":"TemplatesRepeater_ctl01_ConfirmButton"}, null, null, $get('TemplatesRepeater_ctl01_DeleteButton'));
});

Obviously the first $create call fails because $get('DeleteButton') returns null since 'DeleteButton' does not exist.

If you continue clicking delete buttons you continue getting these errors, no confirmation alert message is shown.

Confirm button is the simplest control in Ajax Control Toolkit. I think at least this one should work :-(


I'm getting the exact same thing, except I am using a DataList instead of a Repeater.

I have decided not to use confirm button, instead I'm using the following:

 <script type="text/javascript"> function ConfirmDelete(e) { if (!window.confirm("You are about to delete this categorie.\nClick OK to proceed, cancel otherwise")) { e.returnValue = false; if (e.preventDefault) e.preventDefault(); return false; } } </script>
<asp:ImageButton ID="DeleteButton" runat ="server"
ImageUrl ="Images/delete.png" Height="16px" Width="16px"
CommandName ="delete" ToolTip="Delete"
CommandArgument ='<%# Eval("HospitalID")%>'
OnClientClick="ConfirmDelete(event);"
/>
Did this issue get resolved? I'm also finding that my ConfirmButton control is not in an Update panel.
Please try your scenario with the recently available10301 release of the Toolkit (andASP.NET AJAX 1.0). If the problem persists, then please reply with acomplete, simple, self-contained sample page that demonstrates the problem so that we can investigate the specific behavior you're seeing. Thank you!

Saturday, March 24, 2012

Confirmation message on modal popup after postback, before it closes

A modalpopup closes immediately after a postback...but is there anyway that I can display a confirmation message on the modalpopup panel before the modalpopup closes?

Hi champ1979,

There are probably a few different ways you could do this. I think the easiest would be to use fake Ok/Cancel buttons and hide the real OK/Cancel buttons (using "display: none"). Then when the fake buttons are clicked, have them display the confirmation and finally call .click() on the real button.

Thanks,
Ted

I'm not quite sure I understand. You mean display the confirmation message before the real button is processed? How would I know if the action was a success or a failure? Or did I miss what you were trying to say?

Also, do I have to do this via JavaScript?

Thanks!


Could you perhaps give a code snippet? It seems like the moment I have a postback, the panel disappears, even if the postback trigger control (the OkButton) is not associated with the modalPopup OkButton attribute. I would like the Panel to stay open until the user manually clicks on a "close" button or icon.


Thanks in advance!


Hi champ1979,

I guess I'm not quite following what you're trying to accomplish here. There's no way to stop aModalPopup from closing after a full postback (because it wasn't actually opened in that postback yet). To work around this, you should wrap any of your controls that have server events inside anUpdatePanel (but theUpdatePanelshould still be inside the popup). I'm also not sure kind of confirmation message we're talking about. Here's some code showing what I think you might have in mind:

<%@. Page Language="C#" %><%@. Register Assembly="AtlasControlToolkit" Namespace="AtlasControlToolkit" TagPrefix="atlasToolkit" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server"> protected void Other_Click(object sender, EventArgs e) { Other.Style[HtmlTextWriterStyle.Display] = "none"; }</script><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"><title>Test Page</title></head><body><form runat="server"><div> <atlas:ScriptManager ID="ScriptManager" runat="server" EnablePartialRendering="true" /> <asp:LinkButton ID="Open" runat="server" Text="Open" /> <asp:Panel ID="Popup" runat="server" CssClass="modalPopup" style="display:none; border:solid 1px #000000;"> <atlas:UpdatePanel ID="Update" runat="server" Mode="Always"> <ContentTemplate> Popup!<br /> <asp:Button ID="Other" runat="server" Text="Other" OnClick="Other_Click" /><br /> </ContentTemplate> </atlas:UpdatePanel> <asp:Button ID="FakeOk" runat="server" Text="OK" OnClientClick="if (confirm('Close popup?')) { $('Ok').click(); } return false;"></asp:Button> <asp:Button ID="FakeCancel" runat="server" Text="Cancel" OnClientClick="if (confirm('Close popup?')) { $('Cancel').click(); } return false;"></asp:Button> <asp:Button ID="Ok" runat="server" Text="OK" Style="display: none;"></asp:Button> <asp:Button ID="Cancel" runat="server" Text="Cancel" Style="display: none;"></asp:Button> </asp:Panel> <atlasToolkit:ModalPopupExtender ID="ModalPopupExtender" runat="server"> <atlasToolkit:ModalPopupProperties TargetControlID="Open" PopupControlID="Popup" OkControlID="Ok" CancelControlID="Cancel" /> </atlasToolkit:ModalPopupExtender></div></form></body></html>

Hopefully this helps. If you have any other questions, just keep posting.

Thanks,
Ted

Thanks for your response and sorry for the confusion. What I really meant by a confirmation message is,after a user presses the OkButton, I want a message to be displayed to the user before the popup closes. Something like "Your comment was posted successfully. The moderator will have to approve it before it appears", or "There was an en error posting your comment. Please try again later".

I guess my terminology was wrong, but I think it should be clearer now.

Please let me know if this sort of thing is possible.

Thanks!


OK, actually the update panel did the job. Thanks :-)

Hi,

I'm glad I could help.

Thanks,
Ted


Ted,

Along these same lines. If I have a radio button list and a drop down list inside an update panel which are all in the Modalpopup, theoretically, I should be able to click a value in the rbl and have it update the ddl's values, without it hiding my modal popup? I am unable to get that to work so far.

Thanks,

Shep


Ted Glaza [MSFT]:

Hi champ1979,

I guess I'm not quite following what you're trying to accomplish here. There's no way to stop aModalPopup from closing after a full postback (because it wasn't actually opened in that postback yet). To work around this, you should wrap any of your controls that have server events inside anUpdatePanel (but theUpdatePanelshould still be inside the popup).

This suggestion is exactly what I was looking for, Ted, the only problem is that I am having some trouble implementing it. I was hoping maybe you or another member might be able to help. I have a modalpopup with two list boxes and two buttons: add and remove. The add button should move the selections from listbox #1 to listbox #2 and the remove button obviously does the opposite. I have two server side events wired up to the buttons. All of this is wrapped up in an UpdatePanel, which is inside a regular Panel that is extended by a ModalPopup control. The problem is that clicking one of the buttons nevertheless causes the modalpopup to disappear. I would expect that the postback would cause a partial page render just inside the UpdatePanel, but that does not seem to be occurring. Here is the code in question:

1 <asp:Panel ID="EmailRecipientsPopupPanel" runat="server" Width="600px" Height="410px" style="display: none" CssClass="modalPopup">23 <asp:SqlDataSource ID="RecipientsEmailAddressesDataSource" runat="server" ConnectionString='<%$ ConnectionStrings:PollingDBConnectionString%>' SelectCommand="SELECT ea.[EmailAddressId], ea.[EmailAddress] FROM EmailAddresses ea WHERE ea.[EmailAddressId] NOT IN (SELECT r.[EmailAddressId] FROM Recipients r WHERE r.[RecipientsGroupId] = @.Recipients);">4 <SelectParameters>5 <asp:ControlParameter ControlID="EmailRecipients" Name="Recipients" PropertyName="Value" Type="Int32" />6 </SelectParameters>7 </asp:SqlDataSource>8 <asp:SqlDataSource ID="EmailRecipientsDataSource" runat="server" ConnectionString='<%$ ConnectionStrings:PollingDBConnectionString%>' SelectCommand="SELECT ea.[EmailAddressId], ea.[EmailAddress] FROM Recipients r JOIN EmailAddresses ea ON r.[EmailAddressId] = ea.[EmailAddressId] WHERE r.[RecipientsGroupId] = @.Recipients;">9 <SelectParameters>10 <asp:ControlParameter ControlID="EmailRecipients" Name="Recipients" PropertyName="Value" Type="Int32" />11 </SelectParameters>12 </asp:SqlDataSource>13 <asp:Label ID="EmailRecipientsPopupPanelLabel" runat="server" CssClass="popupWindowLabel">Edit email recipients<br /><br /></asp:Label>14 <asp:UpdatePanel ID="EmailRecipientsUpdatePanel" runat="server">1516 <ContentTemplate>1718 <table border="0" width="100%" align="center">1920 <thead>2122 <tr>2324 <th align="center">Email Addresses</th>25 <th></th>26 <th align="center">Email Recipients</th>2728 </tr>2930 </thead>31 <tbody>3233 <tr>3435 <td align="right"><asp:ListBox ID="RecipientsEmailAddressesListBox" runat="server" SelectionMode="Multiple" DataSourceID="RecipientsEmailAddressesDataSource" DataTextField="EmailAddress" DataValueField="EmailAddressId" Rows="20" Width="100%" /></td>36 <td align="center" valign="middle"><asp:Button ID="AddRecipientsButton" runat="server" Text=">>" OnClick="AddRecipientsButton_Click" /><br /><br /><asp:Button ID="RemoveRecipientsButton" runat="server" Text="<<" OnClick="RemoveRecipientsButton_Click" /></td>37 <td align="left"><asp:ListBox ID="EmailRecipientsListBox" runat="server" SelectionMode="Multiple" DataSourceID="EmailRecipientsDataSource" DataTextField="EmailAddress" DataValueField="EmailAddressId" Rows="20" Width="100%" /></td>3839 </tr>4041 </tbody>4243 </table>4445 </ContentTemplate>4647 </asp:UpdatePanel>48 <asp:Button ID="EmailRecipientsOk" runat="server" Text="OK" OnClick="EmailRecipientsOk_Click" /> <asp:Button ID="EmailRecipientsCancel" runat="server" Text="Cancel" OnClick="EmailRecipientsCancel_Click" />4950 </asp:Panel>51 <ajax:ModalPopupExtender ID="EmailRecipientsPopup" runat="server" TargetControlID="EmailRecipientsPopupLink" PopupControlID="EmailRecipientsPopupPanel" BackgroundCssClass="modalBackground" />
I'm hoping I'm just doing something wrong and I can actually get this to work the way I want.


I was just thinking about something. Could the fact that I have this UpdatePanel nested in another one have something to do with it? If I had to guess I would imagine that nesting an UpdatePanel in another UpdatePanel probably doesn't "hide" the nested UpdatePanel's child controls from the parent UpdatePanel's. Do I need to disable ChildControlsAsTriggers and manually add all of the controls that should cause postbacks?
Okay, nevermind. I mistakenly thought that the UpdateMode is Conditional by default. It looks like it is "Always." I changed the UpdateMode of the parent UpdatePanel to Conditional and everything worked as expected.

Ok that has been driving me crazy for the last few days. Thanks MetalJon, that solved my issue. I have several update panels within each other and setting Conditional in the parent and parent/parent update panel did the trick.

Confirm deleting using ModalPopup in GridView

Hi there!

I want to confirm deleting row from GridView using a ModalPopup Extender. Please tell me, how can I do it?

I.e., how to show ModalPopup Panel when user click a Delete button, and how to cansel deleting when user click a Cansel button on ModalPopup Panel and confirm deleting when click a OK Button.

Please, someone, help meCrying


check this article to show modalpopup and do postback when you click the 'OK' button on the ModalPopup.

http://www.aspdotnetcodes.com/ModalPopup_Postback.aspx

Configuration Error - install or VISTA problem?

I have just installed the Ajax toolkit and have tried to add an AJAX Update panel to a Content page. I get the below error. Was I suppossed to add something to my WebConfig file? PublicKetTokens were edited for security (was that necessary?)

Configuration Error

Description:An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message:Could not load file or assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=xcxxcxcxcxcxcxcx' or one of its dependencies. The system cannot find the file specified.

Source Error:

Line 20: <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=fdfddfdfdfddfd"/>Line 21: <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=wewewewewewewewe"/>Line 22: <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=xcxcxcxcxxxcxcx"/></assemblies>Line 23: </compilation>Line 24: <pages>


Source File:E:\xxx\xxxx_com\web\web.config Line:22

Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=xcxcxcxcxcxcxcxc' could not be loaded.

WRN: Assembly binding logging is turned OFF.To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.Note: There is some performance penalty associated with assembly bind failure logging.To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

Just discovered that the below statement was added to my configuration file, I think when I may have added a ScriptManager to one of my MasterPages. When I remove it the website starts working. With it in, the website does not pull up at all. (edited PublicKeyToken)

<

addassembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=vvbvbvbvbvvbvbbvb"/>

Wednesday, March 21, 2012

Concern.. Repeater Control and Update Panel.

Hello everybody,

How goodUpdatePanel withrepeater control? I am trying to use Repeator control ItemCommand" without a postback. but seems no effect. All I need is when a user click a perticular row in a repeator control "say a linkbutton", move a details panel (see below) into this user selected row with some information collected for that perticular row), this happen in "ItemCommand" event of repeator control. here is the server script..

Note I could easy done with Javascript and ClientPostBack but trying to do how good with Atlas .

please help.

<atlas:ScriptManagerrunat="server"ID="scriptsx"EnablePartialRendering="true"></atlas:ScriptManager>

<asp:repeaterid="Materials"runat="server"OnItemCommand="Repeater1_ItemCommand"><ItemTemplate>

<asp:panelrunat="server"id="rows">

<asp:LinkButtonid="LinkButton1"runat="server"CommandName="ShowIt"Text=<%# DataBinder.Eval(Container.DataItem, "Country")%>></asp:LinkButton>

</asp:panel></ItemTemplate></asp:repeater>

<atlas:UpdatePanelID="UpdateGrid"runat="server"Mode="Always"><ContentTemplate>

<asp:Panelrunat="server"ID="details"BackColor="gray"Visible="false">State Details</asp:Panel>

</ContentTemplate>

</atlas:UpdatePanel>

<Script runat="server">

protectedvoid Page_Load(object sender,EventArgs e){if (!IsPostBack){Materials.DataBind();}

}

protectedvoid Repeater1_ItemCommand(object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e){

details.Visible =

true;Panel p = (Panel)e.Item.FindControl("rows");

p.Controls.Add(details);}

</script>

thanks,

achu.

I think you just need to add in the Triggers section to your update panel as shown below:

<atlas:UpdatePanelID="UpdateGrid"runat="server"Mode="Always">
<ContentTemplate>
<asp:Panelrunat="server"ID="details"BackColor="gray"Visible="false">State Details</asp:Panel>
</ContentTemplate>
<Triggers>
<atlas:ControlEventTriggerControlID="Materials"EventName="ItemCommand"/>
</Triggers>
</atlas:UpdatePanel>


Yep .. this does work. I have many Repeaters within UpdatePanels .. and Repeaters within Repeaters ..

Just make sure you sort out the triggers and make the panel conditional.

thank Paul & KFrancis

It is working now. It works when repeator control inside the UpdatePanel though. Also tried with multiple Repeator controls works like a charm!!.

Regards

achu

Complete window! drag and drop + collapse + close + resize

Hey Guys and Girls

Has anyone made a panel in ATLAS which can be drag n dropped, closed, collapse and resized.. I know that these functions exist separately. However is it possible to combine them all for one panel? so it acts like typical OS window? would love to hear anyone elses experiences before embarking on trying it myself

thanks

Jonas

I think you can develop a custom web-templated-control with relative ease if you're used to develop in this "branch" of .Net coding environment.

I developed myself a control of this type (draggable/collapsible) with customizable (templated) zones.
If you need it, I'll post some code as soon as I'll get back home from office...