Showing posts with label bug. Show all posts
Showing posts with label bug. Show all posts

Monday, March 26, 2012

Intellisense bug - Fixed in AJAX RC?

Has the intellisense bug that existed in the AJAX Beta been fixed with the RC version? I am still getting the "Element 'ScriptManagerProxy' is not a known element." message in source view for Child Pages. I don't see this in master pages. However, if I rename the tagprefix to ajax rather than asp in the web.config and tsrt using that tag prefix in my web forms, the intellisense starts working properly. Any suggestions?

Should be fixed as described on Scott Guthrie's bloghttp://weblogs.asp.net/scottgu/archive/2006/12/15/visual-studio-2005-service-pack-1-sp1-released.aspx

Interesting Bug in IEDragDropManager

please look at the code of these three functions in IEDragDropManager.

function dragEnterHandler()

function dragLeaveHandler()

function dragOverHandler()

In these three functions, "this._dropTarget" is always "undefined" since there's no code to assign value to it.

The interesting thing is, the code world not be accessed normally. If I create a environment to access the code, an error will be thrown.

Hi JeffreyZhao,

I believe this gets defined indirectly through registerDropTarget.

Thanks,
Ted

Saturday, March 24, 2012

internet explorer 7

I installed ie 7 at home, and my (work) web apps with atlas (ajax) controls don't work, bug a lot, and CRASH ie 7.

Errrm, is anyone sweating with this for a next version of the controls? If my users upgrade to ie7 at work, I have a looot of sweating to do myself.. :\

Any tips/info?

I've been using Atlas/Ajax since the June CTP, went through beta 1 and now beta 2. What I noticed is that with IE 7 the rendering process got actually better. The UpdatePanel flicker is gone (as in Mozilla). What kind of errors are you getting? I think the transition should be very smooth.
e 7 just hangs (cannot click anywhere) and the only way to close it is to ctrl alt del it away (then the standard send error report.)
I have a similar problem, but it does not hang, with Internet Explorer 7.0 and Firefox 2.0, the update panels just don't work anymore.. the pages postback instead of using AJAX to render smoothly...
Oh sorry this was my fault, I didnt do the instructions of migration for BETA 2.But now I have another problem .. for which I'll open another thread because it is no related to this one.

I have been using IE7 since RC1 was released and have had no problems with the updatepanel or any of the AJAX toolkit controls. Can you post your code? I will try and test it in my IE enviroment.


Well, ie7 is lots of problems, i hate it i hate it i hate it i hate it i hate it

IF i wanted firefox i woulda taken it. WTF!? lol they just made it internetfirexplorer


Even the simplest textbox.focus() doesn't work anymore..!

Wednesday, March 21, 2012

Is it a bug in asp.net using Ajax Control Toolkit?

Hey,

I got a problem with when using Asp.net using Ajax control tookit. I have tried a lot of things but this problem seems like a bug with Ajax.

To demonstrate my problem, firstly, you can take a look at the image that I attached below:

