Showing posts with label load. Show all posts
Showing posts with label load. 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.

Content of popup, this is a problem

It seems that content of modal popup is in same page. is there any way to load content of a poupup from a web form without iframe or dynamic user control.

Sorry for my bad inglish

If you don't want to use an iframe, you could try using ahttpWebRequest.


Hi Nima,

Based on my experience , I think the easiest way is putting an UpdatePanel inside the Popped up Panel. So when we want to show the ModalPopupExtender , we first force the UpdatePanel to be refresh and get data from the server then make the ModalPopupExtender be shown. Here is the 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>
Another way is using WebService. We can get different content by sending the different contextKey.
I hope this helps.
Best regards,
Jonathan

Hi

Content of popup is asp.net form. if I use httpWebRequest or webservice form not work


Thanks

Contacts sample Atlas application error

When I try to run the site locally, I get aConfiguration Error .

Server Error in '/Contacts' Application.

Parser Error Message:Could not load type 'Microsoft.Web.Services.WebResourceCompressionModule'. (c:\inetpub\wwwroot\contacts\web.config line 62)

Line 62 is:<add name="WebResourceCompression" type="Microsoft.Web.Services.WebResourceCompressionModule"/>

Also, I see this error in Visual Studio: Error 1 Type 'Microsoft.Web.UI.Controls.AutoCompleteProperties' does not have a public property named 'MinimumPrefixLength'. c:\inetpub\wwwroot\Contacts\DefaultFull.aspx 93

What do I need to modify here? Aren't these samples supposed to run without any tweaking?

Ooops...

Never mind. I just had to install the new March CTP of Atlas. I guess my installed version was a bit older.


Hi pmarangoni

The contacts\readme.txt has the following step to install and run the sample

ASP.NET 'Atlas' Contacts Sample


Setup
=====
Copy the following file:

C:\Program Files\Microsoft ASP.NET\Atlas\v2.0.50727\Microsoft.Web.Atlas.dll

to the Bin folder in the folder where you have the Contacts sample files.


Running the Sample
==================
1. Open Visual Studio

2. Open the Contacts project by following these steps:

a. In the "File" menu, click "Open Website."
b. In the "Open Web Site" dialog box, click the "File System" tab.
c. Navigate to the folder where you have the Contacts sample files, and
then click "Open".

3. Run the Default.aspx page.

4. Navigate in the GridView control.

Notice that paging or sorting does not require a postback.

5. Drag the "Add new contact" panel to a different location on the page.

6. Enter a new contact.

Note that the box provides auto-complete behavior.


Hi jhawk,

I've tried following the instructions on most of the samples, including the Contacts sample.I haven't gotten any Atlas sample to work. Some of them won't even compile because of javascript errors. Others have runtime javascript errors.

As far as Contacts go, "Default.aspx" doesn't use any Atlas. You have to run "DefaultFull.aspx". However, when I try to run the "DefaultFull.aspx" page, I get a runtime javascript error: "invalid argument".

I think the samples need some more careful review.

Saturday, March 24, 2012

Confirm Extender + Modal Popup -> Call JavaScript on the load, and exit.

I have a Confirm Extender workign with a modal popup extender.

What I'd "like" to do is when the button that launches both is clicked, to run some client script to populate some fields. This saves me from doing it on the server. however, even using OnCLientClick on the button initiating all of this it doesn't work.

Any thoughts?

Also, when I click the OK button close the modal popup confirm box.. .(say that 10x as fast as you can), it would be better for it to close right away, rather than close when the server is done processing.

Is it possible to run script before it hits the server to make the display:none; again?

Hi RTernier,

RTernier:

What I'd "like" to do is when the button that launches both is clicked, to run some client script to populate some fields. This saves me from doing it on the server. however, even using OnCLientClick on the button initiating all of this it doesn't work.

Here is a workable example which you can compare with yours.

<%@. Page Language="C#" %><%@. Import Namespace="System.Threading" %><!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 Page_Load(object sender, EventArgs e) { Thread.Sleep(3000); }</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><%=DateTime.Now.ToString()%> <asp:Button ID="Button1" runat="server" Text="Button" /><ajaxToolkit:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" TargetControlID="Button1" DisplayModalPopupID="ModalPopupExtender1" > </ajaxToolkit:ConfirmButtonExtender> <asp:Panel ID="Panel1" runat="server" CssClass="modalPopup" Style="display: none"> Are you sure? <asp:Button ID="btnOk" runat="server" Text="Ok" /> <asp:Button ID="btnCancel" runat="server" Text="Cancel" /> </asp:Panel> <ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="Button1" PopupControlID="Panel1" CancelControlID="btnCancel" BackgroundCssClass="modalBackground" OkControlID="btnOk"> </ajaxToolkit:ModalPopupExtender> <script type="text/javascript" language="javascript"> function pageLoad(){ $find("<%=ModalPopupExtender1.ClientID%>").add_showing(onMPEShowing); } function onMPEShowing(){ //your javascript code here to add fields or do anything what you want. } </script> </form></body></html>

RTernier:

Also, when I click the OK button close the modal popup confirm box.. .(say that 10x as fast as you can), it would be better for it to close right away, rather than close when the server is done processing.

