I used multi view in my web site. I wanna insert news in this website in step 1 I insert short description and some other data when I want to go to step 2 I received this error:
Invalid postback or callback argument. Event validation is enabled
using in configuration or <%#
Page EnableEventValidation="true" %> in a page. For security
purposes, this feature verifies that arguments to postback or callback
events originate from the server control that originally rendered
them. If the data is valid and expected, use the
ClientScriptManager.RegisterForEventValidation method in order to
register the postback or callback data for validation.
code
<%# Page Title="" Language="C#" MasterPageFile="~/AdminMaster.master" AutoEventWireup="true" CodeFile="AdminNews.aspx.cs" ValidateRequest="false" Inherits="AdminNews" %>
</asp:View>
<asp:View ID="Vnew" runat="server">
<div class="col-md-12 col-xs-12 col-sm-12">
<div class="col-md-1 col-xs-12 col-sm-1"></div>
<div class="col-md-10 col-xs-12 col-sm-10">
<section class="panel text-center">
<header class=" label label-info icon-plus-sign text-center">
درج خبر جدید
</header>
<div class="panel-body">
<div class="btn-group btn-group-justified">
<div class="col-md-12 col-xs-12 col-sm-12">
<form role="form">
<div class="form-group">
<label for="exampleInputEmail1" class="pull-right">نام:</label>
<asp:TextBox ID="txtNameNew" runat="server" type="text" class="form-control pull-right"></asp:TextBox>
</div>
<br />
<div class="form-group">
<label for="exampleInputPassword1" class="pull-right">تاریخ:</label>
<asp:TextBox ID="txtDateNew" runat="server" type="text" class="form-control pull-right" ></asp:TextBox>
</div>
<br />
<div class="form-group">
<label for="exampleInputPassword1" class="pull-right">دسته خبر: </label>
<asp:DropDownList ID="ddlCategoryNew" runat="server" CssClass=" form-control">
</asp:DropDownList>
</div>
<br />
<div class="form-group">
<label for="exampleInputPassword1" class="">توضیحات کوتاه </label>
<br />
<br />
<br />
<textarea id="txtShortDEsNew" cols="20" rows="10" runat="server" class="form-control pull-right"></textarea>
</div>
<div class=" form-group">
<label for="exampleInputFile" class="pull-Right"> یک تصویرانتخاب کنید.</label>
<asp:FileUpload ID="fuNew" CssClass="" runat="server" />
</div>
</form>
<asp:Label ID="lblWarning" runat="server" Text="هیچ تصویری انتخاب نکرده اید." CssClass="fixWarning2"></asp:Label>
<div class="col-md-2 col-xs-12 col-sm-2 "><div class="label-default"> </div></div>
<div class="pull-right col-md-10 col-xs-12 col-sm-10">
</div>
</div>
</div>
</div>
<div class="col-md-12 col-xs-12 col-sm-12 PaddingZiro">
<div class="col-md-1 col-xs-12 col-sm-1 pull-right"></div>
<div class="col-md-10 col-xs-12 col-sm-10 pull-right">
<div class="col-md-12 col-xs-12 col-sm-12 myheader">
<div class="col-md-1 col-xs-12 col-sm-1 pull-right"></div>
<div class="col-md-10 col-xs-12 col-sm-10 pull-right">
<div class="col-md-12 col-xs-12 col-sm-12 fixWarning2">
</div>
<div class="col-md-12 col-xs-12 col-sm-12 fixWarning2">
</div>
</div>
<div class="col-md-12 col-xs-12 col-sm-12 MarginBotom15">
<div class="pull-right col-md-3 col-xs-12 col-sm-3 NewSocialnetTTl">تصویر: </div>
</div>
<div class="col-md-12 col-xs-12 col-sm-12 MarginBotom15">
<div class="pull-right col-md-3 col-xs-12 col-sm-3 NewSocialnetTTl"></div>
<div class="pull-right col-md-9 col-xs-12 col-sm-9">
<asp:LinkButton ID="returnbtn" runat="server" CssClass="btn btn-warning pull-left" OnClick="lbtnReturn_Click">بازگشت</asp:LinkButton>
<asp:LinkButton ID="SocialRegist" runat="server" CssClass="btn btn-success pull-left MarginLeft20" OnClick="lbtnInsertStep1_Click">مرحله بعد</asp:LinkButton>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
</div>
</asp:View>
<asp:View ID="vnewStep2" runat="server">
<div class="col-md-12 col-xs-12 col-sm-12 PaddingZiro">
<div class="col-md-1 col-xs-12 col-sm-1 pull-right"></div>
<div class="col-md-10 col-xs-12 col-sm-10 pull-right">
<div class="col-md-12 col-xs-12 col-sm-12 myheader">
توضیحات اصلی
<asp:Label ID="lblNewsMaxid" runat="server" Text="" Visible="false"></asp:Label>
</div>
</div>
</div>
<div class="col-md-12 col-xs-12 col-sm-12 PaddingZiro">
<div class="col-md-1 col-xs-12 col-sm-1 pull-right"></div>
<div class="col-md-10 col-xs-12 col-sm-10 pull-right">
<div class="col-md-12 col-xs-12 col-sm-12 myheader">
<div class="col-md-12 col-xs-12 col-sm-12 text-center fixWarning2 MarginBotom15">برای آپلود فایل از این قسمت می توانید استفاده کنید</div>
<div class="col-md-12 col-xs-12 col-sm-12 ">
<div class="col-md-3 col-xs-12 col-sm-3 pull-right"></div>
<div class="col-md-6 col-xs-12 col-sm-6 pull-right text-center">
<asp:Label ID="Label1" runat="server" Text="Label" CssClass="pull-right">انتخاب فایل</asp:Label>
<asp:LinkButton ID="btnAboutUsInsertFiles" runat="server" CssClass="btn btn-success pull-left" OnClick="btnInsertFiles_Click">ارسال</asp:LinkButton>
<asp:FileUpload ID="fuFilesTable" runat="server" CssClass="pull-left" />
</div>
<div class="col-md-3 col-xs-12 col-sm-3 pull-right"></div>
</div>
<div class="col-md-12 col-xs-12 col-sm-12 ">
<asp:Label ID="lblSiteName" runat="server" Text=""></asp:Label>
<asp:GridView ID="GVFilesTable" runat="server" AutoGenerateColumns="False" BackColor="White" BorderColor="#3366CC" BorderStyle="None" BorderWidth="1px" CellPadding="4" DataKeyNames="id" Width="100%" OnRowCommand="GVProductsFiles_RowCommand">
<Columns>
<asp:BoundField DataField="id" HeaderText="کد" HeaderStyle-CssClass="ProductBoxHeaderStyle">
<HeaderStyle CssClass="ProductBoxHeaderStyle" />
<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" BorderColor="#047269" BorderWidth="2px" />
</asp:BoundField>
<asp:BoundField DataField="Pic" HeaderText="عکس" HeaderStyle-CssClass="ProductBoxHeaderStyle">
<HeaderStyle CssClass="ProductBoxHeaderStyle" />
<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" BorderColor="#047269" CssClass="GVItemStyle" />
</asp:BoundField>
<asp:TemplateField HeaderText="حذف" HeaderStyle-CssClass="ProductBoxHeaderStyle">
<ItemTemplate>
<asp:LinkButton ID="btnProductDelletFile" runat="server" CssClass="btn btn-warning" Text="حذف" CommandArgument='<%#Eval("id") %>' CommandName="DeleteFile">حذف</asp:LinkButton>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" BorderColor="#047269" CssClass="GVItemStyle" />
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
<textarea id="txtLongDEsNew" cols="20" rows="25" runat="server"></textarea>
<asp:Label ID="lblRegistWarning" runat="server" Text="متن شما با موفقیت ذخیره شد" CssClass="fixWarning2"></asp:Label>
<div class="col-md-12 col-xs-12 col-sm-12 margintop10px">
<div class="col-md-3 col-xs-12 col-sm-3 pull-right"></div>
<div class="col-md-6 col-xs-12 col-sm-6 pull-right text-center">
<asp:LinkButton ID="btnAboutUsSave" runat="server" CssClass="btn btn-success pull-right" OnClick="lbtnInserStep2_Click">ذخیره</asp:LinkButton>
<asp:LinkButton ID="btnAboutUsReturn" runat="server" CssClass="pull-left btn btn-info" OnClick="lbtnReturn_Click">بازگشت</asp:LinkButton>
</div>
<div class="col-md-3 col-xs-12 col-sm-3 pull-right"></div>
</div>
</div>
</div>
</div>
</asp:View>
<asp:View ID="vEdith" runat="server">
<div class="col-md-12 col-xs-12 col-sm-12 PaddingZiro">
<div class="col-md-1 col-xs-12 col-sm-1 pull-right"></div>
<div class="col-md-10 col-xs-12 col-sm-10 pull-right">
<div class="col-md-12 col-xs-12 col-sm-12 myheader">
ویرایش
</div>
</div>
</div>
<div class="col-md-12 col-xs-12 col-sm-12 PaddingZiro">
<div class="col-md-1 col-xs-12 col-sm-1 pull-right"></div>
<div class="col-md-10 col-xs-12 col-sm-10 pull-right">
<div class="col-md-12 col-xs-12 col-sm-12 myheader">
<div class="col-md-12 col-xs-12 col-sm-12 text-center MarginBotom15">
<asp:ImageButton ID="img_edith" runat="server" />
</div>
<div class="col-md-12 col-xs-12 col-sm-12 MarginBotom15">
<div class="pull-right col-md-3 col-xs-12 col-sm-3 NewSocialnetTTl">ویرایش تصویر: </div>
<asp:FileUpload ID="fUEdith" runat="server" />
</div>
<div class="col-md-12 col-xs-12 col-sm-12 MarginBotom15">
<div class="pull-right col-md-2 col-xs-12 col-sm-2 NewSocialnetTTl">نام: </div>
<div class="pull-right col-md-10 col-xs-12 col-sm-10">
<asp:TextBox ID="txtNameEdith" runat="server" type="text" class="form-control pull-right"></asp:TextBox>
</div>
</div>
<div class="col-md-12 col-xs-12 col-sm-12 MarginBotom15">
<div class="pull-right col-md-2 col-xs-12 col-sm-2 NewSocialnetTTl">تاریخ </div>
<div class="pull-right col-md-10 col-xs-12 col-sm-10">
<asp:TextBox ID="txtDateEdith" runat="server" type="text" class="form-control pull-right"></asp:TextBox>
</div>
</div>
<div class="col-md-12 col-xs-12 col-sm-12 MarginBotom15">
<div class="pull-right col-md-2 col-xs-12 col-sm-2 NewSocialnetTTl">دسته بندی: </div>
<div class="pull-right col-md-10 col-xs-12 col-sm-10">
<asp:DropDownList ID="DdlCategoryEdith" runat="server" CssClass="form-control Myform-control">
</asp:DropDownList>
</div>
</div>
<div class="col-md-12 col-xs-12 col-sm-12 MarginBotom15">
<div class="pull-right col-md-2 col-xs-12 col-sm-2 NewSocialnetTTl">توضیحات کوتاه: </div>
<div class="pull-right col-md-10 col-xs-12 col-sm-10">
<textarea id="txtShortDescribEdith" cols="20" rows="10" runat="server" class="form-control pull-right"></textarea>
</div>
</div>
<div class="col-md-12 col-xs-12 col-sm-12 margintop10">
<div class="col-md-2 col-xs-12 col-sm-2 pull-right"></div>
<div class="col-md-8 col-xs-12 col-sm-8 pull-right text-center">
<asp:Label ID="Label3" runat="server" Text="Label" CssClass="pull-right">انتخاب فایل</asp:Label>
<asp:LinkButton ID="LinkButton8" runat="server" CssClass="btn btn-success pull-left" OnClick="lbtnSendFileInEdith_Click">ارسال</asp:LinkButton>
<asp:FileUpload ID="FuProductEdithINNEr" runat="server" CssClass="pull-left" />
<div class="col-md-12 col-xs-12 col-sm-12 margintop10">
<asp:Label ID="Label2" runat="server" Text=""></asp:Label>
<asp:GridView ID="GVproductFileinedith" runat="server" AutoGenerateColumns="False" BackColor="White" BorderColor="#3366CC" BorderStyle="None" BorderWidth="1px"
CellPadding="4" DataKeyNames="id" Width="100%" OnRowCommand="GVproductFileinedith_RowCommand">
<Columns>
<asp:BoundField DataField="id" HeaderText="کد" HeaderStyle-CssClass="ProductBoxHeaderStyle">
<HeaderStyle CssClass="ProductBoxHeaderStyle" />
<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" BorderColor="#047269" BorderWidth="2px" />
</asp:BoundField>
<asp:BoundField DataField="ApicUrl" HeaderText="آدرس" HeaderStyle-CssClass="ProductBoxHeaderStyle">
<HeaderStyle CssClass="ProductBoxHeaderStyle" />
<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" BorderColor="#047269" CssClass="GVItemStyle" />
</asp:BoundField>
<asp:TemplateField HeaderText="حذف" HeaderStyle-CssClass="ProductBoxHeaderStyle">
<ItemTemplate>
<asp:LinkButton ID="btnProductDelletFile" runat="server" CssClass="btn btn-warning" Text="حذف" CommandArgument='<%#Eval("id") %>' CommandName="DeleteFile">حذف</asp:LinkButton>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" BorderColor="#047269" CssClass="GVItemStyle" />
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</div>
<div class="col-md-12 col-xs-12 col-sm-12 margintop10">
<textarea id="txtLongDescribeEdit" cols="20" rows="20" runat="server"></textarea>
</div>
<div class="col-md-12 col-xs-12 col-sm-12 margintop10px">
<div class="col-md-3 col-xs-12 col-sm-3 pull-right"></div>
<div class="col-md-6 col-xs-12 col-sm-6 pull-right text-center">
<asp:LinkButton ID="lbtnEdithNews" runat="server" CssClass="btn btn-success pull-right" OnClick="lbtnEdithNews_Click">ذخیره</asp:LinkButton>
<asp:LinkButton ID="lbtnReturn" runat="server" CssClass="pull-left btn btn-info" OnClick="lbtnReturn_Click">بازگشت</asp:LinkButton>
</div>
<div class="col-md-3 col-xs-12 col-sm-3 pull-right"></div>
</div>
</div>
</div>
</div>
</asp:View>
<asp:View ID="vDelet" runat="server">
<div class="col-md-12 col-xs-12 col-sm-12 PaddingZiro">
<div class="col-md-1 col-xs-12 col-sm-1 pull-right"></div>
<div class="col-md-10 col-xs-12 col-sm-10 pull-right">
<div class="col-md-12 col-xs-12 col-sm-12 myheader">
حذف
</div>
</div>
</div>
<div class="col-md-12 col-xs-12 col-sm-12 PaddingZiro">
<div class="col-md-1 col-xs-12 col-sm-1 pull-right"></div>
<div class="col-md-10 col-xs-12 col-sm-10 pull-right">
<div class="col-md-12 col-xs-12 col-sm-12 myheader">
آیا با حذف موافقید؟
<div class="col-md-12 col-xs-12 col-sm-12 MarginBotom15">
<div class="pull-right col-md-4 col-xs-12 col-sm-4 NewSocialnetTTl"></div>
<div class="pull-right col-md-4 col-xs-12 col-sm-4 text-center">
<asp:LinkButton ID="LinkButton2" runat="server" CssClass="btn btn-warning pull-left" OnClick="lbtnReturn_Click">بازگشت</asp:LinkButton>
<asp:LinkButton ID="LinkButton3" runat="server" CssClass="btn btn-success pull-right MarginLeft20" OnClick="lbtnDelet_Click">حذف</asp:LinkButton>
</div>
<div class="pull-right col-md-4 col-xs-12 col-sm-4 NewSocialnetTTl"></div>
</div>
</div>
</div>
</div>
</asp:View>
<asp:View ID="vComment" runat="server">
<div class="col-md-12 col-xs-12 col-sm-12 PaddingZiro">
<div class="col-md-1 col-xs-12 col-sm-1 pull-right"></div>
<div class="col-md-10 col-xs-12 col-sm-10 pull-right">
<div class="col-md-12 col-xs-12 col-sm-12 myheader text-center">
نظرات کاربران
<br />
<br />
<asp:Label ID="lblCommentWarning" runat="server" Text="در خواست شما با موفقیت انجام شد" CssClass="fixWarning" Visible="false"></asp:Label>
</div>
</div>
</div>
<div class="col-md-12 col-xs-12 col-sm-12 PaddingZiro">
<div class="col-md-1 col-xs-12 col-sm-1 pull-right"></div>
<div class="col-md-10 col-xs-12 col-sm-10 pull-right">
<div class="col-md-12 col-xs-12 col-sm-12">
<%-- every comment start from here--%>
<asp:DataList ID="dlMessage" runat="server" OnItemCommand="dlMessage_ItemCommand">
<ItemTemplate>
<div class="col-md-12 col-xs-12 col-sm-12 MarginBotom15 commentStyle">
<div class="col-md-4 col-xs-4 col-sm-4 pull-right">
<asp:Label ID="lblCommentName" runat="server" Text='<%#Eval("name") %>'></asp:Label>
</div>
<div class="col-md-4 col-xs-4 col-sm-4 pull-right text-center">
<div class="col-md-6 col-xs-12 col-sm-6 pull-right text-center">
<i class="fa fa-thumbs-o-up" aria-hidden="true"> </i>
<asp:Label ID="lblCommentLike" runat="server" Text='<%#Eval("cmlike") %>'></asp:Label>
</div>
<div class="col-md-6 col-xs-12 col-sm-6 pull-right text-center">
<i class="fa fa-thumbs-o-down" aria-hidden="true"> </i>
<asp:Label ID="lblCommentDisLike" runat="server" Text='<%#Eval("dislike") %>'></asp:Label>
</div>
</div>
<div class="col-md-4 col-xs-4 col-sm-4 pull-right">
<asp:LinkButton ID="lbtnCommentDelet" runat="server" CssClass=" btn btn-danger " data-toggle="tooltip" title="حذف" CommandName="delete" CommandArgument='<%#Eval("id")%>'>
<i class=" icon-trash" aria-hidden="true"></i>
</asp:LinkButton>
<asp:LinkButton ID="lbtnMCommentBlock" runat="server" CssClass="btn btn default pull-left hlBlock" data-toggle="tooltip" title="غیر فعال کردن" CommandName="block" CommandArgument='<%#Eval("id")%>'>
<i class=" icon-ban-circle " aria-hidden="true"></i>
</asp:LinkButton>
<span class="pull-left spacerStyle">/</span>
<asp:LinkButton ID="lbtnCommentActive" runat="server" CssClass="btn btn default pull-left hlActive" data-toggle="tooltip" title="فعال کردن" CommandName="active" CommandArgument='<%#Eval("id")%>'>
<i class=" icon-check " aria-hidden="true"></i>
</asp:LinkButton>
</div>
<div class="col-md-12 col-xs-12 col-sm-12 MarginBotom15 text-justify">
<asp:Label ID="lblCommentBody" runat="server" Text='<%#Eval("commentBdy") %>'></asp:Label>
</div>
<div class="col-md-12 col-xs-12 col-sm-12 MarginBotom15 text-justify">
<div class="col-md-2 col-xs-12 col-sm-2 pull-right text-center">
<asp:Label ID="lblCommentDate" runat="server" Text='<%#Eval("commentdate") %>'></asp:Label>
</div>
<div class="col-md-2 col-xs-12 col-sm-2 pull-right text-center">
<asp:Label ID="lblCommentTime" runat="server" Text='<%#Eval("time") %>'></asp:Label>
</div>
<div class="col-md-4 col-xs-12 col-sm-4 pull-right text-center">
<asp:Label ID="lblCommentip" runat="server" Text='<%#Eval("ip") %>'></asp:Label>
</div>
<div class="col-md-4 col-xs-12 col-sm-4 pull-right text-center">
<asp:Label ID="lblCommentEmail" runat="server" Text='<%#Eval("email") %>'></asp:Label>
</div>
</div>
</div>
</ItemTemplate>
</asp:DataList>
</div>
</div>
</div>
</asp:View>
</asp:MultiView>
</section>
</section>
</asp:Content>
whats wrong ?
Related
I am trying to add validation on Editor but it cants work. here is my code
when I run this and fill field its give me an error.
<section style="padding-top: 120px" class="info-area pb-120 container-fluid">
<div class="container-fluid">
<div class="row align-items-center">
<div class="col-lg-12 no-padding info-area-left">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<div class="form-horizontal" runat="server" id="FormControls">
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">Your Name</label>
<div class="col-sm-10">
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtUserName" ForeColor="Red" Display="Dynamic" ValidationGroup="inq" ErrorMessage="Enter name"></asp:RequiredFieldValidator>
<asp:TextBox ID="txtUserName" CssClass="form-control text-uppercase" runat="server" placeholder="Your name"></asp:TextBox>
</div>
</div>
<div class="form-group">
<label for="inputPassword3" class="col-sm-2 control-label">Your Testimonial</label>
<div class="col-sm-10">
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="Editor1" ForeColor="Red" Display="Dynamic" ValidationGroup="inq" ErrorMessage="Enter Testimonial"></asp:RequiredFieldValidator>
<cc1:Editor ID="Editor1" runat="server" placeholder="Testimonial" />
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<asp:Button ID="btnSend" OnClick="btnSend_Click" CssClass="primary-btn text-uppercase" ValidationGroup="inq" runat="server" Text="Send" />
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</section>
may helps you
In my webapplication page ,top of the page contain seven linkbutton .So i am adding asp.net update panel .After including that the linkbutton events are not worked.Without using the update panel it work well. How can I solve the problem?
Here is my code:
<div class="container">
<asp:UpdatePanel runat="server" ID="up1" UpdateMode="Conditional"><ContentTemplate>
<div class="col-md-12" data-wow-delay="0s">
<div class="filter_menu ">
<div class="boltsort">Sort By:</div>
<div class="boltsortlist">
<asp:LinkButton ID="lkrecomm" runat="server">Recommended</asp:LinkButton> |
<asp:LinkButton ID="lkrating" runat="server">User Rating</asp:LinkButton> |
<asp:LinkButton ID="lkprice" runat="server" OnClick="lkprice_Click">Price</asp:LinkButton> |
<asp:LinkButton ID="lkDistance" runat="server" OnClick="lkDistance_Click">Distance</asp:LinkButton> |
<asp:LinkButton ID="lkA_Z" runat="server" OnClick="lkA_Z_Click" Text="A-Z"></asp:LinkButton> |
<asp:LinkButton ID="lkNewest" runat="server" OnClick="lkNewest_Click">Newest</asp:LinkButton> |
<asp:LinkButton ID="lkHalal" runat="server" OnClick="lkHalal_Click">Halal</asp:LinkButton>
</div>
</div>
</div>
</ContentTemplate></asp:UpdatePanel>
<div class="col-md-12">
<div class="left_side_choose_list">
<div class="select_rest">
<p class="left_span">Choose Multi / Restaurant</p>
<div id="dl-menu" class="dl-menuwrapper">
<div class="top_arrow dl-trigger"><i class="glyphicon glyphicon-chevron-right"></i></div>
<div class="menu_list dl-menu">
<div class="all_menu text-left">Available Restaurant near you..</div>
<div class="panel-group null_margin" id="accordion">
<asp:ListView ID="LvCuisine" runat="server" OnItemDataBound="OnItemDataBound">
<ItemTemplate>
<div class="accoring panel-default">
<div class="accor_styles text-left">
<a class="accordion-toggle panel-title" data-toggle="collapse-next" data-parent=".accoring">
<asp:HiddenField ID="hdCuisineID" runat="server" Value='<%# Eval("ID") %>' />
<asp:CheckBox runat="server" Text='<%# Eval("CuisineName")%>' CssClass="ui-checkboxcuisine" ID="chk11" />
</a>
</div>
<div class="panel-collapse collapse">
<div class="panel-body padd_null text-left">
<div class="driving-license-kind">
<asp:Repeater ID="RptItems" runat="server">
<ItemTemplate>
<div class="checkbox_accor">
<div id="chkdiv">
<asp:HiddenField ID="hdRID" runat="server" Value='<%# Eval("RID") %>' />
<asp:CheckBox runat="server" Text='<%# Eval("RestaurantTitle")%>' CssClass="ui-checkbox " />
</div>
</div>
</ItemTemplate></asp:Repeater>
</div>
</div>
</div>
</div>
</ItemTemplate></asp:ListView>
<asp:Button ID="btndone" runat="server" class="btn accor_btn pull-right test" Text="Done" OnClick="btndone_Click" />
</div>
</div>
</div>
</div>
</div>
<div class="row ">
<div class="col-md-12 col-sm-12 col-xs-12" data-wow-delay="0s">
<asp:ListView ID="lvRestaurants" runat="server" OnItemCommand="lvRestaurants_ItemCommand">
<ItemTemplate>
<div class="a_brandstore_details12 ">
<div class="a_pro_inner">
<div class="a_brand_logo">
<asp:Image runat="server" ID="Image2" Width="133px" Height="113px" ImageUrl='<%# Eval("ImagePath")%>' /></div>
<div class="a_details fix_width">
<div class="a_name">
<asp:Label ID="lbl_Resttitle" runat="server" Text='<%# Eval("RestaurantTitle")%>'></asp:Label></div>
<div class="a_address123">
<div class="a_brad_food">
<asp:Label ID="lbl_Cuisines" runat="server" Text='<%# Eval("CuisineName")%>'></asp:Label></div>
<div class="a_order_rating">
<img src="/CustomerPortalTemplate/images/rating.jpg"></div>
</div>
</div>
<div class="brand_details">
<div class="a_address123">
<div class="a_brad_open">
Open at :
<asp:Label Text='<%# Eval("OpenTime") %>' runat="server" />
</div>
<div class="a_deli_time">Delivery Fee : $ 1.0</div>
<div class="a_order">Minimum Order :
<asp:Label Text='<%# Eval("MinimumOrder") %>' runat="server" /></div>
<div class="avilable_range">
<div class="icons_place"><asp:Image ImageUrl='<%# (bool)Eval("WirelessFacility")==true ? "/CustomerPortalTemplate/img/wi-fi.png" : "/CustomerPortalTemplate/img/wi-fi_r.png" %>' runat="server"/></div>
<div class="icons_place"><asp:Image ImageUrl='<%# (bool)Eval("ParkingFacility")==true ? "/CustomerPortalTemplate/img/parking.png" : "/CustomerPortalTemplate/img/parking_r.png" %>' runat="server" /></div>
<div class="icons_place"><asp:Image ImageUrl='<%# (bool)Eval("DisableAccess")==true ? "/CustomerPortalTemplate/img/disabled.png" : "/CustomerPortalTemplate/img/disabled_r.png" %>' runat="server" /></div>
</div>
<asp:Label ID="lbldist" runat="server" Text='<%# Eval("Distance")%>' Visible="false"></asp:Label>
</div>
</div>
<div class="bottom_buttons">
<div class="button_div text-left fix_width ">
<input type="button" value="Group Order" class="btn restaurant_btn ">
</div>
<div class="button_div text-left padd_left_50">
<input type="button" value="Book Table" class="btn restaurant_btn ">
</div>
<div class="button_div text-left">
<asp:Button ID="btnorder" class="btn restaurant_btn" Text='<%# Eval("BUTTONNAME")%>' CommandArgument='<%#Eval("ID")+ ","+Eval("RestaurantTitle") %>' CommandName="OrderRestId" runat="server"></asp:Button>
</div>
</div>
<div class="a_brand_offer123 hidden-390" style="background: url(/CustomerPortalTemplate/images/offer-bg.png) no-repeat">
<span class="offer">20%</span><br />
<span class="offer">OFF</span>
</div>
</div>
</div>
</ItemTemplate>
</asp:ListView>
</div>
</div>
</div>
</div>
I have a problem with my site
I have this modal:
<div class="modal fade " id="loginModal" tabindex="-1" role="dialog" aria-labelledby="loginModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content login-modal">
<div class="modal-header login-modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title text-center" id="loginModalLabel">Autenticazione utente</h4>
</div>
<div class="modal-body">
<div class="text-center">
<div class="form-group">
<asp:Panel ID="pError" Visible="false" runat="server">
<div class="alert alert-dismissable alert-danger" id="confirm" runat="server">
<asp:Label ID="lblError" runat="server"> </asp:Label>
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
</div>
</asp:Panel>
</div>
<div role="tabpanel" id="pnl" class="login-tab">
<!-- SCHEDE -->
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active"><a id="signin-taba" href="#home" aria-controls="home" role="tab" data-toggle="tab">Accedi</a></li>
<li role="presentation"><a id="signup-taba" href="#profile" aria-controls="profile" role="tab" data-toggle="tab">Registrati</a></li>
<li role="presentation"><a id="forgetpass-taba" href="#forget_password" aria-controls="forget_password" role="tab" data-toggle="tab">Recupero</a></li>
</ul>
<!-- LOGIN -->
<div class="tab-content">
<div role="tabpanel" class="tab-pane active text-center" id="home">
<div class="clearfix"></div>
<%-- email --%>
<div class="form-group">
<div class="input-group">
<div class="input-group-addon"><i class="fa fa-at"></i></div>
<asp:TextBox ID="txtLoginEmail" CssClass="form-control" placeholder="Email" runat="server"></asp:TextBox>
</div>
<asp:RequiredFieldValidator ID="vLoginEmail" runat="server" Display="dynamic" ControlToValidate="txtLoginEmail" ForeColor="Red" ValidationGroup="validator" ErrorMessage="*Email obbligatoria"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="reLoginEmail" runat="server" ValidationGroup="validator" ControlToValidate="txtLoginEmail" Display="Dynamic" ForeColor="red" ErrorMessage="Inserire l'email nel formato corretto" SetFocusOnError="True" ValidationExpression="\w+([-+.']\w+)*#\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
</div>
<div class="form-group">
<div class="input-group">
<div class="input-group-addon"><i class="fa fa-lock"></i></div>
<asp:TextBox type="password" ID="txtLoginPassword" class="form-control" placeholder="Password" runat="server"></asp:TextBox>
</div>
</div>
<asp:Button ID="btnLogin" OnClick="btnLogin_Click" CssClass="btn btn-danger" data-loading-text="Signing In...." ValidationGroup="validator" runat="server" Text="Accedi"></asp:Button>
<input id="resetLogin" class="btn btn-danger" runat="server" type="reset" value="reset" />
<div class="clearfix"></div>
<div class="login-modal-footer">
<div class="row">
<div class="col-xs-8 col-sm-8 col-md-8">
<i class="fa fa-lock"></i>
Recupero
</div>
<div class="col-xs-4 col-sm-4 col-md-4">
<i class="fa fa-check"></i>
Registrati
</div>
</div>
</div>
</div>
<%-- REGISTRAZIONE --%>
<div role="tabpanel" class="tab-pane" id="profile">
<div class="clearfix"></div>
<div class="form-group">
<div class="input-group">
<label class="radio-inline">
<asp:RadioButton ID="rbUtente" GroupName="rbTipologia" Checked="true" runat="server" />Utente</label>
<label class="radio-inline">
<asp:RadioButton ID="rbRistoratore" GroupName="rbTipologia" runat="server" />Ristoratore</label>
</div>
</div>
<div class="form-group">
<div class="input-group">
<div class="input-group-addon"><i class="fa fa-user"></i></div>
<%-- username --%>
<asp:TextBox class="form-control" ID="txtNome" placeholder="Nome" runat="server"></asp:TextBox>
</div>
<asp:RequiredFieldValidator ID="vtxtNome" runat="server" Display="dynamic" ControlToValidate="txtNome" ForeColor="Red" ValidationGroup="validator2" ErrorMessage="*Nome obbligatorio"></asp:RequiredFieldValidator>
</div>
<%-- cognome --%>
<div class="form-group ">
<div class="input-group ">
<div class="input-group-addon"><i class="fa fa-user"></i></div>
<asp:TextBox class="form-control" ID="txtCognome" placeholder="Cognome" runat="server"></asp:TextBox>
</div>
<asp:RequiredFieldValidator ID="vCognome" runat="server" Display="dynamic" ControlToValidate="txtCognome" ForeColor="Red" ValidationGroup="validator2" ErrorMessage="*Cognome obbligatorio"></asp:RequiredFieldValidator>
</div>
<%-- email --%>
<div class="form-group">
<div class="input-group">
<div class="input-group-addon"><i class="fa fa-at"></i></div>
<asp:TextBox class="form-control" ID="txtEmail" placeholder="Email" runat="server"></asp:TextBox>
</div>
<asp:RequiredFieldValidator ID="vEmail" runat="server" Display="dynamic" ControlToValidate="txtEmail" ForeColor="Red" ValidationGroup="validator2" ErrorMessage="*Email obbligatoria"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="reEmail" runat="server" ValidationGroup="validator2" ControlToValidate="txtEmail" Display="Dynamic" ForeColor="red" ErrorMessage="Inserire l'email nel formato corretto" SetFocusOnError="True" ValidationExpression="\w+([-+.']\w+)*#\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
</div>
<%-- password --%>
<div class="form-group ">
<div class="input-group ">
<div class="input-group-addon"><i class="fa fa-lock"></i></div>
<asp:TextBox type="password" class="form-control" ID="txtPassword" placeholder="Password" runat="server"></asp:TextBox>
</div>
<asp:RequiredFieldValidator ID="vPassword" runat="server" Display="dynamic" ControlToValidate="txtPassword" ForeColor="Red" ValidationGroup="validator2" ErrorMessage="*Password obbligatoria"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="rePassword" runat="server" ValidationGroup="validator2" ControlToValidate="txtPassword" Display="Dynamic" ForeColor="red" ErrorMessage="La password deve contenere: minimo 8 caratteri; almeno 1 maiuscola; almeno 1 minuscola; almeno 1 numero" SetFocusOnError="True" ValidationExpression="^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{8,15}$"></asp:RegularExpressionValidator>
</div>
<%-- password controllo --%>
<div class="form-group ">
<div class="input-group">
<div class="input-group-addon"><i class="fa fa-lock"></i></div>
<asp:TextBox type="password" class="form-control" ID="txtCPassword" placeholder="Conferma password" runat="server"></asp:TextBox>
</div>
<asp:CompareValidator ID="cvPassword" ValidationGroup="validator2" Display="Dynamic" runat="server" ForeColor="Red" ControlToCompare="txtPassword" ControlToValidate="txtCPassword" ErrorMessage="La password non corrisponde"></asp:CompareValidator>
<asp:Label ID="lblRegistrazione" Visible="false" runat="server" ></asp:Label>
</div>
<asp:Button ID="btnSignin" CssClass="btn btn-danger " data-loading-text="Registrando...." OnClick="btnSignin_Click" ValidationGroup="validator2" runat="server" Text="Registrati"></asp:Button>
<input id="r2" class="btn btn-danger" runat="server" type="reset" value="reset" />
<div class="clearfix"></div>
<div class="login-modal-footer">
<div class="row">
<div class="col-xs-8 col-sm-8 col-md-8">
<i class="fa fa-lock"></i>
Password dimenticata?
</div>
<div class="col-xs-4 col-sm-4 col-md-4">
<i class="fa fa-check"></i>
Registrati
</div>
</div>
</div>
</div>
<div role="tabpanel" class="tab-pane text-center" id="forget_password">
<div class="clearfix"></div>
<%--RECUPERO --%>
<div class="form-group">
<div class="input-group">
<div class="input-group-addon"><i class="fa fa-at"></i></div>
<asp:TextBox class="form-control" ID="txtRecEmail" placeholder="Email" runat="server"></asp:TextBox>
</div>
<asp:Label ID="lblRecovery" runat="server" ></asp:Label>
<asp:RequiredFieldValidator ID="vREmail" runat="server" Display="dynamic" ControlToValidate="txtRecEmail" ForeColor="Red" ValidationGroup="validator3" ErrorMessage="*Email obbligatoria"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="reREmail" runat="server" ValidationGroup="validator3" ControlToValidate="txtRecEmail" Display="Dynamic" ForeColor="red" ErrorMessage="Inserire l'email nel formato corretto" SetFocusOnError="True" ValidationExpression="\w+([-+.']\w+)*#\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
</div>
<asp:Button ID="btnRecovery" OnClick="btnRecovery_Click" CssClass="btn btn-danger reco" data-loading-text="Invio...." ValidationGroup="validator3" runat="server"></asp:Button>
<div class="clearfix"></div>
<div class="login-modal-footer">
<div class="row">
<div class="col-xs-6 col-sm-6 col-md-6">
<i class="fa fa-lock"></i>
Registrazione
</div>
<div class="col-xs-6 col-sm-6 col-md-6">
<i class="fa fa-check"></i>
Accesso
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
It has 3 tabs: Signin (LOGIN), Signup (Registrazione) and forgot password (RECUPERO).
It is a bit 'difficult to explain but I'll try:
In the 3 cards I have 3 buttons.
If I am in my third card and I press enter key, the computer triggers the onclick event of the button that is located on the first tab.
I tried this jquery code but it doesn't work:
$(document).keypress(function (event) {
var keycode = (event.keyCode ? event.keyCode : event.which);
if (keycode == '13') {
if ($('#home').is(":visible")) {
$("#btnLogin").trigger("click");
}
else if ($('#profile').is(":visible")) {
$("#btnSignin").trigger("click");
}
else {
$('#btnRecovery').click(ShowPopUp);
}
}
}
);
Do you have any solution?
P.S.
If I use the browser's console the javascript code work, but when i try it on my project it doesn't work...
Please help me... this is my exam's project...
Create a local variable(in the jQuery load function) called currentTab
Create a click event for your tabs(<li> tags)
In the click event set the currentTab variable to the clicked <li>
Modify your keypress function to evaluate the currentTab variable and trigger the relevant click event
<script type="text/javascript">
$(function () {
$("#show").click(function () {
jQuery.noConflict();
$("#loginModal").modal('show');
});
var currentTab = "";
$(".nav li").click(function () {
var li = $(this);
var liText = li.text();
currentTab = liText;
alert('You clicked on "' + liText + '" now lets store this value in a variable called currentTab');
});
$(document).keydown(function (event) {
debugger;
var keycode = (event.keyCode ? event.keyCode : event.which);
if (keycode == '13') {
switch (currentTab) {
case "Accedi":
$("#btnLogin").trigger("click");
break;
case "Registrati":
$("#btnSignin").trigger("click");
break;
case "Recupero":
$("#btnRecovery").trigger("click");
break;
}
}
});
});
</script>
Can't make work the simple 'accordion' script from JqueryUI on my asp.net page .aspx.
I can't find good documentation on the accordion on these cirumstances, only simple html <p><h3><div> etc...
For example this is my code on the aspx page:
<%# Page Language="C#" MasterPageFile="~/Zulcon_ppal.Master" AutoEventWireup="true" CodeBehind="EnvianosTuCurriculum.aspx.cs" Inherits="Grupo_Zulcon.EnvianosTuCurriculum" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<script>
$(function() {
$( "#accordion" ).accordion({
heightStyle: "content"
});
});
</script>
<style type="text/css">
.curriculumContainer
{
width:90%;
color:#646464;
margin:30px auto;
} and then more page specific css... </asp:Content>
Then i want to try it with a title in a <div> but nothing happens:
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div class="fixed-width-wrapper contentContainer">
<div style="padding:20px">
<div style="padding-bottom:5px; border-bottom:solid 1px #cccccc; background-image:url('images/menuzulcon3.png'); height: 59px; width: 953px;" class="titulosGeneral";></div>
<div style="padding-bottom:5px; border-bottom:solid 1px #cccccc" class="titulosGeneral">Bachillerato</div>
<div class="curriculumdivcompleto">
<div id="accordion">
<div class="curriculumLadoRegistroizq">
<div style="margin-top:10px" class="autenticacionTitulo">Lugar (Ciudad, Pais)</div>
<div style="margin-top:5px"><asp:TextBox ID="Lugar_pri" runat="server" MaxLength="100" ValidationGroup="Curriculum" CssClass="autenticacionTextBox"></asp:TextBox></div>
</div>
<div class="curriculumLadoRegistro2">
<div style="margin-top:10px" class="autenticacionTitulo">Nombre de la Institución</div>
<div style="margin-top:5px"><asp:TextBox ID="Insti_pri" runat="server" MaxLength="100" ValidationGroup="Curriculum" CssClass="autenticacionTextBox"></asp:TextBox></div>
</div>
<div class="curriculumLadoRegistroizq">
<div style="margin-top:10px" class="autenticacionTitulo">Año titulación</div>
<div style="margin-top:5px"><asp:TextBox ID="año_pri" runat="server" MaxLength="100" ValidationGroup="Curriculum" CssClass="autenticacionTextBox"></asp:TextBox></div>
</div>
<div class="curriculumLadoRegistro2">
<div style="margin-top:10px" class="autenticacionTitulo">Años cursados</div>
<div style="margin-top:5px"><asp:TextBox ID="cursados_pri" runat="server" MaxLength="100" ValidationGroup="Curriculum" CssClass="autenticacionTextBox"></asp:TextBox></div>
</div>
<div> </div>
<div style="padding-bottom:5px; border-bottom:solid 1px #cccccc" class="titulosGeneral">Formación Superior</div>
<div class="curriculumLadoRegistroizq">
<div style="margin-top:10px" class="autenticacionTitulo">Lugar (Ciudad, Pais)</div>
<div style="margin-top:5px"><asp:TextBox ID="Lugar_sec" runat="server" MaxLength="100" ValidationGroup="Curriculum" CssClass="autenticacionTextBox"></asp:TextBox></div>
</div>
<div class="curriculumLadoRegistro2">
<div style="margin-top:10px" class="autenticacionTitulo">Nombre de la Institución</div>
<div style="margin-top:5px"><asp:TextBox ID="Nombre_sec" runat="server" MaxLength="100" ValidationGroup="Curriculum" CssClass="autenticacionTextBox"></asp:TextBox></div>
</div>
<div class="curriculumLadoRegistroizq">
<div style="margin-top:10px" class="autenticacionTitulo">Titulo obtenido</div>
<div style="margin-top:5px"><asp:TextBox ID="titulo_sec" runat="server" MaxLength="100" ValidationGroup="Curriculum" CssClass="autenticacionTextBox"></asp:TextBox></div>
</div>
<div class="curriculumLadoRegistroizq2">
<div style="margin-top:10px" class="autenticacionTitulo">Año de titulación</div>
<div style="margin-top:5px"><asp:TextBox ID="año_sec" runat="server" MaxLength="25" ValidationGroup="Curriculum" CssClass="autenticacionTextBoxReducido"></asp:TextBox></div>
</div>
<div class="curriculumLadoRegistroizq3">
<div style="margin-top:10px" class="autenticacionTitulo">Semestres cursados</div>
<div style="margin-top:5px"><asp:TextBox ID="Semestre_sec" runat="server" MaxLength="25" ValidationGroup="Curriculum" CssClass="autenticacionTextBoxReducido"></asp:TextBox></div>
</div>
</div>
</div>
<div style="text-align:right; margin-top:20px"><asp:Button ID="Button3" runat="server" ValidationGroup="Curriculum" postbackurl="Envia4.aspx" OnClick="Register" CssClass="my_btn"/></div>
</div>
</div>
</asp:Content>
I don't know if i'm doing something wrong, could anyone shed some light on this?
Thanks in advance.
Found this in the documentation page, if it's what you are looking for
The markup of your accordion container needs pairs of headers and content panels:
<div id="accordion">
<h3>First header</h3>
<div>First content panel</div>
<h3>Second header</h3>
<div>Second content panel</div>
</div>
Accordions support arbitrary markup, but each content panel must always be the next sibling after its associated header. See the header option for information on how to use custom markup structures.
UPDATES:
<div class="fixed-width-wrapper contentContainer">
<div style="padding:20px">
<div style="padding-bottom:5px; border-bottom:solid 1px #cccccc; background-image:url('images/menuzulcon3.png'); height: 59px; width: 953px;" class="titulosGeneral";></div>
<div class="curriculumdivcompleto">
<div id="accordion">
<div style="padding-bottom:5px; border-bottom:solid 1px #cccccc" class="titulosGeneral">Bachillerato</div>
<div>
<div class="curriculumLadoRegistroizq">
<div style="margin-top:10px" class="autenticacionTitulo">Lugar (Ciudad, Pais)</div>
<div style="margin-top:5px"><asp:TextBox ID="Lugar_pri" runat="server" MaxLength="100" ValidationGroup="Curriculum" CssClass="autenticacionTextBox"></asp:TextBox></div>
</div>
<div class="curriculumLadoRegistro2">
<div style="margin-top:10px" class="autenticacionTitulo">Nombre de la Institución</div>
<div style="margin-top:5px"><asp:TextBox ID="Insti_pri" runat="server" MaxLength="100" ValidationGroup="Curriculum" CssClass="autenticacionTextBox"></asp:TextBox></div>
</div>
<div class="curriculumLadoRegistroizq">
<div style="margin-top:10px" class="autenticacionTitulo">Año titulación</div>
<div style="margin-top:5px"><asp:TextBox ID="año_pri" runat="server" MaxLength="100" ValidationGroup="Curriculum" CssClass="autenticacionTextBox"></asp:TextBox></div>
</div>
<div class="curriculumLadoRegistro2">
<div style="margin-top:10px" class="autenticacionTitulo">Años cursados</div>
<div style="margin-top:5px"><asp:TextBox ID="cursados_pri" runat="server" MaxLength="100" ValidationGroup="Curriculum" CssClass="autenticacionTextBox"></asp:TextBox></div>
</div>
</div>
<div> </div>
<div style="padding-bottom:5px; border-bottom:solid 1px #cccccc" class="titulosGeneral">Formación Superior</div>
<div class="curriculumLadoRegistroizq">
<div style="margin-top:10px" class="autenticacionTitulo">Lugar (Ciudad, Pais)</div>
<div style="margin-top:5px"><asp:TextBox ID="Lugar_sec" runat="server" MaxLength="100" ValidationGroup="Curriculum" CssClass="autenticacionTextBox"></asp:TextBox></div>
</div>
<div class="curriculumLadoRegistro2">
<div style="margin-top:10px" class="autenticacionTitulo">Nombre de la Institución</div>
<div style="margin-top:5px"><asp:TextBox ID="Nombre_sec" runat="server" MaxLength="100" ValidationGroup="Curriculum" CssClass="autenticacionTextBox"></asp:TextBox></div>
</div>
<div class="curriculumLadoRegistroizq">
<div style="margin-top:10px" class="autenticacionTitulo">Titulo obtenido</div>
<div style="margin-top:5px"><asp:TextBox ID="titulo_sec" runat="server" MaxLength="100" ValidationGroup="Curriculum" CssClass="autenticacionTextBox"></asp:TextBox></div>
</div>
<div class="curriculumLadoRegistroizq2">
<div style="margin-top:10px" class="autenticacionTitulo">Año de titulación</div>
<div style="margin-top:5px"><asp:TextBox ID="año_sec" runat="server" MaxLength="25" ValidationGroup="Curriculum" CssClass="autenticacionTextBoxReducido"></asp:TextBox></div>
</div>
<div class="curriculumLadoRegistroizq3">
<div style="margin-top:10px" class="autenticacionTitulo">Semestres cursados</div>
<div style="margin-top:5px"><asp:TextBox ID="Semestre_sec" runat="server" MaxLength="25" ValidationGroup="Curriculum" CssClass="autenticacionTextBoxReducido"></asp:TextBox></div>
</div>
</div>
</div>
<div style="text-align:right; margin-top:20px"><asp:Button ID="Button3" runat="server" ValidationGroup="Curriculum" postbackurl="Envia4.aspx" OnClick="Register" CssClass="my_btn"/></div>
</div>
</div>
I making an add form in my modal. The modal contains 2 dropdownlists, 4 textboxes (1 hidden) and a button for adding.
I bind my dropdown list for the item category then bind my other dropdown list for the item name. However when I change my Item Category in my dropdown list the dropdown list for my item name is not responding or it not binding. Can anyone help me?
<div id="addModal" class="modal fade">
<div class="modal-dialog modal-md">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">Add Item</h4>
</div>
<div class="modal-body">
<div class="form-inline form-group">
<asp:Label ID="Label1" CssClass="control-label col-xs-3" runat="server" Text="Category:"></asp:Label>
<div class="col-xs-offset-3">
<asp:DropDownList ID="drpCategory" runat="server" CssClass="form-control col-xs-5" OnTextChanged="drpCategory_TextChanged" />
</div>
</div>
<div class="form-inline form-group">
<asp:Label ID="Label2" CssClass="control-label col-xs-3" runat="server" Text="Item Name:"></asp:Label>
<div class="col-xs-offset-3">
<asp:TextBox ID="txtitem" runat="server" CssClass="form-control col-xs-5" Visible="false" />
<asp:DropDownList ID="drpItem" runat="server" CssClass="form-control col-xs-5" Visible="true" />
</div>
</div>
<div class="form-inline form-group">
<asp:Label ID="Label3" CssClass="control-label col-xs-3" runat="server" Text="Unit:"></asp:Label>
<div class="col-xs-offset-3">
<asp:TextBox ID="txtUnit" runat="server" CssClass="form-control col-xs-5" Enabled="false" />
</div>
</div>
<div class="form-inline form-group">
<asp:Label ID="Label4" CssClass="control-label col-xs-3" runat="server" Text="Quantity:"></asp:Label>
<div class="col-xs-offset-3">
<asp:TextBox ID="txtQty" runat="server" CssClass="form-control col-xs-3" type="number" min="1" onkeypress="return isNumberKey(event)" />
</div>
</div>
</div>
</div>
<div class="modal-footer">
<asp:Button runat="server" ID="btnADD" CssClass="btn btn-sm" OnClick="btnADD_Click" Text="Add" />
</div>
</div>
</div>
then this is the code behind:
public void drpCategory_TextChanged(object sender, EventArgs e)
{
if (drpCategory.Text == "Others")
{
drpItem.Visible = false;
txtitem.Visible = true;
}
else
{
byCateg();
DataBind();
drpItem.Visible = true;
txtitem.Visible = false;
}
}
Is there a problem in my code?