This is a panel that put inside a updatepanel. The textbox values: Company Name, ContractNr, Endate, Max Companies, Max Terminal, Max Doors, Max users and License Nr are loaded on Page_load(0 and from database.

But the problem came is: if i fill in other values for the textboxes above, and click button Update, the values could not be changed and used to update the database, but the values kept the same like from the first time loading.

I have spent couple of hours to try to solve this problem, but it seems impossible!

Did anyone get this problem before? and if possible, could you give me advice or solution?

Thank you very much,

Joesy

While the image is nice - you'd do better posting the code the replicates the issue. It would appear from your description however, that you are always re-initilizing the values for the form fields on page load. Make sure that you do something similiar to:

if (!Page.IsPostback)

{

//code for binding the initial values from the db to the form fields

}

Then you can leave the rest alone and the form will always reflect the current user supplied values...

Most likely - this is the case and can be easily verified using the VS Debugger and SQL Profiler...

it is most lkely not an issue with Ajax...


Have you set the property "EnablePartialRendering = true" of the ScriptManager ?


Hey Jody and Chetan,

Thanks for your help,

I solved it.


Joesy

Is it a bug? Using animations in a masterpage doesnt work. Please help.

This is the error I get when I run the page:

Sys.ArgumentException: AjaxControlToolkit.Animation.Animation.set_animationTarget requires the ID of a Sys.UI.DomElement or Sys.UI.Control. No element or control could be found corresponding to "Panel2".

Here is the masterpage:

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

<!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">

<headid="Head1"runat="server">

<title>Is it a bug?</title>

</head>

<body>

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

<asp:ScriptManagerID="ScriptManager1"runat="server">

</asp:ScriptManager>

<ajaxToolkit:AnimationExtenderID="AnimationExtender1"runat="server"TargetControlID="Panel1">

<Animations>

<OnHoverOver>

<FadeOutDuration=".5"Fps="20"AnimationTarget="Panel2"/>

</OnHoverOver>

<OnHoverOut>

<FadeInDuration=".5"Fps="20"AnimationTarget="Panel2"/>

</OnHoverOut>

</Animations>

</ajaxToolkit:AnimationExtender>

<asp:PanelID="Panel1"runat="server"Height="50px"Width="125px">Text to hover over.</asp:Panel>

<br/>

<br/>

<asp:PanelID="Panel2"runat="server"Height="50px"Width="125px">Text to fade out.</asp:Panel>

<asp:contentplaceholderid="ContentPlaceHolder1"runat="server">

</asp:contentplaceholder>

</form>

</body>

</html>

Here is the small example page:

<%@dotnet.itags.org.PageLanguage="VB"MasterPageFile="~/MasterPage2.master"AutoEventWireup="false"CodeFile="Test7.aspx.vb"Inherits="Test7"title="Untitled Page" %>

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

Just some text

</asp:Content>

Here is a page where it works just fine, not using a master page:

<%@dotnet.itags.org.PageLanguage="VB"AutoEventWireup="false"CodeFile="Test8.aspx.vb"Inherits="Test8" %>

<!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>

</head>

<body>

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

<asp:ScriptManagerID="ScriptManager1"runat="server">

</asp:ScriptManager>

<ajaxToolkit:AnimationExtenderID="AnimationExtender1"runat="server"TargetControlID="Panel1">

<Animations>

<OnHoverOver>

<FadeOutDuration=".5"Fps="20"AnimationTarget="Panel2"/>

</OnHoverOver>

<OnHoverOut>

<FadeInDuration=".5"Fps="20"AnimationTarget="Panel2"/>

</OnHoverOut>

</Animations>

</ajaxToolkit:AnimationExtender>

<asp:PanelID="Panel1"runat="server"Height="50px"Width="125px">

Text to hover over.</asp:Panel>

<br/>

<br/>

<asp:PanelID="Panel2"runat="server"Height="50px"Width="125px">

Text to fade out.

</asp:Panel>

</form>

</body>

</html>

Can you please try to help me to figure out what is wrong with this, please?

Hi ,

In the working and the non-working scenario , go to the view-source of the page and copy the $create Function call and post it here .

Hope this helps


OK, I will gladly post the different results:

Here is the working one:

<script type="text/javascript">
<!--
Sys.Application.initialize();
Sys.Application.add_init(function() {
$create(AjaxControlToolkit.Animation.AnimationBehavior, {"OnHoverOut":"{\"AnimationName\":\"FadeIn\",\"Duration\":\".5\",\"Fps\":\"20\",\"AnimationTarget\":\"Panel2\",\"AnimationChildren\":[]}","OnHoverOver":"{\"AnimationName\":\"FadeOut\",\"Duration\":\".5\",\"Fps\":\"20\",\"AnimationTarget\":\"Panel2\",\"AnimationChildren\":[]}","id":"AnimationExtender1"}, null, null, $get("Panel1"));
});
// -->
</script>

And here is the non working one.

<script type="text/javascript">
<!--
Sys.Application.initialize();
Sys.Application.add_init(function() {
$create(AjaxControlToolkit.Animation.AnimationBehavior, {"OnHoverOut":"{\"AnimationName\":\"FadeIn\",\"Duration\":\".5\",\"Fps\":\"20\",\"AnimationTarget\":\"ctl00_Panel2\",\"AnimationChildren\":[]}","OnHoverOver":"{\"AnimationName\":\"FadeOut\",\"Duration\":\".5\",\"Fps\":\"20\",\"AnimationTarget\":\"Panel2\",\"AnimationChildren\":[]}","id":"ctl00_AnimationExtender1"}, null, null, $get("ctl00_Panel1"));
});
// -->
</script>

Just for reference

My Panel 2 is named: ctl00_Panel2

when using a master page. This is strange I think. But the javascript seems to want Panel2 which can be seen at the end of this javascript.


Hi,

The names of the controls getting changed upon placing them in a master page is expected.

Can you see controls named ctl00_Panel1 and ctl00_Panel2 in the View-Source ?


Sorry for my late reply.

Yes, I can see the ctl00_Panel1 and ctl00_Panel2 in the source code.

However, I can't see Panel2 in the source code, but the Javascript seems to be referring to Panel2 as well as ctl00_Panel2.

Any suggestions?


It's normal to see so. This is the internal behavior of asp.net that its client side id is changed when the control is in a namingContainer.

You may change the AnimationTarget="Panel2"/> toAnimationTarget="ctl00_Panel2"/>


ok , this looks really weird ..

if you see the $create call in the non-working one , the TargetControlIDs are messed up

<script type="text/javascript">
<!--
Sys.Application.initialize();
Sys.Application.add_init(function() {
\",\"AnimationTarget\":\"ctl00_Panel2

blahblahblah

\",\"AnimationChildren\":\",\"AnimationTarget\":\"Panel2\",\"AnimationChildren\":});

</script>
Temporary Workaround for this :

IN the Markup , Change AnimationTarget to be AnimationTargetScript ="GetID();"

<scriptlanguage="javascript">

function GetID() {

var panelID = <%=Panel1.ClientID %>

return panelID;

}

</script>

Hope this helps , lemme know if I missed anything


Raymond Wen - MSFT:

It's normal to see so. This is the internal behavior of asp.net that its client side id is changed when the control is in a namingContainer.

You may change the AnimationTarget="Panel2"/> toAnimationTarget="ctl00_Panel2"/>

Your change worked just fine. Thanks a million!!!Big Smile

I hope that this is fixed in the next version of the control toolkit. I can wish atleast.


Phanatic:

ok , this looks really weird ..

if you see the $create call in the non-working one , the TargetControlIDs are messed up

<script type="text/javascript">
<!--
Sys.Application.initialize();
Sys.Application.add_init(function() {
\",\"AnimationTarget\":\"ctl00_Panel2

blahblahblah

\",\"AnimationChildren\":\",\"AnimationTarget\":\"Panel2\",\"AnimationChildren\":});

</script>
Temporary Workaround for this :

IN the Markup , Change AnimationTarget to be AnimationTargetScript ="GetID();"

<scriptlanguage="javascript">

function GetID() {

var panelID = <%=Panel1.ClientID %>

return panelID;

}

</script>

Hope this helps , lemme know if I missed anything

Hello. When I try this, I get "Sys.ArgumentTypeException: Object of type 'Object' cannot be converted to type 'String'. Parameter name: id"

Thanks for helping me!


Thats right ! When the script ran , it converted the ID to be an actual object .

dunno if I am making senseSmile .

The idea is to avoid one from hard-coding the names of the Target Controls . What if you added another contentPlaceHolder tomorrow ?

Hope this helps


I think Phanatic's code has a bug... try:

function GetId() { return '<%= Panel1.ClientID %>'; }

(note the quotes)


Hi,

Right ! the Code is faulty . It passes the ID without any quotes and hence is interpreted as an object.

But , I think the main thing here is :

If you see the $create Function rendered with a MasterPage in the picture .

The same JSON representation for the animation has the complete ID including the ContentPlace holder's ID "ctl00_Panel2" and also without the ContentPlaceHolder as a container , Panel2.

<script type="text/javascript">
<!--
Sys.Application.initialize();
Sys.Application.add_init(function() {
\",\"AnimationTarget\":\"ctl00_Panel2

blahblahblah

\",\"AnimationChildren\":\",\"AnimationTarget\":\"Panel2\",\"AnimationChildren\":});

</script>

Is it a bug? you can try it.

I found a problem in Web Service when I use Asp.Net Ajax rc1.
runhttp://localhost/Website1/WebService1.asmx, Call SetValue() , then GetValue(). You will find an exception.
That's too strange. why is NHibernate?

using System.Web.Script.Services;
using NHibernate;
using NHibernate.Cfg;

[ScriptService]
public class WebService1 : System.Web.Services.WebService
{
[WebMethod(EnableSession = true)]
public void SetValue(string value)
{
// If I run it here, the Session["SESSION1"] in GetValue() will return null;
NHibernate.Cfg.Configuration _cfg = new NHibernate.Cfg.Configuration();

Session["SESSION1"] = value;
}

[WebMethod(EnableSession = true)]
public string GetValue()
{
return Session["SESSION1"].ToString();
}
}

web.config:
<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"/>
</httpHandlers>

Do you mean to say if you include the NHibernate line, Session["Session1"] returns null? What happens if you remove that line? Also are you sure that you are accessing the session variable after you have set it?
Yes, if I remove that NHibernate line, all the things are working well. I tried it many times.
I can't use NHibernate in Asp.Net Ajax? I am almost crazy these days.
I've found why the session will be lost. I have a global.asa file. And I write:
void Application_Start(object sender, EventArgs e)
{
log4net.Config.DOMConfigurator.Configure();
}
and each time I call web method, the application will restart ( seems in compiling again ). That's why the session will be cleaned.

But I still don't know why the Application will restart each time? And if I delete that line in Application_Start, everything works well.

I am using Visual Web Developer 2005, and the solution will not compile to a dll.

hello.

just a guess: does the configure methodf loads the config fromthe web.config file? if so, try changing it to an external file (i'm thinking that maybe it may be changing the web.config file while it reads it and this will definitly restart your web app).


No, I didn't change web.config file while I call these 2 method.
I am using visual web develop 2005 express. and all the code wouldn't be compiled to a dll, so I don't know when the code will be compiled if I call a web service method.