Click here to Skip to main content
15,906,708 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hello,
I am using a Multiview control in my project.This one has two views.
How can i select one view in JAVA SCRIPT And how can i get selected index in java script.
Please Give me the answer.
thank you.
Posted

1 solution

Dear Friend,

Regarding multiview selection from javascript:-

I dont think you will be able to because without causing a post back as the multiview is a server side control and only the active view is rendered to the browser.

You probably need to have all the views on the page and all but one hidden. Are you implementing some time of tab control?

There is a tab control in the ajax control toolkit which switches between views clientside:

Please refer these links for alternative solution and a very effective one also:-

A Simple ASP.NET Tab Control Using the MultiView control[^]

http://stackoverflow.com/questions/6965478/multiview-in-asp-net[^]

http://www.asp.net/ajaxlibrary/AjaxControlToolkitSampleSite/Tabs/Tabs.aspx[^]
 
Share this answer
 
Comments
Mousumi2708 20-Feb-12 4:29am    
thanks Varun,
I hv already declared link button to select view But my question was how could I select view using java script?If you will tell me how can I do this,it will be better for me
thanks
Varun Sareen 20-Feb-12 5:20am    
Dear Friend, It can't be done using javascript, As the MultiView control only renders the selected view to the browser. So, you cannot use JavaScript on the browser to display other views because their markup is not rendered.
Mousumi2708 20-Feb-12 5:22am    
ok..Thanks Varun. If you will find any solution pls post
Varun Sareen 20-Feb-12 11:21am    
Okays

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900