Wednesday, March 28, 2012

System.Web.UI.UserControl does not have a public property named Title.

The controls work but I cannot view them in designer I get an error:

Error 1 Content1:Type 'System.Web.UI.UserControl' does not have a public property named 'Title'. D:\asp.net\Atlas\SampleWebSite\ModalPopup\ModalPopup.aspx D:\...\SampleWebSite\

I saw another post that said to rebuild, but I tried that and it didn't work.

thanks!

Nevermind... found the answer to remove the collapible panels. Wait until next release.

System.Web.UI.UpdatePanel does not have a public property named UpdatePanelAnimationExtend

'System.Web.UI.UpdatePanel' does not have a public property named 'UpdatePanelAnimationExtender'.

I have nothing but problems with ASP.Net AJAX. Could somebody tell me what is going on?

Newbie

The updatepanel doesn't have a public property named that - you have to use the AjaxToolkit to get that animation feature...

http://www.codeplex.com/AtlasControlToolkit

and from the sample website this is the code:

<%@.Page

Language="C#"

MasterPageFile="~/DefaultMaster.master"

AutoEventWireup="true"

CodeFile="UpdatePanelAnimation.aspx.cs"

Inherits="UpdatePanelAnimation_UpdatePanelAnimation"

Title="UpdatePanelAnimation Sample" %>

<%@.Register

Assembly="AjaxControlToolkit"

Namespace="AjaxControlToolkit"

TagPrefix="ajaxToolkit" %>

<asp:ContentContentPlaceHolderID="SampleContent"Runat="Server">

<asp:ScriptManagerrunat="server"EnablePartialRendering="true"/>

<divclass="demoarea">

<divclass="demoheading">UpdatePanelAnimation Demonstration</div>

<divstyle="margin-bottom: 10px;">

<divstyle="border: dashed 1px #222222;">

<divid="up_container"style="background-color: #40669A;">

<asp:UpdatePanelID="update"runat="server">

<ContentTemplate>

<divid="background"style="text-align: center; vertical-align: middle; line-height: 44px; padding: 12px; height: 44px; color: #FFFFFF;">

<asp:LabelID="lblUpdate"runat="server"Style="padding: 5px; font-size: 14px; font-weight: bold;">

4/28/1906 12:00:00 AM

</asp:Label>

</div>

</ContentTemplate>

<Triggers>

<asp:AsyncPostBackTriggerControlID="btnUpdate"EventName="Click"/>

</Triggers>

</asp:UpdatePanel>

</div>

</div>

</div>

Choose the effects, then press 'Update':<br/>

<inputtype="checkbox"id="effect_fade"checked="checked"/><labelfor="effect_fade">Fade</label><br/>

<inputtype="checkbox"id="effect_collapse"checked="checked"/><labelfor="effect_collapse">Collapse</label><br/>

<inputtype="checkbox"id="effect_color"checked="checked"/><labelfor="effect_color">Color Background</label><br/>

<asp:ButtonID="btnUpdate"runat="server"Text="Update"OnClick="btnUpdate_Click"/>

<ajaxToolkit:UpdatePanelAnimationExtenderID="upae"BehaviorID="animation"runat="server"TargetControlID="update">

<Animations>

<OnUpdating>

<Sequence>

<%-- Store the original height of the panel --%>

<ScriptActionScript="var b = $find('animation'); b._originalHeight = b._element.offsetHeight;"/>

<%-- Disable all the controls --%>

<Parallelduration="0">

<EnableActionAnimationTarget="ctl00_SampleContent_btnUpdate"Enabled="false"/>

<EnableActionAnimationTarget="effect_color"Enabled="false"/>

<EnableActionAnimationTarget="effect_collapse"Enabled="false"/>

<EnableActionAnimationTarget="effect_fade"Enabled="false"/>

</Parallel>

<StyleActionAttribute="overflow"Value="hidden"/>

<%-- Do each of the selected effects --%>

<Parallelduration=".25"Fps="30">

