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

Issue with MVC Razor Form inside Tabstrip

7 Answers 745 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
AU
Top achievements
Rank 1
AU asked on 05 Oct 2012, 08:07 AM
Hello,

My goal is to put a form inside a tabstrip content window. When I use the code below:
@(Html.Kendo().TabStrip()
.Name("tabstrip1")
.Items(tabstrip =>
{
tabstrip.Add().Text("Customer Information")
   .Content(@<div>
          @using (Ajax.BeginForm("AddData", "Customer", new AjaxOptions { HttpMethod = "post" }))
          {
          <input type="button" class="k-button" value="Submit" onclick="checkValues()" />
          }
          </div>
  );
 })
)

What happens is that the form generated by the html helper is not inside the tabstrip's div. Only the Submit button is.

But with the code below:
@(Html.Kendo().TabStrip()
.Name("tabstrip2")
.Items(tabstrip =>
{
    tabstrip.Add().Text("Customer Information")
         .Content(@<div>
                <form action="/Customer/AddData" data-ajax="true" data-ajax-method="post" id="form0" method="post" novalidate="novalidate">
                    <input type="button" class="k-button" value="Submit" onclick="checkValues()" />
                </form>
                </div>
                );
          })
    )

I get my desired effect. The form is inside the tabstrip's div along with the button.

I am just wondering if I'm not really gonna be able to use the html helper to create forms inside the tabstrip's content, or I am just missing something for the html helper to work. Your replies are much appreciated. 

7 Answers, 1 is accepted

Sort by
0
Accepted
Vladimir Iliev
Telerik team
answered on 09 Oct 2012, 02:40 PM
Hi,

In your case you should Render the TabStrip to be able to use an Html helpers inside the TabStrip content:

@{Html.Kendo().TabStrip()
        .Name("tabstrip")
        .Items(tabstrip =>
        {
            tabstrip.Add().Text("Paris")
                .Selected(true)
                .Content(@<text>
                    @using (Ajax.BeginForm("AddData", "Customer", new AjaxOptions { HttpMethod = "post" }))
                    {
                        <div>Content of Form</div>
                    }
                </text>);
        }).Render();
        }


Kind Regards,
Vladimir Iliev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
AU
Top achievements
Rank 1
answered on 10 Oct 2012, 02:15 AM
Thanks Vladimir! Even though we decided to just simulate a tabstrip using divs. your solution did work on the problem!
0
Lyubomyr
Top achievements
Rank 1
answered on 17 Nov 2014, 07:58 PM
Works well
0
Nikhil
Top achievements
Rank 1
answered on 16 Jan 2015, 11:04 AM

@{Html.Kendo().TabStrip()
        .Name("tabstrip")
        .Items(tabstrip =>
        {
            tabstrip.Add().Text("Paris")
                .Selected(true)
                .Content(@<text>
                    @using (Ajax.BeginForm("AddData", "Customer", new AjaxOptions { HttpMethod = "post" }))
                    {
                        <div>Content of Form</div>
                    }
                </text>);
                       tabstrip.Add().Text("New York")
                .Selected(true)
                .Content(@<text>
                    @using (Ajax.BeginForm("AddData", "Customer", new AjaxOptions { HttpMethod = "post" }))
                    {
                        <div>@Html.Kendo().Editor().Name("Test")</div>
                    }
                </text>);
                       tabstrip.Add().Text("Hyderabad")
                .Selected(true)
                .Content(@<text>
                    @using (Ajax.BeginForm("AddData", "Customer", new AjaxOptions { HttpMethod = "post" }))
                    {
                        <div>Content of Form</div>
                    }
                </text>);
        }).Render();
        }

this Code is giving error Unhandled exception at line 32, column 29102 in http://localhost:64098/Scripts/kendo/kendo.all.min.js

0x800a138f - JavaScript runtime error: Unable to get property 'isTypingInProgress' of undefined or null reference
what are thing i am missing ?
Please help 


0
Vladimir Iliev
Telerik team
answered on 19 Jan 2015, 10:11 AM
Hi Nikhil,


I tried to reproduce the problem locally but to no avail – everything is working as expected on our side. Could you please open a new support ticket and provide runable project where the issue is reproduced? This would help us pinpoint the exact reason for this behavior.

Regards,
Vladimir Iliev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
ajith
Top achievements
Rank 1
answered on 18 May 2015, 05:27 AM

Hi Vladimir

   please help me. how can i add button for this, 

@(Html.Kendo().TabStrip()
   .HtmlAttributes(new {Styles.DefaultTagFormat })
   .Name("AssetMasterTab")
 
   .Items(tabstrip =>
   {
       tabstrip.Add().Text("Asset Details")
           .Selected(true)
           .ContentHtmlAttributes(new { style = "overflow: auto;" })
           .LoadContentFrom("Assetdetails", "Asset");
 
       tabstrip.Add().Text("Vehicle Details")
         .LoadContentFrom("PopupWindow", "Location");
 
   })
           )

0
Dimo
Telerik team
answered on 21 May 2015, 06:11 AM
Hi Ajith,

Please do not ask the same question in multiple threads. If you want to make additional clarifications on the button-inside-tabstrip discussion, use this thread:

http://www.telerik.com/forums/table-in-tabstrip-going-off-screen-in-ie-using-mvc

Regards,
Dimo
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
TabStrip
Asked by
AU
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
AU
Top achievements
Rank 1
Lyubomyr
Top achievements
Rank 1
Nikhil
Top achievements
Rank 1
ajith
Top achievements
Rank 1
Dimo
Telerik team
Share this question
or