Is it possible to run script before it hits the server to make the display:none; again?

It will be hidden right after be clicked. Please see my sample

Hope this helps.

Best regards,

Jonathan


I can not say how grateful I am for this solution. Wanted same functionality in my app.

I have 1 question though. Is there any client script reference for methods like add_showing etc. I also wanted to do some client side scripting on modal popup closing ..and i just guessed the function (must be my luck day) add_hiding..which worked beautifully!

However, I would still love a client side script reference for the same. Please advise. Thanks!

Configuration Error: Could not load type..........

Hi all,

I have an issue with an AJAX.NET enabled web site that i have written. This site was completed and worked fine on our dev server, but then the dev server was rebuilt, and then the fun began. I have reloaded the site onto the newly setup server, installed AJAX.NET (the current version, which i also developed the site under). But the site will not load and i keep getting the follow error

Parser Error Message:Could not load type 'System.Web.UI.Compatibility.CompareValidator' from assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

Source Error:

Line 51: </controls>Line 52: <tagMapping>Line 53: <add tagType="System.Web.UI.WebControls.CompareValidator" mappedTagType="System.Web.UI.Compatibility.CompareValidator, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>Line 54: <add tagType="System.Web.UI.WebControls.CustomValidator" mappedTagType="System.Web.UI.Compatibility.CustomValidator, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>Line 55: <add tagType="System.Web.UI.WebControls.RangeValidator" mappedTagType="System.Web.UI.Compatibility.RangeValidator, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

I have tried uninstalling and reinstalling AJAX.NET, Moving the 2 AJAX dll's into the projects BIN directory, and also manually putting the 2 AJAX dlls into the GAC, and nothing has made a bit of difference, and so im posting on here......

any help would be greatly appreciated!
Rob Earlam

The validators were removed from the latest release. The default Web.config that comes with the RTM release no longer has the validators in the <tagMapping> element.

Here is a pointer to a blog post that describes how you can download the compatibility validators:http://weblogs.asp.net/scottgu/archive/2007/01/25/links-to-asp-net-ajax-1-0-resources-and-answers-to-some-common-questions.aspx

Hope this helps,

Scott


All is working fine now

Thanks Alot
Rob


I am working on a team project.

On Other system they haven't got this error.

On my system I have commented the following lines in the web.config {locally}

<!--

<tagMapping>

<add tagType="System.Web.UI.WebControls.CompareValidator" mappedTagType="System.Web.UI.Compatibility.CompareValidator, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

<add tagType="System.Web.UI.WebControls.CustomValidator" mappedTagType="System.Web.UI.Compatibility.CustomValidator, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

<add tagType="System.Web.UI.WebControls.RangeValidator" mappedTagType="System.Web.UI.Compatibility.RangeValidator, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

<add tagType="System.Web.UI.WebControls.RegularExpressionValidator" mappedTagType="System.Web.UI.Compatibility.RegularExpressionValidator, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

<add tagType="System.Web.UI.WebControls.RequiredFieldValidator" mappedTagType="System.Web.UI.Compatibility.RequiredFieldValidator, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

<add tagType="System.Web.UI.WebControls.ValidationSummary" mappedTagType="System.Web.UI.Compatibility.ValidationSummary, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

</tagMapping> kamran

-->

Then I can't get this error.{I don't know why this error appear on my system and doesn't on other systems}

If i comment these line in my project which all team developer work what could be the result ?

What Should I do ?


Found that on other system there were old ajax installation were installed

So I uninstalled the latest ajax extension and install the old one.

Then as on other system enable the lines above then my application start working on my system.

Now What Should I do .Can I install the new extension on all systems and comments these lines on other system as well.

{I am asking it as Could it lead to some problems or not}

Configuration Error

I have uploaded my asp.net/ajaxenabled site up to a server and I get this error:

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

I have checked my c:\windows\assembly folder and the web extensions are there as matching versions. Does anyone have any idea what I need to do to fix this?

thanks,

wdg

Does the server have AJAX extension installed? Microsoft set up AJAX so the files need to reside in the Global Assembly Cache, rather than just being placed in your application's /bin/ folder, which means you/system admin/web host need to install the extensions with the same installer you used to get access to them on your machine.

Wednesday, March 21, 2012

compilation error comes, if "ASPAJAXExtSetup.msi" is not installed

hello,

whts the cause when AJAX-enabled application complied such a machine, where "ASPAJAXExtSetup.msi" is not installed....error is "enable to load assembly....cause very much clear due to not installation of "ASPAJAXExtSetup.msi"...

but, it is necessary to install such ...msi or we can add some "dlls" in application as we are doing previously in case of "Atlas".

wht we have to do....suggest me.....

Ajmal

you need

v1.061025 System.Web.Extensions.dll

v1.061025 System.Web.Extensions.Design.dll

i think you also need both of them in GAC


thnx dude....

but, it not need to install above dll's in GAC

Ajmal


hi

For GAC, be honestly i am not sure whether you need msi to do it or not

You can try drage system.web.extensions. dll and system.web.extensions.design.dll to C:\WINDOWS\assembly

then try run your ajax web page