<ConditionConditionScript="$get('effect_fade').checked">

<FadeOutAnimationTarget="up_container"minimumOpacity=".2"/>

</Condition>

<ConditionConditionScript="$get('effect_collapse').checked">

<ResizeHeight="0"/>

</Condition>

<ConditionConditionScript="$get('effect_color').checked">

<ColorAnimationTarget="up_container"PropertyKey="backgroundColor"

EndValue="#FF0000"StartValue="#40669A"/>

</Condition>

</Parallel>

</Sequence>

</OnUpdating>

<OnUpdated>

<Sequence>

<%-- Do each of the selected effects --%>

<Parallelduration=".25"Fps="30">

<ConditionConditionScript="$get('effect_fade').checked">

<FadeInAnimationTarget="up_container"minimumOpacity=".2"/>

</Condition>

<ConditionConditionScript="$get('effect_collapse').checked">

<%-- Get the stored height --%>

<ResizeHeightScript="$find('animation')._originalHeight"/>

</Condition>

<ConditionConditionScript="$get('effect_color').checked">

<ColorAnimationTarget="up_container"PropertyKey="backgroundColor"

StartValue="#FF0000"EndValue="#40669A"/>

</Condition>

</Parallel>

<%-- Enable all the controls --%>

<Parallelduration="0">

<EnableActionAnimationTarget="effect_fade"Enabled="true"/>

<EnableActionAnimationTarget="effect_collapse"Enabled="true"/>

<EnableActionAnimationTarget="effect_color"Enabled="true"/>

<EnableActionAnimationTarget="ctl00_SampleContent_btnUpdate"Enabled="true"/>

</Parallel>

</Sequence>

</OnUpdated>

</Animations>

</ajaxToolkit:UpdatePanelAnimationExtender>

</div>

<divclass="demobottom"></div>

System.Web.UI.UpdatePanel does not have a public property named Login

I am trying to wrap an updatepanel in a login wizard and it is giving me the error described in the subject.

Am I doing something incorrectly.

From other posts that I have read this is possible.

Does anyone have an ideas.

It would be greatly appreciated.

it must be inside of<ContentTemplate>from theUpdatePanel, did you checked that?
Thanks for the information

Try this

<asp:UpdatePanel ID="UpdatePanel 1" UpdateMode="Conditional" runat="server">
<ContentTemplate>

<asp:Login ID="Login1" runat="server" ></asp:Login>

</ContentTemplate>
</asp:UpdatePanel>

System.Web.UI.Timer interval in client side code

Has anyone successfully set the Interval property in a System.Web.UI.Timer control using client side scripting of any language?

var timer = $find('<%= Timer1.ClientID %>');
timer.set_interval(5000);

FYI, some other methods are:

timer.get_interval();
timer._startTimer();
timer._stopTimer();
timer.set_enabled(true/false);


If this works I owe you a pretend steak dinner. Spent all day yesterday trying to track this down.


Big Smile Let me know if it does. I like my pretend steaks done pretend medium.


Okay so at first it didn't work. So I started experimenting.

It works when there's no master page, and just one single page, and the script is inside the page, call this TestSingle.aspx.

So I moved it to the child page, the timer resides on the child page, and put the script inside the child page and it works, call this Child.aspx.

So then I moved the script to the outside file that is loaded by the master page into every page and the function fails to find Timer1.

So then I used TestSingle.aspx again, and this time loaded the function from an outside .js file, and it failed to find Timer1.

Long story short, it works, but if it's trying to access Timer1 via script in an outside file, it fails to find Timer1. Is there some qualifier I need now?


Can you post the contents of your .js file as well as the source code where you reference it in the master page?


The only thing I put in the .js file was:

function StopTimer()
{
alert(1);
var timer = $find('<%= Timer1.ClientID %>');
alert(timer);
//timer.set_interval(5000);
alert(timer.get_interval());
//timer._stopTimer();

}

