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

Wednesday, March 28, 2012

installing ajax toolkit

hi friends,

i want to learn ajax, i saw the ajax video available on the site but the problem is that when i open the AjaxControlToolkit.sln the TemplateVSI file is not open. that's why i can't build the toolkit

i am using visual web developer 2005.

plz help me.

Hi Zubair Alam,

With VWD you're not able to compile the whole solution. You need Visual Studio 2005 standard or above for that (as the project types are implemented separately in the express editions).

As you're only missing out on the .VSI project it's not really a loss.

All you actually need is the control toolkit dll, which you can find in the "bin" directory of the sample website.

Thisvideo covers installing (as well as adding the controls to the toolbox) and should get you on your way. There's a whole bunch of videos about asp.net ajaxhere

I hope that helps.


hi imco

please explain me which studio i downlod which is in small size, its only for vsi file


Hi Zubair Alam,

Sorry, I'm having a bit of trouble understanding what you are asking so please let me know if I'm not addressing your question.

There is a walkthrough on setting up your environmenthere if the video wasn't sufficient.

As I said, I'm not clear what exactly you're trying to accomplish, but, if you want to build the TemplateVSI project you'll need a non Express version of Visual Studio.

This means Standard, Pro or one of the "Team" editions. Microsoft offers a90 day trial of Visual Studio Professional, I'm not sure whether you can "go live" with it, you'd have to read the EULA.

You could also use the Visual Studio 2008 Beta, eitherStandard orPro.

None of those options are a small download, but at least a Beta2 install can give you an opportunity to really test Visual Studio before deciding if you're willing to pay for it.

I hope that helps.

Installing AjaxControlToolkit

Hello,

I would like to use noBot, so I installed Ajax and the WAP, but including the AjaxControlToolKit gives me an error that it can't find the file

Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. The system cannot find the file specified.

Is there a way to manually install all the required files for the AjaxControlToolkit?

Can I find the required .dll somewhere and just copy it in the bin folder in order to make it work?

Will the noBot work if my page is not Ajaxfied?

Thank you

Find AjaxControlToolkit.dll file in Program Files on the location where is AjaxControlToolkit installed and copy it into bin folder.

Great, thanks

Is there a way of testing the noBot exept than putting the form live and beeing cracked (again) ?

Thank you


Perhaps you could deploy it to a test site before putting it on the actual production site.

Well yes... but the attackers know my live site :)

Do you know of any tools that do such attacks to test it?

Thanks


I do not...although I don't think it would be too difficult to write a test app yourself. In the past we've used third parties to do Penetration Testing on our external facing apps and servers. If you have an application or server that you need to ensure is secure, I would recommend this.

Wednesday, March 21, 2012

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>