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

[Solved] Unable to use TabStrip with Html.BeginForm

1 Answer 66 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.
Carl
Top achievements
Rank 1
Carl asked on 27 Apr 2011, 05:08 PM
Figured it out. Here is the solution:

@using (Html.BeginForm())

{

                    @Html.Telerik().TabStrip().Name("UserInfo").Items(tabstrip => {
             tabstrip.Add().Text("User").Content(@<fieldset></fieldset>);
         }).SelectedIndex(0);
}
Notice no Render() method nor does the tab strip itself have any extra {}s.
I could not find this in the Telerik documentation maybe someone can point it out to me...

Hello,
I am trying to use:
@using (Html.BeginForm())
{
@{Html.Telerik().TabStrip().Name("UserInfo")
.Items(tabstrip => tabstrip.Add().Text("User").Content(@<text>TEST</text>)).SelectedIndex(0).Render();}
}

I get the following error. How do I get the TabStrip to work?
 

Server Error in '/' Application.

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS1501: No overload for method 'Write' takes 0 arguments

Source Error:

Line 15: 
Line 16:     
Line 17: @{Html.Telerik().TabStrip().Name("UserInfo").Items(tabstrip => tabstrip.Add().Text("User").Content(@<text>TEST</text>)).SelectedIndex(0).Render();}Line 18:     
Line 19:     }

1 Answer, 1 is accepted

Sort by
0
Ruslan
Top achievements
Rank 1
answered on 29 Apr 2011, 08:54 AM
Try this (without Render()):
    
@(Html.Telerik().TabStrip()
    .Name("UserInfo")
    .Items(tabstrip =>
        tabstrip.Add()
            .Text("User")
            .Content(@<text>TEST</text>))
    .SelectedIndex(0)
)
Tags
TabStrip
Asked by
Carl
Top achievements
Rank 1
Answers by
Ruslan
Top achievements
Rank 1
Share this question
or