Click here to Skip to main content
15,894,343 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to clear current tab control values in ajax tab container while switching from current tab to other tabs.... any suggestion is appreciated.I don't want to use autopost back
Posted

1 solution

I don't want to use autopost back
Assuming you know that with AJAX, this postback would do partial update - but if you are not ready to do that, then you need to define a client method on tab change event. In that JavaScript method, clear the controls of the tab and then move on.

Try out!
 
Share this answer
 
Comments
[no name] 23-Sep-12 23:59pm    
there's a property called onclientclick where we can pass javascript function name,the function get fired on clicking a tab in tab container, the problem is that I was unable to get client ids(controls ids) of that tab, how to get those ids to clear the contents in those controls.??? any suggestion is appreciated.
Sandeep Mewara 24-Sep-12 2:19am    
Events sounds just fine for the job. Do a ViewSource of webpage and see the ID's of the control you need. Use it.
[no name] 24-Sep-12 5:03am    
I got the id of the iframe i need,I just re assigned same src to the iframe in the javascript, it works fine for 1st tab, but it loads the 1st tab even if I mention src for other tabs. what i mean to say is:
1st tab onclient click=> iframe.src="1st tab aspx address"(assigning same src, works fine, clearing all controls data)
2nd tab onclient click=> iframe.src="2nd tab aspx address"(assigning same src , switching to 1st tab)
I enclosed tab container in asp:update panel.Hope u understand the issue.
Sandeep Mewara 24-Sep-12 5:11am    
See if you can find any 'active' tab or the currentTabIndex kind of property in Javascript when OnclientClick is raised.

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