This is a migrated thread and some comments may be shown as answers.

[Solved] Load on Demand of Content before JavaScript is loaded

3 Answers 35 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Grzegorz Żydek
Top achievements
Rank 1
Grzegorz Żydek asked on 19 Jul 2011, 11:18 AM
Hi,

Have some problem with TabStrip with 'Load on Demand of Content' option.

If you try click tab before javascript load, new page will open instead load content to TabStrip.

Is there a way that I could disable TabStrip links before script load?

Cheers, Grzesiek

3 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 19 Jul 2011, 02:37 PM
Hi Grzesiek,

One option is to set

.LinkHtmlAttributes(new { onclick = "return false;" })

for every tab and then remove these attributes in the TabStrip's OnLoad client event handler.

Kind regards,
Dimo
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Grzegorz Żydek
Top achievements
Rank 1
answered on 19 Jul 2011, 05:18 PM
Thanks, for your quick reply.

Don't you think it should be standard behaviour?
Maybe better solutiion is to keep link in 'rel' attribute, rather than in 'href' attribute?


Thank you for reply again!

Grzesiek
0
Dimo
Telerik team
answered on 20 Jul 2011, 07:05 AM
Hello Grzesiek,

Doing what you suggest will make the content inaccessible if Javascript is turned off.

Generally, the most ellegant solution is to use ItemAction and setup the hyperlinks in such a way, so that the whole page is reloaded, the same controller and action is called, but information about the new selected tab is provided as a parameter, so that the correct tab is selected after the reload. This approach is demonstrated in this example:

http://www.telerik.com/ClientsFiles/255966_TelerikSample.zip

Greetings,
Dimo
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
TabStrip
Asked by
Grzegorz Żydek
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Grzegorz Żydek
Top achievements
Rank 1
Share this question
or