Here Is The Code, I'll Explain it better at the end of the post
<div class="container">
<br />
<div id="infoCli" class="well" style="height: auto; width: auto;">
<table>
<tr>
<td>
<asp:Label runat="server" AssociatedControlID="cdCli" Enabled="False">Código</asp:Label>
<br />
<asp:TextBox runat="server" ID="cdCli" Width="40px" ReadOnly="True" />
</td>
<td class="auto-style39">
<asp:Label runat="server" AssociatedControlID="nmFantasia">Nome Fantasia</asp:Label>
<asp:RequiredFieldValidator runat="server" ID="rfvNmFantasia" ControlToValidate="nmFantasia" CssClass="field-validation-error" ErrorMessage="*" />
<br />
<asp:TextBox runat="server" ID="nmFantasia" Width="368px" MaxLength="30" TabIndex="1" />
</td>
<td>
<asp:Label runat="server" AssociatedControlID="nmCli">Razão Social</asp:Label>
<asp:RequiredFieldValidator runat="server" ID="rfvNmCli" ControlToValidate="nmCli" CssClass="field-validation-error" ErrorMessage="*" />
<br />
<asp:TextBox runat="server" ID="nmCli" Width="589px" TabIndex="2" />
</td>
</tr>
</table>
<table>
<tr>
<td class="auto-style42">
<asp:Label runat="server" AssociatedControlID="tpCli">Tipo de Cliente</asp:Label>
<br />
<asp:DropDownList ID="tpCli" runat="server" Height="25px" Width="145px" TabIndex="3" Enabled="False">
<asp:ListItem Value="0">Somente Consulta</asp:ListItem>
<asp:ListItem Value="1">Eventual</asp:ListItem>
<asp:ListItem Value="2">C/ Contrato</asp:ListItem>
</asp:DropDownList>
</td>
<td class="auto-style54">
<asp:Label runat="server" AssociatedControlID="nrCGC">CNPJ</asp:Label>
<br />
<asp:TextBox runat="server" ID="nrCGC" Width="138px" TabIndex="4" />
</td>
<td class="auto-style69">
<asp:Label runat="server" AssociatedControlID="nrCPF">CPF</asp:Label>
<br />
<asp:TextBox runat="server" ID="nrCPF" Width="110px" TabIndex="5" />
</td>
<td class="auto-style43">
<asp:Label runat="server" AssociatedControlID="nrCGF">CGF</asp:Label>
<asp:RequiredFieldValidator runat="server" ID="rfvNmCGF" ControlToValidate="nrCGF" CssClass="field-validation-error" ErrorMessage="*" />
<br />
<asp:TextBox runat="server" ID="nrCGF" Width="134px" TabIndex="6" />
</td>
<td class="auto-style32">
<asp:Label runat="server" AssociatedControlID="CheckBox1" TabIndex="7">Isento
<br />
<asp:CheckBox ID="CheckBox1" runat="server" />
</asp:Label>
</td>
<td class="auto-style56">
<asp:Label runat="server" AssociatedControlID="inscMun">Insc. Mun</asp:Label>
<asp:RequiredFieldValidator runat="server" ID="rfvInscMun" ControlToValidate="inscMun" CssClass="field-validation-error" ErrorMessage="*" />
<br />
<asp:TextBox runat="server" ID="inscMun" Width="106px" TabIndex="8" />
</td>
<td class="auto-style55">
<asp:Label runat="server" AssociatedControlID="nrCEI">CEI</asp:Label>
<asp:RequiredFieldValidator runat="server" ID="rfvNmCEI" ControlToValidate="nrCEI" CssClass="field-validation-error" ErrorMessage="*" />
<br />
<asp:TextBox runat="server" ID="nrCEI" Width="133px" TabIndex="9" />
</td>
</tr>
</table>
<table>
<tr>
<td class="auto-style66">
<asp:Label runat="server" AssociatedControlID="nrCep">CEP</asp:Label>
<asp:RequiredFieldValidator runat="server" ID="rfvNmCep" ControlToValidate="nrCep" CssClass="field-validation-error" ErrorMessage="*" />
<br />
<asp:TextBox runat="server" ToolTip="A Consulta ao CEP só será realizada caso esteja conectado à internet" ID="nrCep" onblur="Javascript:atualizacep(this.value)" Width="98px" TabIndex="10" data-mask="99999-999" />
</td>
<td>
<asp:Label runat="server" AssociatedControlID="dsEnder">Endereço</asp:Label>
<asp:RequiredFieldValidator runat="server" ID="rfvDsEnder" ControlToValidate="dsEnder" CssClass="field-validation-error" ErrorMessage="*" />
<br />
<asp:TextBox runat="server" ID="dsEnder" Width="377px" TabIndex="11" />
</td>
<td class="auto-style46">
<asp:Label runat="server" AssociatedControlID="nrEnder">Número</asp:Label>
<asp:RequiredFieldValidator runat="server" ID="rfvNrEnder" ControlToValidate="nrEnder" CssClass="field-validation-error" ErrorMessage="*" />
<br />
<asp:TextBox runat="server" ID="nrEnder" Width="46px" TabIndex="12" />
</td>
<td class="auto-style68">
<asp:Label runat="server" AssociatedControlID="dsBairro">Bairro</asp:Label>
<asp:RequiredFieldValidator runat="server" ID="rfvDsBairro" ControlToValidate="dsBairro" CssClass="field-validation-error" ErrorMessage="*" />
<br />
<asp:TextBox runat="server" ID="dsBairro" Width="196px" TabIndex="13" />
</td>
<td class="auto-style25">
<asp:Label runat="server" AssociatedControlID="compEnder">Complemento</asp:Label>
<asp:RequiredFieldValidator runat="server" ID="rfvCompEnder" ControlToValidate="compEnder" CssClass="field-validation-error" ErrorMessage="*" />
<br />
<asp:TextBox runat="server" ID="compEnder" Width="141px" TabIndex="14" />
</td>
</tr>
</table>
<table>
<tr>
<td class="auto-style43">
<asp:Label runat="server" AssociatedControlID="dsCid">Cidade</asp:Label>
<asp:RequiredFieldValidator runat="server" ID="rfvDsCid" ControlToValidate="dsCid" CssClass="field-validation-error" ErrorMessage="*" />
<br />
<asp:TextBox runat="server" ID="dsCid" Width="414px" TabIndex="15" />
</td>
<td class="auto-style51"> <asp:Label runat="server" AssociatedControlID="cdUF">UF</asp:Label>
<asp:RequiredFieldValidator ID="rfvCdUF" runat="server" ControlToValidate="cdUF" CssClass="field-validation-error" ErrorMessage="*" />
<br />
<asp:TextBox runat="server" ID="cdUF" Width="34px" TabIndex="166" />
</td>
<td class="auto-style48">
<asp:Label runat="server" AssociatedControlID="foCli">Telefone</asp:Label>
<asp:RequiredFieldValidator ID="rfvFoCli" runat="server" ControlToValidate="foCli" CssClass="field-validation-error" ErrorMessage="*" />
<br />
<asp:TextBox runat="server" ID="foCli" Width="122px" TabIndex="17" />
</td>
<td class="auto-style19">
<asp:Label runat="server" AssociatedControlID="nrFax">Fax</asp:Label>
<asp:RequiredFieldValidator runat="server" ID="rfvNrFax" ControlToValidate="nrFax" CssClass="field-validation-error" ErrorMessage="*" />
<br />
<asp:TextBox runat="server" ID="nrFax" Width="126px" TabIndex="18" />
</td>
</tr>
</table>
<table>
<tr>
<td class="auto-style57">
<asp:Label runat="server" AssociatedControlID="cdIBGE" Width="133px">Cód. Cidade IBGE</asp:Label>
<asp:RequiredFieldValidator runat="server" ID="rfvCdIBGE" ControlToValidate="cdIBGE" CssClass="field-validation-error" ErrorMessage="*" />
<br />
<asp:TextBox runat="server" ID="cdIBGE" Width="113px" TabIndex="19" />
</td>
<td class="auto-style52">
<asp:Label runat="server" AssociatedControlID="cdNatOpe" Width="170px">Natureza da Operação</asp:Label>
<asp:RequiredFieldValidator runat="server" ID="rfvCdNatOpe" ControlToValidate="cdNatOpe" CssClass="field-validation-error" ErrorMessage="*" />
<br />
<asp:DropDownList ID="cdNatOpe" runat="server" Height="25px" Width="404px" TabIndex="20">
<asp:ListItem Value="0">(escolha uma opção):</asp:ListItem>
<asp:ListItem Value="1">Tributação No Município</asp:ListItem>
<asp:ListItem Value="2">Tributação Fora do Município</asp:ListItem>
<asp:ListItem Value="3">Isenção</asp:ListItem>
<asp:ListItem Value="4">Imune</asp:ListItem>
<asp:ListItem Value="5">Exigibilidade Suspensa por Decisão Judicial</asp:ListItem>
<asp:ListItem Value="6">Exigibilidade Suspensa por Procedimento Administrativo</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
</table>
<div class="container">
<div class="container">
<div class="row">
<div class="checkbox">
<label for="CheckBox2">
<asp:CheckBox ID="CheckBox2" runat="server" TabIndex="22" />
Simples Nacional
</label>
<label for="CheckBox3">
<asp:CheckBox ID="CheckBox3" runat="server" />
Inadiplente
</label>
<label for="CheckBox4">
<asp:CheckBox ID="CheckBox4" runat="server" TabIndex="23" />
Incentivador Cultural
</label>
<label for="CheckBox5">
<asp:CheckBox ID="CheckBox5" runat="server" TabIndex="24" />
Inativo
</label>
</div>
<br />
</div>
</div>
</div>
<div class="row">
<div class="col-md-6"></div>
<div class="col-md-6 pull-right">
<asp:Button CssClass="btn btn-default" ID="btnCons" runat="server" Text="Consultar" OnClick="Consultar" CausesValidation="false" />
<asp:Button CssClass="btn btn-default" ID="btnInse" runat="server" Text="Inserir" OnClick="Inserir" CausesValidation="false" />
<asp:LinkButton runat="server" OnClick="Consultar" CausesValidation="false" >Consultar</asp:LinkButton>
</div>
</div>
</div>
<%--DIV - WELL--%>
<br />
<div id="endCob" class="well" style="height: auto; width: auto;">
<div class="checkbox-inline">
<label for="CheckBox7" class="checkbox-inline">
<asp:CheckBox ID="checkEndeCob" OnClick="Javascript:checkEndCob()" runat="server" TabIndex="25" />
Endereço do cliente é o mesmo que o Endereço de Cobrança
</label>
</div>
<table>
<tr>
<td class="auto-style28">
<asp:Label runat="server" AssociatedControlID="nrCepCob">CEP</asp:Label>
<br />
<asp:TextBox runat="server" ID="nrCepCob" onblur="Javascript:atualizacep(this.value)" Width="98px" TabIndex="26" />
</td>
<td class="auto-style29">
<asp:Label runat="server" AssociatedControlID="dsEnderCob">Endereço</asp:Label>
<br />
<asp:TextBox runat="server" ID="dsEnderCob" Width="373px" TabIndex="27" />
</td>
<td class="auto-style40">
<asp:Label runat="server" AssociatedControlID="nrEnderCob">Número</asp:Label>
<br />
<asp:TextBox runat="server" ID="nrEnderCob" Width="38px" TabIndex="28" />
</td>
<td class="auto-style31">
<asp:Label runat="server" AssociatedControlID="dsBairroCob">Bairro</asp:Label>
<br />
<asp:TextBox runat="server" ID="dsBairroCob" Width="179px" TabIndex="29" />
</td>
<td class="auto-style25">
<asp:Label runat="server" AssociatedControlID="compEnderCob">Complemento</asp:Label>
<br />
<asp:TextBox runat="server" ID="compEnderCob" Width="194px" TabIndex="30" />
</td>
</tr>
</table>
<table>
<tr>
<td class="auto-style23">
<asp:Label runat="server" AssociatedControlID="dsCidCob">Cidade</asp:Label>
<br />
<asp:TextBox runat="server" ID="dsCidCob" Width="252px" TabIndex="31" />
</td>
<td class="auto-style27">
<asp:Label runat="server" AssociatedControlID="cdUFCob">UF</asp:Label>
<br />
<asp:TextBox runat="server" ID="cdUFCob" Width="33px" TabIndex="32" />
</td>
<td class="auto-style3">
<asp:Label runat="server" AssociatedControlID="foCliCob">Telefone</asp:Label>
<br />
<asp:TextBox runat="server" ID="foCliCob" Width="108px" TabIndex="33" />
</td>
<td class="auto-style19">
<asp:Label runat="server" AssociatedControlID="nrFaxCob">Fax</asp:Label>
<asp:RequiredFieldValidator runat="server" ControlToValidate="nrFaxCob" CssClass="field-validation-error" ErrorMessage="*" />
<br />
<asp:TextBox runat="server" ID="nrFaxCob" Width="113px" TabIndex="34" />
</td>
</tr>
</table>
</div>
<br />
<div id="contatoCli" class="well" style="height: auto; width: auto;">
<table>
<tr>
<td class="auto-style70">
<asp:Label runat="server" AssociatedControlID="nmContat1">Comercial</asp:Label>
<asp:RequiredFieldValidator runat="server" ControlToValidate="nmContat1" CssClass="field-validation-error" ErrorMessage="*" />
<br />
<asp:TextBox runat="server" ID="nmContat1" Width="396px" TabIndex="35" />
</td>
<td class="auto-style72">
<asp:Label runat="server" AssociatedControlID="foneCont1">Telefone</asp:Label>
<asp:RequiredFieldValidator runat="server" ControlToValidate="foneCont1" CssClass="field-validation-error" ErrorMessage="*" />
<br />
<asp:TextBox runat="server" ID="foneCont1" Width="122px" TabIndex="36" />
</td>
<td class="auto-style62">
<asp:Label runat="server" AssociatedControlID="dsEmail1" Width="46px">E-Mail</asp:Label>
<br />
<asp:TextBox runat="server" ID="dsEmail1" Width="343px" TabIndex="37" />
</td>
</tr>
<tr>
<td class="auto-style71">
<asp:Label runat="server" AssociatedControlID="nmContat2">Financeiro</asp:Label>
<asp:RequiredFieldValidator runat="server" ControlToValidate="nmContat2" CssClass="field-validation-error" ErrorMessage="*" />
<br />
<asp:TextBox runat="server" ID="nmContat2" Width="396px" TabIndex="38" />
</td>
<td class="auto-style73">
<asp:Label runat="server" AssociatedControlID="foneCont2">Telefone</asp:Label>
<asp:RequiredFieldValidator runat="server" ControlToValidate="foneCont2" CssClass="field-validation-error" ErrorMessage="*" />
<br />
<asp:TextBox runat="server" ID="foneCont2" Width="122px" TabIndex="39" />
</td>
<td class="auto-style7">
<asp:Label runat="server" AssociatedControlID="dsEmail2">E-Mail</asp:Label>
<asp:RequiredFieldValidator runat="server" ControlToValidate="dsEmail2" CssClass="field-validation-error" ErrorMessage="*" />
<br />
<asp:TextBox runat="server" ID="dsEmail2" Width="343px" TabIndex="40" />
</td>
</tr>
<tr>
<td class="auto-style71">
<asp:Label runat="server" AssociatedControlID="nmContat3">Operacional</asp:Label>
<asp:RequiredFieldValidator runat="server" ControlToValidate="nmContat3" CssClass="field-validation-error" ErrorMessage="*" />
<br />
<asp:TextBox runat="server" ID="nmContat3" Width="396px" TabIndex="41" />
</td>
<td class="auto-style73">
<asp:Label runat="server" AssociatedControlID="foneCont3" Width="66px">Telefone</asp:Label>
<asp:RequiredFieldValidator runat="server" ControlToValidate="foneCont3" CssClass="field-validation-error" ErrorMessage="*" />
<br />
<asp:TextBox runat="server" ID="foneCont3" Width="122px" TabIndex="42" />
</td>
<td class="auto-style7">
<asp:Label runat="server" AssociatedControlID="dsEmail3">E-Mail</asp:Label>
<br />
<asp:TextBox runat="server" ID="dsEmail3" Width="343px" TabIndex="43" />
</td>
</tr>
<tr>
<td class="auto-style71">
<asp:Label runat="server" AssociatedControlID="nmContat4">Expedição</asp:Label>
<asp:RequiredFieldValidator runat="server" ControlToValidate="nmContat4" CssClass="field-validation-error" ErrorMessage="*" />
<br />
<asp:TextBox runat="server" ID="nmContat4" Width="396px" TabIndex="44" />
</td>
<td class="auto-style73">
<asp:Label runat="server" AssociatedControlID="foneCont4">Telefone</asp:Label>
<asp:RequiredFieldValidator runat="server" ControlToValidate="foneCont4" CssClass="field-validation-error" ErrorMessage="*" />
<br />
<asp:TextBox runat="server" ID="foneCont4" Width="122px" TabIndex="45" />
</td>
<td class="auto-style7">
<asp:Label runat="server" AssociatedControlID="dsEmail4">E-Mail</asp:Label>
<asp:RequiredFieldValidator runat="server" ControlToValidate="dsEmail4" CssClass="field-validation-error" ErrorMessage="*" />
<br />
<asp:TextBox runat="server" ID="dsEmail4" Width="343px" TabIndex="46" />
</td>
</tr>
</table>
</div>
<br />
</div>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnCons" EventName="Click" />
</Triggers>
</asp:UpdatePanel>
So, Here is the problem, I have a MasterPage which has the Header and the Footer of the page, and my children page is just the content, so, in this case, this form.
When I First click the button, it will work as planned, it will go on the database retrive my data and move to the textboxes ( texbox.Text = value; ).
But when I change the values, to do a second search the OnClick_Event its not fired, I have a breakpoint in the method so I can see it doesn't get there.
Also, with FireBug on I can see that when I click the button for the first time I get a "Refference Error: MyMethod is Not Defined" but it still brings my data and enters the method.
And when I click it for the second time I get the same Refference Error and I get a
"Error: Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 404"
as well
I'm really new at ASP.NET, I Have an understaining at JSF, But, this had to be done at ASP.NET Webforms
Thanks,
Gabriel
So, Sorry!! haha I feel so dumb for not noticing that earlier!!!
In the Reference Error (JS) it said /MyPage.aspx/MyMethod, but, for some reason i forgot that MyPage.aspx is inside a folder, I still don't quite understand why the second time it "forgot" the page directory, but, I took it of the folder and put it in the project main folder, and it fixed
Related
I have a ListView which has many templates (InsertItemTemplate, AlternatingItemTemplate, EditItemTemplate, EmptyDataTemplate, ItemTemplate, LayoutTemplate, SelectedItemTemplate)
I have this datasource:
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:CouncilsConnectionString %>"
SelectCommand="SELECT [EmpID], [EmpName], [UserName], [password], [Email], [Mobile] FROM [Emp] WHERE ([FlageDel] = #FlageDel)"
DeleteCommand="DELETE FROM Emp WHERE (EmpId = #did)"
InsertCommand="INSERT INTO Emp(EmpName, UserName, password, Email, Mobile) VALUES (#inm, #ius, #ips, #iem, #imob)"
UpdateCommand="UPDATE Emp SET EmpName = #ename, UserName = #nm, password = #ps, Email = #em, Mobile = #mob WHERE (EmpId = #eid)">
<DeleteParameters>
<asp:Parameter Name="did" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="inm" />
<asp:Parameter Name="ius" />
<asp:Parameter Name="ips" />
<asp:Parameter Name="iem" />
<asp:Parameter Name="imob" />
</InsertParameters>
<SelectParameters>
<asp:Parameter DefaultValue="0" Name="FlageDel" Type="Int32" />
</SelectParameters>
<UpdateParameters>
<asp:Parameter Name="ename" />
<asp:Parameter Name="nm" />
<asp:Parameter Name="ps" />
<asp:Parameter Name="em" />
<asp:Parameter Name="mob" />
<asp:Parameter Name="eid" />
</UpdateParameters>
</asp:SqlDataSource>
And in the ItemTemplate I have
<td>
<asp:Button ID="DeleteButton" runat="server" CommandName="Delete" Text="Delete" />
<asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Update" />
</td>
I want to know how can I associate the delete button with the data source command so that it deletes the item when the button is clicked. The same thing for update\insert operations.
Here is the entire ListView Code
<asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource1" InsertItemPosition="LastItem">
<AlternatingItemTemplate>
<tr style="background-color: #FFFFFF;color: #000000;">
<td>
<asp:Button ID="DeleteButton" runat="server" CommandName="Delete" CommandArgument="#did" Text="حذف" />
<asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="تعديل" />
</td>
<td>
<asp:Label ID="EmpNameLabel" runat="server" Text='<%# Eval("EmpName") %>' />
</td>
<td>
<asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' />
</td>
<td>
<asp:Label ID="passwordLabel" runat="server" Text='<%# Eval("password") %>' />
</td>
<td>
<asp:Label ID="EmailLabel" runat="server" Text='<%# Eval("Email") %>' />
</td>
<td>
<asp:Label ID="MobileLabel" runat="server" Text='<%# Eval("Mobile") %>' />
</td>
</tr>
</AlternatingItemTemplate>
<EditItemTemplate>
<tr style="background-color: #999999;">
<td>
<asp:Button ID="UpdateButton" runat="server" CommandName="Update" CommandArgument="#eid" Text="حفظ" />
<asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="إلغاء" />
</td>
<td>
<asp:TextBox ID="EmpNameTextBox" runat="server" Text='<%# Bind("EmpName") %>' />
</td>
<td>
<asp:TextBox ID="UserNameTextBox" runat="server" Text='<%# Bind("UserName") %>' />
</td>
<td>
<asp:TextBox ID="passwordTextBox" runat="server" Text='<%# Bind("password") %>' />
</td>
<td>
<asp:TextBox ID="EmailTextBox" runat="server" Text='<%# Bind("Email") %>' />
</td>
<td>
<asp:TextBox ID="MobileTextBox" runat="server" Text='<%# Bind("Mobile") %>' />
</td>
</tr>
</EditItemTemplate>
<EmptyDataTemplate>
<table runat="server" style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;">
<tr>
<td>ليس هناك أي بيانات حاليا.</td>
</tr>
</table>
</EmptyDataTemplate>
<InsertItemTemplate>
<tr style="">
<td>
<asp:Button ID="InsertButton" runat="server" CommandName="Insert" Text="إضافة" />
<asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="مسح" />
</td>
<td>
<asp:TextBox ID="EmpNameTextBox" runat="server" Text='<%# Bind("EmpName") %>' />
</td>
<td>
<asp:TextBox ID="UserNameTextBox" runat="server" Text='<%# Bind("UserName") %>' />
</td>
<td>
<asp:TextBox ID="passwordTextBox" runat="server" Text='<%# Bind("password") %>' />
</td>
<td>
<asp:TextBox ID="EmailTextBox" runat="server" Text='<%# Bind("Email") %>' />
</td>
<td>
<asp:TextBox ID="MobileTextBox" runat="server" Text='<%# Bind("Mobile") %>' />
</td>
</tr>
</InsertItemTemplate>
<ItemTemplate>
<tr style="background-color: #EEE;color: black;">
<td>
<asp:Button ID="DeleteButton" runat="server" CommandName="Delete" Text="حذف" />
<asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="تعديل" />
</td>
<td>
<asp:Label ID="EmpNameLabel" runat="server" Text='<%# Eval("EmpName") %>' />
</td>
<td>
<asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' />
</td>
<td>
<asp:Label ID="passwordLabel" runat="server" Text='<%# Eval("password") %>' />
</td>
<td>
<asp:Label ID="EmailLabel" runat="server" Text='<%# Eval("Email") %>' />
</td>
<td>
<asp:Label ID="MobileLabel" runat="server" Text='<%# Eval("Mobile") %>' />
</td>
</tr>
</ItemTemplate>
<LayoutTemplate>
<table runat="server" style="direction: rtl; width: 100%">
<tr runat="server">
<td runat="server">
<table id="itemPlaceholderContainer" runat="server" border="1" style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;font-family: Verdana, Arial, Helvetica, sans-serif; text-align: center; vertical-align: middle">
<tr runat="server" style="background-color: #5D7B9D;color: #FFF;">
<th runat="server" style="text-align: center"></th>
<th runat="server" style="text-align: center">الاسم</th>
<th runat="server" style="text-align: center">اسم المستخدم</th>
<th runat="server" style="text-align: center">كلمة المرور</th>
<th runat="server" style="text-align: center">الايميل</th>
<th runat="server" style="text-align: center">الجوال</th>
</tr>
<tr id="itemPlaceholder" runat="server">
</tr>
</table>
</td>
</tr>
<tr runat="server">
<td runat="server" style="text-align: center;background-color: #5D7B9D;font-family: Verdana, Arial, Helvetica, sans-serif;color: #FFFFFF">
<asp:DataPager ID="DataPager1" runat="server">
<Fields>
<asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" ShowLastPageButton="True" />
</Fields>
</asp:DataPager>
</td>
</tr>
</table>
</LayoutTemplate>
<SelectedItemTemplate>
<tr style="background-color: #E2DED6;font-weight: bold;color: #333333;">
<td>
<asp:Button ID="DeleteButton" runat="server" CommandName="Delete" Text="حذف" />
<asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="تعديل" />
</td>
<td>
<asp:Label ID="EmpNameLabel" runat="server" Text='<%# Eval("EmpName") %>' />
</td>
<td>
<asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' />
</td>
<td>
<asp:Label ID="passwordLabel" runat="server" Text='<%# Eval("password") %>' />
</td>
<td>
<asp:Label ID="EmailLabel" runat="server" Text='<%# Eval("Email") %>' />
</td>
<td>
<asp:Label ID="MobileLabel" runat="server" Text='<%# Eval("Mobile") %>' />
</td>
</tr>
</SelectedItemTemplate>
</asp:ListView>
Sorry for the delay, but is the delete button not working? generally when you use the templates, it automatically sets it all up so when you click the delete button it runs the deletecommand. However, the Parameters you currently have
<InsertParameters>
<asp:Parameter Name="inm" />
<asp:Parameter Name="ius" />
<asp:Parameter Name="ips" />
<asp:Parameter Name="iem" />
<asp:Parameter Name="imob" />
</InsertParameters>
Don't seem to be really doing any thing, you need to add what they should be expecting. IE string, char, int... something along those lines.
The other part, is the command argument that you have added to your buttons. I don't think you need that.
Sorry if this is super late and you already figured it out.
I have an aspx page, which looks like this:
When I restore the window, the layout changes to look like this:
How do I stop this from happening? My code is below:
<%# Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
Debug="true" CodeFile="MAIN.aspx.cs" Inherits="MAIN" %>
<script type="text/javascript">
var validFilesTypes = ["jpg", "JPG", "png", "PNG", "jpeg", "gif", "GIF"];
function CheckExtension(file) {
/*global document: false */
var lbl = document.getElementById('<%=lblMessage.ClientID %>');
lbl.innerHTML = "";
var filePath = file.value;
var ext = filePath.substring(filePath.lastIndexOf('.') + 1).toLowerCase();
var isValidFile = false;
for (var i = 0; i < validFilesTypes.length; i++) {
if (ext == validFilesTypes[i]) {
isValidFile = true;
break;
}
}
if (!isValidFile) {
file.value = null;
lbl.innerHTML = "Only jpg, png and gif allowed";
// alert("Invalid File. Valid extensions are:\n\n" + validFilesTypes.join(", "));
return false;
}
return isValidFile;
}
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
<ajaxToolkit:ToolkitScriptManager EnablePartialRendering="true" runat="Server" ID="ScriptManager1" />
<br />
Change Location
<br />
<br />
<div id="divSearch" style="width: 100%; height: 35px">
      <asp:TextBox ID="txtSearch" runat="server" Width="50%"
