Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Dec 31, 2012 10:26 AM by momna89
0 Points
2 Posts
Dec 30, 2012 10:29 PM|LINK
I'm trying to create a page where roles is assign to the logged in user.
But I'm getting an error regarding the html tags.
This is my code
@if (WebSecurity.IsAuthenticated && Roles.IsUserInRole("Admin")) { <Form method="post" action=""> <div class="art-layout-cell art-content-sidebar1"> <div class = 'middle'> <br><br><label><b style="margin-left: 55px;">Category: </b></label> <select> <option>-Select-</option> @foreach(var category in data) { <option>@category.Name</option> } </select> <span><input type = "button" value = "+" onclick="addCategory()" /></span> <span><input type = "button" value = "Delete" onclick="delCategory()" /></span> <span><input type = "button" value = "Update" onclick="updateCategory()" style="margin-left: 479px; margin-top: -45px; margin-right: -21px;"/></span> <span><br><br><label><b>Name: </b></label></span> @if (ProductId != "") { <input type="text" name= "Name" class ="clear" value = "@Name2" placeholder="Product Name" @Validation.For("Name")> @Html.ValidationMessage("Name")<br> } else { <input type="text" name= "Name" class ="clear" value = "@Name" placeholder="Product Name" @Validation.For("Name")> @Html.ValidationMessage("Name")<br> } <span><br><label><b>Description: </b></label></span> @if (ProductId != "") { <input type="text" name= "Description" class ="clear" value ="@Description2" placeholder="Product Description" @Validation.For("Description")> @Html.ValidationMessage("Description")<br> } else { <input type="text" name= "Description" class ="clear" value ="@Description" placeholder="Product Description" @Validation.For("Description")> @Html.ValidationMessage("Description")<br> } <span><br><label><b>Price: </b></label></span> @if (ProductId != "") { <input type="text" name= "Price" class ="clear" value = "@Price2" placeholder="Price" @Validation.For("Price")> @Html.ValidationMessage("Price")<br> } else { <input type="text" name= "Price" class ="clear" value = "@Price" placeholder="Price" @Validation.For("Price")> @Html.ValidationMessage("Price")<br> } <span><br><label><b>Quantity: </b></label></span> @if (ProductId != "") { <input type="text" name= "Quantity" class ="clear" value = "@Quantity2" placeholder="Quantity" @Validation.For("Quantity")><br> @Html.ValidationMessage("Quantity")<br> } else { <input type="text" name= "Quantity" class ="clear" value = "@Quantity" placeholder="Quantity" @Validation.For("Quantity")><br> @Html.ValidationMessage("Quantity")<br> } </div> <div style="width:96%; margin-right:66%"> <span> <b><label style="margin: 33px; font-size: medium">Image Uploader:</label></b></span> <input type = "file" name = "ImageUploader" style= "margin: -24px;" /></p> </div> <div style="width:96%; margin-left:66%"> <br /> <input type = "submit" class = "buttonSave" value = "Save" /> <input type="submit" class = "buttonSave" value="Assign Role" onclick="AssignAdmin('AR')"/></br></br></br></br></br></br></br></br></br> <div id="AssignRole"></div> </div> </div> </Form> }
All-Star
35888 Points
7333 Posts
Dec 30, 2012 11:58 PM|LINK
Try move form tag out of if condition
Star
7504 Points
1466 Posts
Dec 31, 2012 04:15 AM|LINK
<Form method="post" action="" runat='server'> @if (WebSecurity.IsAuthenticated && Roles.IsUserInRole("Admin")) { <div class="art-layout-cell art-content-sidebar1"> <div class = 'middle'> <br><br><label><b style="margin-left: 55px;">Category: </b></label> <select> <option>-Select-</option> @foreach(var category in data) { <option>@category.Name</option> } </select> <span><input type = "button" value = "+" onclick="addCategory()" /></span> <span><input type = "button" value = "Delete" onclick="delCategory()" /></span> <span><input type = "button" value = "Update" onclick="updateCategory()" style="margin-left: 479px; margin-top: -45px; margin-right: -21px;"/></span> <span><br><br><label><b>Name: </b></label></span> @if (ProductId != "") { <input type="text" name= "Name" class ="clear" value = "@Name2" placeholder="Product Name" @Validation.For("Name")> @Html.ValidationMessage("Name")<br> } else { <input type="text" name= "Name" class ="clear" value = "@Name" placeholder="Product Name" @Validation.For("Name")> @Html.ValidationMessage("Name")<br> } <span><br><label><b>Description: </b></label></span> @if (ProductId != "") { <input type="text" name= "Description" class ="clear" value ="@Description2" placeholder="Product Description" @Validation.For("Description")> @Html.ValidationMessage("Description")<br> } else { <input type="text" name= "Description" class ="clear" value ="@Description" placeholder="Product Description" @Validation.For("Description")> @Html.ValidationMessage("Description")<br> } <span><br><label><b>Price: </b></label></span> @if (ProductId != "") { <input type="text" name= "Price" class ="clear" value = "@Price2" placeholder="Price" @Validation.For("Price")> @Html.ValidationMessage("Price")<br> } else { <input type="text" name= "Price" class ="clear" value = "@Price" placeholder="Price" @Validation.For("Price")> @Html.ValidationMessage("Price")<br> } <span><br><label><b>Quantity: </b></label></span> @if (ProductId != "") { <input type="text" name= "Quantity" class ="clear" value = "@Quantity2" placeholder="Quantity" @Validation.For("Quantity")><br> @Html.ValidationMessage("Quantity")<br> } else { <input type="text" name= "Quantity" class ="clear" value = "@Quantity" placeholder="Quantity" @Validation.For("Quantity")><br> @Html.ValidationMessage("Quantity")<br> } </div> <div style="width:96%; margin-right:66%"> <span> <b><label style="margin: 33px; font-size: medium">Image Uploader:</label></b></span> <input type = "file" name = "ImageUploader" style= "margin: -24px;" /></p> </div> <div style="width:96%; margin-left:66%"> <br /> <input type = "submit" class = "buttonSave" value = "Save" /> <input type="submit" class = "buttonSave" value="Assign Role" onclick="AssignAdmin('AR')"/></br></br></br></br></br></br></br></br></br> <div id="AssignRole"></div> </div> </div> } </Form>
Dec 31, 2012 10:26 AM|LINK
Guys, i tried your suggestions but now it is giving the same errors in other html tag like div . please sort out my isssue.
momna89
0 Points
2 Posts
Encountered end tag "form" with no matching start tag. Are your start/end tags properly balanced...
Dec 30, 2012 10:29 PM|LINK
I'm trying to create a page where roles is assign to the logged in user.
But I'm getting an error regarding the html tags.
This is my code
oned_gk
All-Star
35888 Points
7333 Posts
Re: Encountered end tag "form" with no matching start tag. Are your start/end tags properly bala...
Dec 30, 2012 11:58 PM|LINK
Try move form tag out of if condition
Suwandi - Non Graduate Programmer
sameer_khanj...
Star
7504 Points
1466 Posts
Re: Encountered end tag "form" with no matching start tag. Are your start/end tags properly bala...
Dec 31, 2012 04:15 AM|LINK
<Form method="post" action="" runat='server'> @if (WebSecurity.IsAuthenticated && Roles.IsUserInRole("Admin")) { <div class="art-layout-cell art-content-sidebar1"> <div class = 'middle'> <br><br><label><b style="margin-left: 55px;">Category: </b></label> <select> <option>-Select-</option> @foreach(var category in data) { <option>@category.Name</option> } </select> <span><input type = "button" value = "+" onclick="addCategory()" /></span> <span><input type = "button" value = "Delete" onclick="delCategory()" /></span> <span><input type = "button" value = "Update" onclick="updateCategory()" style="margin-left: 479px; margin-top: -45px; margin-right: -21px;"/></span> <span><br><br><label><b>Name: </b></label></span> @if (ProductId != "") { <input type="text" name= "Name" class ="clear" value = "@Name2" placeholder="Product Name" @Validation.For("Name")> @Html.ValidationMessage("Name")<br> } else { <input type="text" name= "Name" class ="clear" value = "@Name" placeholder="Product Name" @Validation.For("Name")> @Html.ValidationMessage("Name")<br> } <span><br><label><b>Description: </b></label></span> @if (ProductId != "") { <input type="text" name= "Description" class ="clear" value ="@Description2" placeholder="Product Description" @Validation.For("Description")> @Html.ValidationMessage("Description")<br> } else { <input type="text" name= "Description" class ="clear" value ="@Description" placeholder="Product Description" @Validation.For("Description")> @Html.ValidationMessage("Description")<br> } <span><br><label><b>Price: </b></label></span> @if (ProductId != "") { <input type="text" name= "Price" class ="clear" value = "@Price2" placeholder="Price" @Validation.For("Price")> @Html.ValidationMessage("Price")<br> } else { <input type="text" name= "Price" class ="clear" value = "@Price" placeholder="Price" @Validation.For("Price")> @Html.ValidationMessage("Price")<br> } <span><br><label><b>Quantity: </b></label></span> @if (ProductId != "") { <input type="text" name= "Quantity" class ="clear" value = "@Quantity2" placeholder="Quantity" @Validation.For("Quantity")><br> @Html.ValidationMessage("Quantity")<br> } else { <input type="text" name= "Quantity" class ="clear" value = "@Quantity" placeholder="Quantity" @Validation.For("Quantity")><br> @Html.ValidationMessage("Quantity")<br> } </div> <div style="width:96%; margin-right:66%"> <span> <b><label style="margin: 33px; font-size: medium">Image Uploader:</label></b></span> <input type = "file" name = "ImageUploader" style= "margin: -24px;" /></p> </div> <div style="width:96%; margin-left:66%"> <br /> <input type = "submit" class = "buttonSave" value = "Save" /> <input type="submit" class = "buttonSave" value="Assign Role" onclick="AssignAdmin('AR')"/></br></br></br></br></br></br></br></br></br> <div id="AssignRole"></div> </div> </div> } </Form>sameer.khanjit@gmail.com
View Blog
Click "Mark as Answer" on the post that helped you.
momna89
0 Points
2 Posts
Re: Encountered end tag "form" with no matching start tag. Are your start/end tags properly bala...
Dec 31, 2012 10:26 AM|LINK
Guys, i tried your suggestions but now it is giving the same errors in other html tag like div . please sort out my isssue.