ASP.NET+Javascript

  • Thread starter Thread starter Surjit Madiwalar
  • Start date Start date
S

Surjit Madiwalar

Hi,


Main Box Box 1
---------------------- ---------
| | -> | |
| | <- | |
| | --------
| | Box 2
| | ---------
| | -> | |
| | <- | |
| | ---------
----------------------


The main box has list of all names,

- I should be able to select multiple names from main box and push it to
box1 or box 2 using arrow(->)

- From box1 or box 2 i should be able to move back to main box.

- There should be an option to add box dynamically(this will be server side
: postback) and above rules should also apply to this newly created box.

I want to do this in asp.net(C#) for my web application.

Questions:
- Can this be done in asp.net?
- If so, how can it be implemented in asp.net using javascript code as most
of events occur on client side?

Any help is appreciated.

Rgds,
Surjit
 
1. Can it be done?

Yes, there is nothing in .NET that stops you from using Client side code. As
with any other web technology (JSP, ASP, PHP, etc.), you have to send all of
the information to your EcmaScript "engine" in the page (ie, JavaScript).

2. Best method?

You have two choices, as I see it.
a) hard code the JavaScript in the page
b) Write out the JavaScript code from your C#/VB.NET code

a is not very flexible, so I would suggest b. You can simply add a
JavaScript block to a container, like a panel, or you can attach it to
particular controls. The .NET Framework web control object has the ability to
attach JavaScript before and after the control is rendered. Before is
applicable for event driven programming (like you are doing), while after is
good to change a control on load (has to be rendered first).

Here is a good set of articles for you
http://msdn.microsoft.com/library/d...s/dnaspp/html/dhtmlobjectmodel.asp?frame=true

http://msdn.microsoft.com/library/d.../dnaspp/html/dhtmlobjectmodel2.asp?frame=true

And Scott's article on Client Side code is a must for what you are doing
http://msdn.microsoft.com/library/d...s/dnaspp/html/clientsidescript.asp?frame=true


---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************

---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 
Back
Top