Saturday, March 24, 2012

Want to make div element using ajax.asp

I would like to make a div element using ajax and want to add floating behavior. What will be the process.

waiting for your professional help.

regards

I think you're confusing technologies. A few things to understand:

A div is an HTML element that's recognized by the browser, that by default has no server side useability. Ajax is a set of client side script libraries, than can be programmed against on the server, that expose client side behavior. You really dont "create" a div with ajax. Here's how you could create floating behavior if you wished

<div id="floatingmenu" style="border:1px solid black; background-color:white">

This is a test

</div>

<ajaxtoolkit:dragpanelextender targetcontrolid="floatingmenu" />

I'm doing this from memory, so my syntax may be slightly off.

You are going to need the Ajax Control toolkit installed, which is available athttp://ajax.asp.net


That's not entirely true.

You could use client script to create and attach a div to the document, and then use the ajax client script libraries to add floating behavior separately from the server-side stuff. It's all a matter of what you're trying to accomplish.


The thing I would like to do is:

1- I want to generate a div element at client side by using ajax client script. Now I am making div dynamically by using element tag. by putting it to body by using innerHtml .

2- I would like to add floating behaviour to that div when this is generated by the user at client side.

I tried to use $create(Sys.UI.FloatingBehavior,{'handle': ctrlHandle},null, null, ctrl);
but this give error.


What's the error??


One thing I just noticed... shouldn't the FloatingBehavior type be: Sys.Preview.UI.FloatingBehavior?

No comments:

Post a Comment