Height="100%"></asp:TextBox>
<asp:Button ID="btnSearch" runat="server" Height="100%" Text="Search" CausesValidation="false"
OnClick="btnSearch_Click" />
<ajaxToolkit:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender2" WatermarkText="Enter street followed by City"
runat="server" TargetControlID="txtSearch" />
<asp:AdRotator style="margin-left:250px" id="CAdRotator" runat="server" AdvertisementFile="AdRotatorFiles.xml"
Width="200px" Height="100%" Target="_blank"></asp:AdRotator>
</div>
<br />
<asp:Label ID="lblMsg" runat="server" Text="aa" Width="1%" Visible="false"></asp:Label>
<div style="overflow:hidden;">
<input type="hidden" runat="server" id="hcheckQuery" />
<div style="width:80%; float:left;">
<table>
<tr>
<td valign="top">
<table>
<tr>
<td>
<asp:GridView ID="RepDetails" style="float:none" OnRowDataBound="RowDataBound" OnRowCreated="RowCreated" Width="100%" runat="server" AutoGenerateColumns="False" BackColor="White"
BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px">
<FooterStyle BackColor="White" ForeColor="#000066" />
<HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
<RowStyle ForeColor="#000066" />
<SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
<SortedAscendingCellStyle BackColor="#F1F1F1" />
<SortedAscendingHeaderStyle BackColor="#007DBB" />
<SortedDescendingCellStyle BackColor="#CAC9C9" />
<SortedDescendingHeaderStyle BackColor="#00547E" />
</asp:GridView>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<div id="divPost" style="float: right;">
<div>
<asp:Label ID="lblMessage" runat="server" ForeColor="Red"></asp:Label> </div>
<table width="100%" class="imagetable">
<tr>
<td>
Province<asp:DropDownList ID="ddlProvince" CssClass="font1" runat="server" Width="90%">
<asp:ListItem Text="---Select---" Value="-1"></asp:ListItem>
<asp:ListItem Text="Alberta" Value="1" Selected="True"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="ddlProvince"
InitialValue="-1" ErrorMessage="*" ValidationGroup="g1"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
City<br />
<asp:DropDownList ID="ddlCity" CssClass="font1" runat="server" Width="90%">
<asp:ListItem Text="---Select---" Value="-1"></asp:ListItem>
<asp:ListItem Text="Edmonton" Value="1" Selected="True"></asp:ListItem>
<asp:ListItem Text="Calgary" Value="2"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="ddlCity"
InitialValue="-1" ErrorMessage="*" ValidationGroup="g1"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
Description<asp:TextBox ID="txtDescription" CssClass="font1" TextMode="MultiLine"
runat="server" Width="90%"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ControlToValidate="txtDescription"
ErrorMessage="*" ValidationGroup="g1"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
Address<asp:TextBox ID="txtAddress" CssClass="font1" TextMode="MultiLine" runat="server"
Width="90%"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtAddress"
ErrorMessage="*" ValidationGroup="g1"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
Rent (CAD)<asp:TextBox ID="txtRent" CssClass="font1" runat="server" Width="90%"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtRent"
ErrorMessage="*" ValidationGroup="g1"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtRent"
ErrorMessage="*" ValidationExpression="\d+" ValidationGroup="g1">
</asp:RegularExpressionValidator>
</td>
</tr>
<tr>
<td>
Email<asp:TextBox ID="txtEmail" CssClass="font1" runat="server" Width="90%"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="txtEmail"
ErrorMessage="*" ValidationGroup="g1"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
Phone<asp:TextBox ID="txtPhone" CssClass="font1" runat="server" Width="90%"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtPhone"
ErrorMessage="*" ValidationGroup="g1"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
Image<asp:FileUpload ID="fuImage" runat="server" onchange="return CheckExtension(this);" />
</td>
</tr>
<tr>
<td>
<asp:Button ID="btnSubmit" CssClass="font1" runat="server" BackColor="DarkKhaki"
Text="Submit" ValidationGroup="g1" OnClick="btnSubmit_Click" />
</td>
</tr>
</table>
<br />
<br />
<br />
<br />
<br />
<div style="border-style:solid; border-color:Lime">
<asp:Label ID="lblHits" runat="server" ></asp:Label>
</div>
</div>
</div>
I've tried min-width, but that didn't work.
All I had to do was to add resize jquery
Something like this
$(window).resize(function() {
if ($(window).width() <= 1200)
$("body").css("width", "130%");
else
$("body").css("width", "100%");
});
hi i am using createuserwizard server control but facing little bit problem when ever i am registering user through this control it's automatically navigate and login to created user i don't want to that that on user creation go to automatically how can it would be possible any idea.
here is aspx code:-
<asp:CreateUserWizard ID="CreateUserWizard1" runat="server" OnCreatedUser="CreateUserWizard1_CreatedUser" OnNextButtonClick="CreateUserWizard1_NextButtonClick">
<WizardSteps>
<asp:WizardStep ID="CreateUserWizardStep0" runat="server">
<table cellpadding="1" cellspacing="0" style="border-collapse: collapse;" class="MarginStyle">
<tr>
<td>
<h4 class="HeadingThemeColor align I18N">TitleAddTeacher</h4>
</td>
</tr>
<tr>
<td>
<table cellpadding="10">
<tr>
<td>
<asp:Label ID="LblOrganization" CssClass="lblStyle I18N" runat="server">form.data.Organizations</asp:Label>
<br />
<br />
<asp:DropDownList ID="DplOrganization" runat="server">
</asp:DropDownList>
<br />
<asp:RequiredFieldValidator ID="DplOrganizationRequiredFieldValidator" runat="server"
ControlToValidate="DplOrganization" Display="Dynamic" ErrorMessage="Organization Name must Selected."
ToolTip="Organization Name must Selected." ValidationGroup="AddInstitution"><span class="err I18N">error.messages.Organization Name must Selected</span></asp:RequiredFieldValidator>
</td>
<td>
<asp:Label ID="LblInstitutes" CssClass="lblStyle I18N" runat="server">form.data.Institutes</asp:Label>
<br />
<br />
<asp:DropDownList ID="DplInstitutes" runat="server">
</asp:DropDownList>
<br />
<asp:RequiredFieldValidator ID="DplInstitutesRequiredFieldValidator" runat="server"
ControlToValidate="DplInstitutes" Display="Dynamic" ErrorMessage="Institute Name must Selected."
ToolTip="Institute Name must Selected." ValidationGroup="AddBranch"><span class="err I18N">error.messages.Institute Name must Selected</span></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
<asp:Label ID="LblBranches" CssClass="lblStyle I18N" runat="server">form.data.Branches</asp:Label>
<br />
<br />
<asp:DropDownList ID="DplBranch" runat="server">
</asp:DropDownList>
<br />
<asp:RequiredFieldValidator ID="DplBranchRequiredFieldValidator" runat="server"
ControlToValidate="DplBranch" Display="Dynamic" ErrorMessage="Branch Name must Selected."
ToolTip="Branch Name must Selected." ValidationGroup="AddInstitution"><span class="err I18N">error.messages.Branch Name must Selected</span></asp:RequiredFieldValidator>
</td>
<td>
<asp:Label ID="Label4" CssClass="lblStyle I18N" runat="server">form.data.Marital Status</asp:Label>
<br />
<br />
<asp:TextBox ID="TxtMaritalStatus" runat="server" CssClass="txt" placeholder="Marital Status" TextMode="SingleLine"></asp:TextBox>
<br />
<asp:RequiredFieldValidator ID="RequiredFieldValidator16" runat="server"
ControlToValidate="TxtMaritalStatus" Display="Dynamic" ErrorMessage="Marital Status is required."
ToolTip="Marital Status is required." ValidationGroup="AddTeacher"><span class="err I18N">error.messages.Marital Status is required</span></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
<asp:Label ID="Label5" CssClass="lblStyle I18N" runat="server">form.data.Company</asp:Label>
<br />
<br />
<asp:TextBox ID="TxtCompany" runat="server" CssClass="txt" placeholder="Company" TextMode="SingleLine"></asp:TextBox>
<br />
<asp:RequiredFieldValidator ID="RequiredFieldValidator17" runat="server"
ControlToValidate="TxtCompany" ErrorMessage="Company is required."
ToolTip="Company is required." Display="Dynamic" ValidationGroup="AddTeacher"><span class="err I18N">error.messages.Company is required</span></asp:RequiredFieldValidator>
</td>
<td>
<asp:Label ID="Label6" CssClass="lblStyle I18N" runat="server">form.data.Occupation</asp:Label>
<br />
<br />
<asp:TextBox ID="TxtOccupation" runat="server" CssClass="txt" placeholder="Teacher Occupation" TextMode="SingleLine"></asp:TextBox>
<br />
<asp:RequiredFieldValidator ID="RequiredFieldValidator19" runat="server"
ControlToValidate="TxtOccupation" ErrorMessage="Teacher Occupation is required."
ToolTip="Teacher Occupation is required." Display="Dynamic" ValidationGroup="AddTeacher"><span class="err I18N">error.messages.Occupation is required</span></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
<asp:Label ID="Label7" CssClass="lblStyle I18N" runat="server">form.data.Passport Numer</asp:Label>
<br />
<br />
<asp:TextBox ID="TxtPassportNumer" runat="server" CssClass="txt" placeholder="Teacher Postal Code" TextMode="SingleLine"></asp:TextBox>
<br />
<asp:RequiredFieldValidator ID="RequiredFieldValidator20" runat="server"
ControlToValidate="TxtPassportNumer" ErrorMessage="Teacher Passport Numer is required."
ToolTip="Teacher Passport Numer is required." Display="Dynamic" ValidationGroup="AddTeacher"><span class="err I18N">error.messages.Passport Numer is required</span></asp:RequiredFieldValidator>
</td>
<td>
<asp:Label ID="Label8" CssClass="lblStyle I18N" runat="server">form.data.Upload Image</asp:Label>
<br />
<br />
<asp:FileUpload ID="FileUpload1" runat="server" />
</td>
</tr>
</table>
</td>
</tr>
</table>
</asp:WizardStep>
<asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server">
<ContentTemplate>
<table cellpadding="1" cellspacing="0" style="border-collapse: collapse;" class="MarginStyle">
<tr>
<td>
<h4 class="HeadingThemeColor align I18N">TitleAddTeacher</h4>
</td>
</tr>
<tr>
<td>
<table cellpadding="10">
<tr>
<td>
<asp:Label ID="LblUserName" CssClass="lblStyle I18N" runat="server">form.data.UserName</asp:Label>
<br />
<br />
<asp:TextBox runat="server" ID="UserName" CssClass="txt" placeholder="User Name" TextMode="SingleLine"></asp:TextBox>
<br />
<asp:RequiredFieldValidator ID="UserNameRequired" runat="server"
ControlToValidate="UserName" Display="Dynamic" ErrorMessage="User Name is required."
ToolTip="User Name is required." ValidationGroup="AddTeacher"><span class="err I18N">error.messages.User Name is required</span></asp:RequiredFieldValidator>
</td>
<td>
<asp:Label ID="LblPassword" CssClass="lblStyle I18N" runat="server">form.data.Password</asp:Label>
<br />
<br />
<asp:TextBox runat="server" ID="Password" TextMode="Password" CssClass="txt" placeholder="Password"></asp:TextBox>
<br />
<asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server"
ControlToValidate="Password" Display="Dynamic" ErrorMessage="Password is required."
ToolTip="Password is required." ValidationGroup="AddTeacher"><span class="err I18N">error.messages.Password is required</span></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
<asp:Label ID="LblConfirmPassword" CssClass="lblStyle I18N" runat="server">form.data.Confirm Password</asp:Label>
<br />
<br />
<asp:TextBox runat="server" ID="ConfirmPassword" CssClass="txt" placeholder="Confirm Password" TextMode="Password"></asp:TextBox>
<br />
<asp:RequiredFieldValidator ID="RequiredFieldValidator10" runat="server"
ControlToValidate="ConfirmPassword" Display="Dynamic" ErrorMessage="Confirm Password is required."
ToolTip="User Name is required." ValidationGroup="AddTeacher"><span class="err I18N">error.messages.Confirm Password is required</span></asp:RequiredFieldValidator>
</td>
<td>
<asp:Label ID="LblEmail" CssClass="lblStyle I18N" runat="server">form.data.Email</asp:Label>
<br />
<br />
<asp:TextBox runat="server" ID="Email" TextMode="SingleLine" CssClass="txt" placeholder="Email"></asp:TextBox>
<br />
<asp:RequiredFieldValidator ID="RequiredFieldValidator18" runat="server"
ControlToValidate="Email" Display="Dynamic" ErrorMessage="Email is required."
ToolTip="Email is required." ValidationGroup="AddTeacher"><span class="err I18N">error.messages.Email is required</span></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
<asp:Label ID="LblQuestion" CssClass="lblStyle I18N" runat="server">form.data.Question</asp:Label>
<br />
<br />
<asp:TextBox runat="server" ID="Question" CssClass="txt" placeholder="Question" TextMode="SingleLine"></asp:TextBox>
<br />
<asp:RequiredFieldValidator ID="RequiredFieldValidator11" runat="server"
ControlToValidate="Question" Display="Dynamic" ErrorMessage="Question is required."
ToolTip="Question is required." ValidationGroup="AddTeacher"><span class="err I18N">error.messages.Question is required</span></asp:RequiredFieldValidator>
</td>
<td>
<asp:Label ID="LblAnswer" CssClass="lblStyle I18N" runat="server">form.data.Answer</asp:Label>
<br />
<br />
<asp:TextBox runat="server" ID="Answer" TextMode="SingleLine" CssClass="txt" placeholder="Answer"></asp:TextBox>
<br />
<asp:RequiredFieldValidator ID="RequiredFieldValidator13" runat="server"
ControlToValidate="Answer" Display="Dynamic" ErrorMessage="Answer is required."
ToolTip="Answer is required." ValidationGroup="AddTeacher"><span class="err I18N">error.messages.Answer is required</span></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
<asp:CompareValidator ID="PasswordCompare" runat="server"
ControlToValidate="ConfirmPassword" ControlToCompare="Password" Display="Dynamic" ErrorMessage="The Password and Confirmation Password must match."
ToolTip="The Password and Confirmation Password must match." ValidationGroup="AddTeacher"><span class="err I18N">error.messages.PasswordMsg</span></asp:CompareValidator>
</td>
</tr>
</table>
</td>
</tr>
</table>
</ContentTemplate>
</asp:CreateUserWizardStep>
<asp:CompleteWizardStep ID="CompleteWizardStep1" runat="server">
</asp:CompleteWizardStep>
</WizardSteps>
<NavigationButtonStyle CssClass="navigateButton" />
<HeaderStyle BackColor="White" BorderColor="#FFFBD6" BorderStyle="Solid" BorderWidth="2px"
Font-Bold="True" Font-Size="0.9em" ForeColor="#333333" HorizontalAlign="Center" />
<CreateUserButtonStyle CssClass="navigateButton" />
<ContinueButtonStyle CssClass="navigateButton" />
<SideBarStyle BackColor="White" Font-Size="0.9em" VerticalAlign="Top" />
<TitleTextStyle BackColor="White" Font-Bold="True" ForeColor="White" />
<SideBarButtonStyle CssClass="navigateButton" />
</asp:CreateUserWizard>
possibly two things:
You can try using the FinishDestinationPageUrl property of the CreateUserWizard control. Try setting to empty.
Another is you should handle the FinishButtonClick event.
This is fired when finish button is clicked. Basically implement your own logic over there. So, you can prevent default behavior.
I have a aspx page in which i have putted two update panel with two submit buttons one in each...But on clicking second button it is not firing second button event it is taking first button validate message..
Here is my aspx page code....
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="updDate1" runat="server" UpdateMode="Conditional" style="position: absolute;
left: 0px; top: 0px; width: 339px; height: 243px;">
<ContentTemplate>
<table width="400">
<tr>
<td>
</td>
<td colspan="2">
<b>Sign Up for New User Account</b>
</td>
</tr>
<tr>
<td>
UserName:
</td>
<td>
<asp:TextBox ID="txtUserName" runat="server" />
</td>
<td>
<asp:RequiredFieldValidator ID="rqfUserName" runat="server" ControlToValidate="txtUserName"
Display="Dynamic" ErrorMessage="Required" ForeColor="Red" />
</td>
</tr>
<tr>
<td>
Password:
</td>
<td>
<asp:TextBox ID="txtPwd" runat="server" TextMode="Password" />
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtPwd"
Display="Dynamic" ErrorMessage="Required" ForeColor="Red" />
</td>
</tr>
<tr>
<td>
Confirm Password:
</td>
<td>
<asp:TextBox ID="txtCnfPwd" runat="server" TextMode="Password" />
</td>
<td>
<asp:RequiredFieldValidator ID="PasswordConfirmRequiredValidator" runat="server"
ControlToValidate="txtCnfPwd" ForeColor="red" Display="Dynamic" ErrorMessage="Required" />
<asp:CompareValidator ID="PasswordConfirmCompareValidator" runat="server" ControlToValidate="txtCnfPwd"
ForeColor="red" Display="Dynamic" ControlToCompare="txtPwd" ErrorMessage="Confirm password must match password." />
</td>
</tr>
<tr>
<td>
<asp:Button ID="btnSubmit" runat="server" OnClick="btnSubmit_Click" Text="Create User" />
</td>
<tr>
<td class="style1" colspan="3">
<asp:Label ID="lblResult" runat="server" Font-Bold="true" />
</td>
</tr>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<div>
<asp:UpdatePanel ID="updDate2" runat="server" UpdateMode="Conditional" RenderMode="Inline"
style="position: absolute; left: 628px; top: 0px; width: 339px; height: 243px;">
<ContentTemplate>
<div class="GridviewDiv">
<table>
<tr>
<td align="right">
</td>
</tr>
<tr>
<td>
<asp:GridView ID="gvRoles" runat="server" CssClass="Gridview" AutoGenerateColumns="false">
<HeaderStyle BackColor="#df5015" />
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="chkRole" runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Role Name">
<ItemTemplate>
<asp:Label ID="lblRole" runat="server" Text="<%#Container.DataItem %>" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</td>
</tr>
<tr>
<td>
<asp:Button ID="btnAssign" runat="server" Text="Assign or UnAssign" OnClick="btnAssign_Click"
Style="height: 26px" />
</td>
</tr>
</table>
<div>
<asp:Label ID="lblSuccess" runat="server" Font-Bold="true" />
<br />
<asp:Label ID="lblError" runat="server" Font-Bold="true" />
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
Any help will be highly apprecited..
Thanks In advance..
Dear i tried your code by Making dummy project and it clearly tells me that it's a problem of CausesValidation="false",I know you tried this thing as well but even i don't know your back end coding.So same suggesstion from my side just change your btnAssign like
<asp:Button ID="btnAssign" runat="server" Text="Assign or UnAssign"
Style="height: 26px" onclick="btnAssign_Click" CausesValidation="false" />
Note :- Try to check it in different browser as well.
Also try for ValidationGroup as well.
Apply ValidationGroup property into your validation control and also assign that same property to btnSubmit.This will work.
Hope it works.
Set CausesValidation="false" in the second button
Setting CausesValidation="false" in the second button should have worked.
One another way to get this work is to assign a common ValidationGroup to your Validators as well as to your first Submit button [only of UpdatePanel updDate1 ].
For e.g. in your Validators:
<asp:RequiredFieldValidator ID="rqfUserName" runat="server"
ControlToValidate="txtUserName"Display="Dynamic"
ErrorMessage="Required" ForeColor="Red"
ValidationGroup="updDate1UserCreation" />
And your submit button with ID:btnSubmit
<asp:Button ID="btnSubmit" runat="server"
OnClick="btnSubmit_Click" Text="Create User"
ValidationGroup="updDate1UserCreation" />
Your first updatePanel will finally look like:
<asp:UpdatePanel ID="updDate1" runat="server" UpdateMode="Conditional"
style="position: absolute;
left: 0px; top: 0px; width: 339px; height: 243px;">
<ContentTemplate>
<table width="400">
<tr>
<td>
</td>
<td colspan="2">
<b>Sign Up for New User Account</b>
</td>
</tr>
<tr>
<td>
UserName:
</td>
<td>
<asp:TextBox ID="txtUserName" runat="server" />
</td>
<td>
<asp:RequiredFieldValidator ID="rqfUserName" runat="server"
ControlToValidate="txtUserName"
Display="Dynamic" ErrorMessage="Required" ForeColor="Red"
ValidationGroup="updDate1UserCreation" />
</td>
</tr>
<tr>
<td>
Password:
</td>
<td>
<asp:TextBox ID="txtPwd" runat="server" TextMode="Password" />
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1"
runat="server" ControlToValidate="txtPwd"
Display="Dynamic" ErrorMessage="Required" ForeColor="Red"
ValidationGroup="updDate1UserCreation" />
</td>
</tr>
<tr>
<td>
Confirm Password:
</td>
<td>
<asp:TextBox ID="txtCnfPwd" runat="server" TextMode="Password" />
</td>
<td>
<asp:RequiredFieldValidator ID="PasswordConfirmRequiredValidator"
runat="server"
ControlToValidate="txtCnfPwd" ForeColor="red"
Display="Dynamic" ErrorMessage="Required"
ValidationGroup="updDate1UserCreation" />
<asp:CompareValidator ID="PasswordConfirmCompareValidator"
runat="server" ControlToValidate="txtCnfPwd"
ForeColor="red" Display="Dynamic" ControlToCompare="txtPwd"
ErrorMessage="Confirm password must match password."
ValidationGroup="updDate1UserCreation" />
</td>
</tr>
<tr>
<td>
<asp:Button ID="btnSubmit" runat="server"
OnClick="btnSubmit_Click" Text="Create User"
ValidationGroup="updDate1UserCreation" />
</td>
<tr>
<td class="style1" colspan="3">
<asp:Label ID="lblResult" runat="server" Font-Bold="true" />
</td>
</tr>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
enter code here`<asp:WizardStep ID="CreateUserWizardStep0" runat="server" StepType="Start">
<h1>Bir Hesap Seçin</h1>
<table>
<tr>
<td>
<asp:Label ID="AccountNameLabel" CssClass="grey" runat="server" AssociatedControlID="SearchAccount" >
Kullanıcı Adı:</asp:Label>
</td>
</tr>
<tr>
<td>
<asp:TextBox ID="SearchAccount" CssClass="field" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator Visible="true" ID="RequiredFieldValidator1" ControlToValidate="SearchAccount" Display="None" ValidationGroup="kayitFormu" runat="server" ErrorMessage="Girmiş Olduğunuz Hesap Adı Kullanımdadır. Lütfen farklı bir hesap adı deneyiniz."></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
<asp:Label ID="SearchAccountMessage" style="width:400px;" runat="server" ForeColor="red" />
</td>
</tr>
</table>
</asp:WizardStep>`
Is it possible to add some text or some tag under below the create user wizard steps button (previous, next, finish, etc) in createuserwizard??
Have a look at the StepNavigationTemplate. This site should help
I'm not sure if this is what you're looking for, but you can use the navigation templates:
<StartNavigationTemplate>
<asp:Button ID="btnStepNext" runat="server" Text="Next" Width="110" CommandName="MoveNext" CausesValidation="true" />
</StartNavigationTemplate>
<StepNavigationTemplate>
<asp:Button ID="btnStepPrevious" runat="server" Text="Previous" Width="110" CommandName="MovePrevious" CausesValidation="false" />
<asp:Button ID="btnStepNext" runat="server" Text="Next" Width="110" CommandName="MoveNext" CausesValidation="true" />
</StepNavigationTemplate>
<FinishNavigationTemplate>
<asp:Button ID="btnStepPrevious" runat="server" Text="Previous" Width="110" CommandName="MovePrevious" CausesValidation="false" />
<asp:Button ID="btnStepFinish" runat="server" Text="Finish" Width="120" CommandName="MoveComplete" CausesValidation="true" />
</FinishNavigationTemplate>