<%@. Page Language="C#" AutoEventWireup="true" CodeBehind="TestSingle.aspx.cs" Inherits="Website.TestSingle" %><!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><script src="./script/Test.js" type="text/javascript"></script> </head><body> <form id="form1" runat="server"> <div>   <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> </div> <asp:Timer ID="Timer1" runat="server"> </asp:Timer> <asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="StopTimer()" /> </form></body></html>

That setup fails to find Timer1, not even using a master child setup.


Take out the <script src="./script/Test.js" type="text/javascript"></script> and reference it via your script manager control.

<asp:ScriptManagerID="ScriptManager1"runat="server">
<Scripts>
<asp:ScriptReferencePath="./script/Test.js"/>
</Scripts>
</asp:ScriptManager>


Nope didnt work.


Sorry I didn't catch it the first time around...

In the .js file you can't use the <%= %> notation. That is strictly an ASP.NET thing. The only thing that can be in the .js file is pure javascript. So you want it to look like:

var timer = $find('Timer1');

$find() does take a second, optional parameter that allows you to specify the parent of the component you're looking for. That basically serves the same purpose as requiring it to use the ClientID of the control. You can read more about that here: http://www.asp.net/AJAX/Documentation/Live/ClientReference/Sys/ApplicationClass/SysApplicationFindComponentMethod.aspx


You can't use inline server script in your JavaScript include files. So, $find('<%= Timer1.ClientID %>') is literally looking for a control with the client ID of<%= Timer1.ClientID %>.

I'd set a JavaScript variable in pageLoad() with the Timer's ClientID and then reference that in the included script.


So how does one access the Client ID from javascript? <% ClientID %> ?


OnClientClick="StopTimer(<%= Timer1.ClientID %>)"

function StopTimer(args) {
var timer = $find(args);
timer.set_interval(5000);
}


Well yeah that achieves stopping it with a button. But in actuality what I'm going to do is "onfocus" on a TextBox/ComboBox/Etc. call StopTimer, and on a onblur turn it back on. This naturally has to happen within a millisecond, and be extremely easy to code into the project. ie StopTimer and StartTimer exists in a separate file and I just past "onfocus=StopTimer() onblue=StartTimer()" into the <input>'s, or in the pageload set attributes for windows controls.

So yeah, I could put that function you wrote in the outside .js file and just have the function take a parameter. But that's gonna make the HTML even bigger then it is already, although that should work.

And every child has TimerTicker added to it programmatically from the inherited root class every child page inherited. That way I dont have to manually add it to every child page someone makes, this solution is already at 30 child pages based off same master.


Yeah it's not finding hte control even with the args method you posted. It's acutally erroring out and giving syntax error. Adding ' ' to either side on StopTimer('<%= Timer1.ClientID %>') just sends the string to the method.

System.Web.UI.ScriptManager not recognized

Hi All,

First of all I am new to using Ajax controls, and am having a bit of trouble trying to add them to an exsisting ASP.NET application.

I am using:

Windows Vista Business

IIS7

VS 2005 SP1

AJAX 1.0

When trying to add an Ajax script manager to a page i get an error in the designer.vb file saying that the System.web.ui.scriptmanager type is not recognized. Also when I try to run the app I get the "sys is not found" javascript error which I would expect is related to my issue.

I have searched the fourms etc for quite a while and have found one other post regarding this, although it didn't seem to solve my problem.

I have tried running a Ajax enabled project and tested it in both the VS and IIS webservers which works well. I have also copied a web.config file from an Ajax enabled site so I dont think it is the web.config file.

Could anyone shed some light on this?

Thanks in advance.

Glen

http://www.emmersivemedia.com.au

First of all When u create "AJAX Enabled Site", You don't have to manually include

ScriptManager Control. It will be automatically placed on the form.


Why do you want to place ScriptManager manually ?

You can use directly AJAX Enabled Web Site..


Hi Chetan,

I am adding Ajax controls to a "Standard" ASP.NET application and not a Ajax enabled app, when adding the control which i want to use (ModalPopup) it says that it requires an instance of the ScriptManager Control on the page which makes sense as to my understanding any page that uses Ajax controls needs a ScriptManager control or a ScriptManager Proxy.

