Showing posts with label ajaxcontroltoolkit. Show all posts
Showing posts with label ajaxcontroltoolkit. Show all posts

Saturday, March 24, 2012

Troubble with asp:fileUpload and TabContainer

Hello everybody!!Big Smile

I have been developping an aplication with the tabcontainer and tabconteiner of the AjaxControlToolKit, when the asp:fileUpload is outside of tabContainer the application works fine but when the asp:fileUpload is inside of tabContainer the fileupload's property "HasFile" is falseSad

any ideas??

thanks in advancedBig Smile

Hello,

thefileupload control can NOT be inside an updatepanel, andrequires a full postback. Maybe that's your issue? Got updatepanels in the tab?


Thanks a Lot NNMBig Smile, you are correct, thank u very much, I had put an updatepanel in my pageTongue TiedEmbarrassed i didn't know that it coudn't be possible...

Wednesday, March 21, 2012

trouble with dynamic tabs

Hi I am having two issues with trying to create dynamic tabs with the AjaxControlToolkit Tabs Control. First when I click the button1 to create the tab it creates 2 tabs and if I hit the button again I get the error "Specified argument was out of the range of valid values"

My aspx is

<%@dotnet.itags.org. Page Language="VB" AutoEventWireup="true" CodeFile="Default.aspx.vb" Inherits="_Default" EnableEventValidation="false" %
<!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>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<script type="text/javascript">

</script>
<div>
<br />
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Add Tab" /><br />
<br />
<br />
<br />
<ajaxToolkit:tabcontainer id="TabContainer1" runat="server" activetabindex="0">
</ajaxToolkit:tabcontainer></div>
</form>
</body>
</html>


My vb code is:

PartialClass _DefaultInherits System.Web.UI.PageProtected Sub Button1_Click(ByVal senderAs Object,ByVal eAs System.EventArgs)Handles Button1.ClickDim tabAs AjaxControlToolkit.TabPanel =New AjaxControlToolkit.TabPanel()Dim frame1As System.Web.UI.HtmlControls.HtmlGenericControl =New System.Web.UI.HtmlControls.HtmlGenericControl("iframe") frame1.Attributes("src") ="http://search.msn.com" frame1.Attributes("frameborder") ="0" frame1.Attributes("width") ="800" frame1.Attributes("height") ="600" frame1.Attributes("scrolling") ="auto" tab.Controls.Add(frame1) tab.Width ="800" tab.Height ="600" tab.HeaderText ="Tab " TabContainer1.Tabs.Add(tab) TabContainer1.ActiveTab = tabEnd SubEnd Class
Any help would be greatly appreciated.

Hi,

This is a common problem when working with dynamic controls.

The problem is that dynamic controls don't exist on the second request before the Button1_Click method fires. You need to recreate it in Page_Init rather than Button_Click.

Please refer to this documentation for more information:

1. Why do I have to recreate dynamic controls every time? /Why dynamic controls are disappeared on PostBack?

Whenever a request comes, a new instance of the page that isbeing requested is created to serve the request even it's a PostBack. Allcontrols on the page are reinitialized, and there state can be restored fromthe ViewState in a later phase.

The dynamic controls have to be recreated again and added tothe control hierarchy. Otherwise, they won't exist in the page.

Please be careful with when to create dynamic controls. Inorder to keep their state, they have to be created before the LoadViewStatephase. Page_Init as well as Page_Load methods are options available.

For more information about this topic, please refer to thisarticle:

Creating Dynamic Data Entry User Interfaces[http://msdn2.microsoft.com/en-us/library/aa479330.aspx ]

Hope this helps.


Trying to compile the latest AjaxControlToolkit

I used to be able to compile the previous toolkits without a problem. But after downloading the latest, I have two references that won't resolve:

System.Web.Extensions
System.Web.Extensions.Design

I've installed the two updates as suggested on the main page.

Any help is greatly appreciated.

Thank you,
Dave

I just installed them this morning and everything went well...

You must desinstall previous AJAX extensions (Beta 2) and install AJAX extensions RC 1, the namespace have changed between the two versions. In Beta 2, namespace was Microsoft .Web.Extensions, and have change to System.Web.Extensions in RC1. You must also modify your web.config file as said in the readme file.

Good luck!


marvin966:

I just installed them this morning and everything went well...

You must desinstall previous AJAX extensions (Beta 2) and install AJAX extensions RC 1, the namespace have changed between the two versions. In Beta 2, namespace was Microsoft .Web.Extensions, and have change to System.Web.Extensions in RC1. You must also modify your web.config file as said in the readme file.

Good luck!

That was it. Thank you very much. Everything is working as they should be.

two-way property synching not working...

I have an ajax extender that was created using the AjaxControlToolkit "ASP.Net AJAX Extender Control" wizard. My extender derives from AjaxControlToolkit.ExtenderControlBase.

My class has a bunch of properties that have the ExtenderControlProperty and ClientPropertyName attributes. These properties sync just fine from server to client, but I can't seem to get them to sync from client to server. Using this.set_ClientState("xyz") on the client gives me a value that is readable in the ClientState property on the server, but that is cheating since it uses a hidden input element.

Yes, I call this.raisePropertyChanged("MyValue") in the client JS when the property changes, and I have ensured that raisePropertyChanged is actually be called (via debugger).

Any ideas?

Nobody has any suggestions?