views:

20

answers:

2

Hello, ASP.NET web form with JQuery UI tabs widget and four tabs. I would like to disable the latest three tabs when i click a submit button.

Thanks!

P.S. I know how to disable tabs in jquery

$( ".selector" ).tabs( { disabled: [1, 2] } );

I don't know how to do it in server side code :)

+1  A: 

jQuery is client side. You can't disable it server side.

What you can do is send that bit of jQuery back to the page from the server on the next page load (or AJAX call).

DA
Ok. So what is your suggestion? Calling a client side script with the OnClientClick handler or register a client script for execution on the next page load?
Lorenzo
Is the page doing a postback on submit? Or are you doing an AJAX call? The answer to that is your answer.
DA
A: 

The server side has no notion of jQuery or JavaScript in general, that's all done on the client side. One thing you can do is, in the button's server-side click event handler, add some JavaScript to send to the client side to execute when the page loads:

http://msdn.microsoft.com/en-us/library/3hc29e2a.aspx

I haven't really done much with that, but it seems to be pretty standard. Another possibility would be to wrap the tabs in PlaceHolder controls and set those to visible=true/false accordingly in the event handlers. You can pretty dynamically add/remove PlaceHolders around HTML and JavaScript fairly smoothly.

David