The reason I mentioned the Ajax Enabled site is that I guess it illustrates the fact that its not a problem with the instalation of Ajax but rather an issue specifically with the app i am working with.

Can you think of anything that I might have missed that would cause this to happen?

Thanks again for your help.

Regards,

Glen

System.Web.UI.WebControls.Menu and UpdatePanels / WebParts

Hi,

(using April version of Atlas)
I have a web form with a script manager, a web part manager, a menu and a web part zone with a generic web part in it. An update panel is around the web part manager and the web part zone. When I click on the arrow for the popup web part menu and chose for example "minimize", everything works fine for the first time, until the web part is rendered: When I want to click once again on the arrow for the popup web part menu, nothing happens anymore (nothing = no popup of the menu). This is just because of the System.Web.UI.WebControls.Menu on the page. When I remove the System.Web.UI.WebControls.Menu, everything works normal.

I made a sample code, to reproduce the problem:

<%@dotnet.itags.org. Page Language="VB" AutoEventWireup="true" CodeFile="Default.aspx.vb"Inherits="_Default" %><!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"> <atlas:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true"/> <div> <atlas:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:WebPartManager ID="WebPartManager1" runat="server"> </asp:WebPartManager> </ContentTemplate> </atlas:UpdatePanel> <br /> <asp:Menu ID="Menu1" runat="server" Orientation="Horizontal"> <Items> <asp:MenuItem Text="Neues Element" Value="Neues Element"> <asp:MenuItem Text="Neues Element" Value="Neues Element"> <asp:MenuItem Text="Neues Element" Value="Neues Element"></asp:MenuItem> </asp:MenuItem> <asp:MenuItem Text="Neues Element" Value="Neues Element"></asp:MenuItem> </asp:MenuItem> <asp:MenuItem Text="Neues Element" Value="Neues Element"> <asp:MenuItem Text="Neues Element" Value="Neues Element"></asp:MenuItem> </asp:MenuItem> </Items> </asp:Menu> <br />  </div> <atlas:UpdatePanel ID="UpdatePanel2" runat="server"> <ContentTemplate> <asp:WebPartZone ID="WebPartZone1" runat="server"> <ZoneTemplate> <asp:Calendar ID="Calendar1" runat="server"></asp:Calendar> </ZoneTemplate> </asp:WebPartZone> </ContentTemplate> </atlas:UpdatePanel> </form> </body></html>

ASH123,

I am having the same issue. I found that if you set WebPartVerbRenderMode to TitleBar, you are allowed to minimize/restore the webpart multiple times.

Did you ever find a solution that doesn't involve this work around?

Thanks

system.webServer and sys is undefined

Hi,

I know this has been on the table before but I've been struggling with "sys is undefined" when running in IIS7 Integrated mode for a while now and it would be great to get a good answer from MS (or someone else) about this. Classic mode works just fine. There are 5000 different "solutions" available in the forums and the only thing I've managed to get to work is removing the <handlers> section under <system.webServer>. The application still works as expected. Aren't these lines required? They already exist in <httpHandlers> below <system.web>.

When I accesshttp://localhost/test/ScriptResource.axd with the <handlers> still there I get:

Description: Handler "ScriptResource" has a bad module "ManagedPipelineHandler" in its module list
Error Code: 0x8007000d
Notification: ExecuteRequestHandler
Module: IIS Web Core
Requested URL:http://localhost:80/test/ScriptResource.axd
Physical Path: C:\Projects\test\web\ScriptResource.axd
Logon User: domain\user
Logon Method: Negotiate
Handler: ScriptResource

When I remove the section the application works but I get 404 instead when accessinghttp://localhost/test/ScriptResource.axd.

Can someone please explain or point me in the right direction?

Many thanks,
Manso

Hi,

Please refer to this thread:http://forums.asp.net/p/1048901/1504197.aspx#1504197

Hope this helps.