I have used the captcha refresh button to refresh the captcha code, but the scenario is that when I click on the refresh image, the whole form gets refreshed. Please help. Also see the code below:-
<table style="width: 583px;">
<tr>
<td>Name</td>
<td>
<asp:TextBox ID="TextBox1" runat="server" class="txtfld-popup"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Please enter your Full Name" ControlToValidate="Fullname" Display="Dynamic" Style="font-size: 13px;"></asp:RequiredFieldValidator>
<cc1:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender4" runat="server" TargetControlID="FullName" WatermarkText="Enter Your Full Name"></cc1:TextBoxWatermarkExtender>
</td>
</tr>
<tr>
<td>Contact No.</td>
<td>
<asp:TextBox ID="TextBox2" class="txtfld-popup" runat="server" MaxLength="10" onkeypress="if(event.keyCode<48 || event.keyCode>57)event.returnValue=false;"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="Please enter Contact No." Display="Dynamic" ControlToValidate="ContactNo" ValidationExpression="\w+([-+.']\w+)*#\w+([-.]\w+)*\.\w+([-.]\w+)*" Style="font-size: 13px;"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="Please enter valid Contact No." Display="Dynamic" ControlToValidate="ContactNo" ValidationExpression="^\d{10}$" Style="font-size: 13px;"></asp:RegularExpressionValidator>
<cc1:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender5" runat="server" TargetControlID="ContactNo" WatermarkText="Enter Your Contact No."></cc1:TextBoxWatermarkExtender>
</td>
</tr>
<tr>
<td>Purpose </td>
<td>
<asp:TextBox ID="TextBox3" runat="server" class="txtfld-popup" ValidationGroup="VG"></asp:TextBox>
<cc1:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender6" runat="server" TargetControlID="Purpose" WatermarkText="Enter Your Purpose"></cc1:TextBoxWatermarkExtender>
</td>
</tr>
<tr>
<td> </td>
<td>
<div>
<cc1:CaptchaControl ID="CaptchaControl1" runat="server" CaptchaBackgroundNoise="Low" CaptchaLength="5"
CaptchaHeight="60" CaptchaWidth="200" CaptchaMinTimeout="5" CaptchaMaxTimeout="240"
FontColor="#D20B0C" NoiseColor="#B1B1B1" Width="150" />
</div>
<asp:ImageButton ID="ImageButton2" ImageUrl="~/images/refresh.png" runat="server" CausesValidation="false" />
<br />
<asp:TextBox ID="TextBox4" runat="server" MaxLength="5"></asp:TextBox>
<asp:CustomValidator ID="CustomValidator2" ErrorMessage="Invalid. Please try again." OnServerValidate="ValidateCaptcha"
runat="server" />
<p style="margin-top: 3px; margin-bottom: 3px;">
<asp:Label ID="Label1" runat="server"></asp:Label>
</p>
</td>
</tr>
<tr>
<td> </td>
<td>
<asp:Button ID="Button1" runat="server" Text="Submit" OnClick="btnSend_Click" class="button-form" Width="100" />
<asp:Button ID="Button2" runat="server" Text="Reset" OnClick="btnReset_Click" class="button-form" Width="100" CausesValidation="false" /></td>
</tr>
Also see the code behind for your reference:-
protected void ValidateCaptcha(object sender, ServerValidateEventArgs e)
{
Captcha1.ValidateCaptcha(txtCaptcha.Text.Trim());
e.IsValid = Captcha1.UserValidated;
if (e.IsValid)
{
ClientScript.RegisterClientScriptBlock(this.GetType(), "ResponseDialog", "$(document).ready(function(){ResponseDialog();});", true);
SendMail();
}
}
Please help
Finally added a update panel for the solution:-
<tr>
<td> </td>
<td>
<div>
<asp:UpdatePanel ID="updatePanel" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<table>
<tr>
<td>
<cc1:CaptchaControl ID="Captcha1" runat="server" CaptchaBackgroundNoise="Low" CaptchaLength="5"
CaptchaHeight="60" CaptchaWidth="200" CaptchaMinTimeout="5" CaptchaMaxTimeout="240"
FontColor="#D20B0C" NoiseColor="#B1B1B1" />
</td>
<td>
<asp:ImageButton ID="ImgRefreshButton" ImageUrl="~/images/refresh.png" runat="server" CausesValidation="false" />
</td>
</tr>
</table>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ImgRefreshButton" EventName="Click" />
</Triggers>
</asp:UpdatePanel>
<asp:TextBox ID="txtCaptcha" runat="server" MaxLength="5"></asp:TextBox>
<asp:CustomValidator ID="CustomValidator1" ErrorMessage="Invalid. Please try again." OnServerValidate="ValidateCaptcha"
runat="server" />
<p style="margin-top: 3px; margin-bottom: 3px;">
<asp:Label ID="lblLeaveNo2" runat="server"></asp:Label>
</p>
</td>
</tr>
And it is working for me. :)
Related
I have added a new row .
for defaultGPnamer i need to bring that to the right end.
Please help on this .
attached the code
<LayoutTemplate>
<asp:PlaceHolder ID="itemPlaceholder" runat="server"></asp:PlaceHolder>
</LayoutTemplate>
<ItemTemplate>
<div class="rounded" style="margin-left:10px">
<table style="width: 560px; height:95px;">
<tr>
<td colspan="3" style="height:22px">
<div>
<span style="font-size:11pt; color:#008FBE; font-weight:bold; line-height: 22px"><%#Eval("MMHMember")%><%#Eval("UserName") %></span>
<i><b><%#Eval("gender")%> <%#Eval("Age","{0} Yrs</b>") %></b></i>
<span><%#Eval("DateOfBirth")%>
</span>
</div>
</td>
<td style="text-align:right">
<span style="color:#008FBE; font-size:11pt; line-height: 22px;"><%#Eval("NHINumber")%></span>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lbldefaultgp" runat="server" style="font-weight:bold;color:#008FBE;"><%#Eval("DefaultGPName")%></asp:Label>
</td>
</tr>
<tr style="text-align:left; vertical-align:top">
<td style="width:100px;">
<asp:Image ID="imgPatientPhoto" runat="server" ImageUrl='<%#GetPhotoURL(Eval("PhotoURL","{0}"))%>' style="width:90px;height:95px" />
</td>
<td style="width: 125px">
<br />
<asp:Label ID="lblHome" runat="server" style="font-weight:bold"><%#Eval("HomePhone")%></asp:Label>
<br />
<asp:Label ID="lblWork" runat="server" style="font-weight:bold"><%#Eval("WorkPhone")%></asp:Label>
<br />
<asp:Label ID="lblMobail" runat="server" style="font-weight:bold"><%#Eval("Mobilenumber")%></asp:Label>
</td>
<td style="width:140px;">
<asp:Label ID="lblAddress" runat="server" style="font-weight:bold"><%#Eval("Address") %></asp:Label>
</td>
<td style="" >
<asp:Label runat ="server" ID ="lblEnrolledPractice"><%#Eval("businessname") %> </asp:Label> <br />
<asp:Label runat ="server" ID ="lblCasualPractice"><%#Eval("CasualBusinessname") %> </asp:Label>
<p>
<asp:LinkButton ID="lnkViewConsentSetting" runat="server" CommandArgument="<%# Container.DataItemIndex %>" CommandName="ConsentSetting" Visible="<%# ApplyCareSetting %>" >View Consent Settings</asp:LinkButton>
</p>
<p>
<asp:LinkButton ID="lnkViewHealthSummary" runat="server" CommandArgument="<%# Container.DataItemIndex %>" CommandName="HealthSummary" Visible ='<%# SetHESVisible("SEHR") %>'>View Health Summary</asp:LinkButton>
<asp:LinkButton ID="lnkViewHealthSummaryConsent" runat="server" Visible ='<%# SetHESVisible("CONSENT") %>' Text="View Health Summary"></asp:LinkButton>
</p>
</td>
</tr>
</table>
</div>
</ItemTemplate>
I would be greatful if someone can help on this.
Label id is lbldefaultgp.
need to bring that data to right end in the banner.
notes::::
<LayoutTemplate>
<asp:PlaceHolder ID="itemPlaceholder" runat="server"></asp:PlaceHolder>
</LayoutTemplate>
<ItemTemplate>
<div class="rounded" style="margin-left:10px">
<table style="width: 560px; height:95px;">
<tr>
<td colspan="3" style="height:22px">
<div>
<span style="font-size:11pt; color:#008FBE; font-weight:bold; line-height: 22px"><%#Eval("MMHMember")%><%#Eval("UserName") %></span>
<i><b><%#Eval("gender")%> <%#Eval("Age","{0} Yrs</b>") %></b></i>
<span><%#Eval("DateOfBirth")%>
</span>
</div>
</td>
<td style="text-align:right">
<span style="color:#008FBE; font-size:11pt; line-height: 22px;"><%#Eval("NHINumber")%></span>
</td>
</tr>
<tr>
<td colspan="3" style="height:22px">
<div>
</div>
</td>
<td>
<p>is this the thing you want?</p> <asp:Label ID="lbldefaultgp" runat="server" style="font-weight:bold;color:#008FBE;"><%#Eval("DefaultGPName")%></asp:Label>
</td>
</tr>
<tr style="text-align:left; vertical-align:top">
<td style="width:100px;">
<asp:Image ID="imgPatientPhoto" runat="server" ImageUrl='<%#GetPhotoURL(Eval("PhotoURL","{0}"))%>' style="width:90px;height:95px" />
</td>
<td style="width: 125px">
<br />
<asp:Label ID="lblHome" runat="server" style="font-weight:bold"><%#Eval("HomePhone")%></asp:Label>
<br />
<asp:Label ID="lblWork" runat="server" style="font-weight:bold"><%#Eval("WorkPhone")%></asp:Label>
<br />
<asp:Label ID="lblMobail" runat="server" style="font-weight:bold"><%#Eval("Mobilenumber")%></asp:Label>
</td>
<td style="width:140px;">
<asp:Label ID="lblAddress" runat="server" style="font-weight:bold"><%#Eval("Address") %></asp:Label>
</td>
<td style="" >
<asp:Label runat ="server" ID ="lblEnrolledPractice"><%#Eval("businessname") %> </asp:Label> <br />
<asp:Label runat ="server" ID ="lblCasualPractice"><%#Eval("CasualBusinessname") %> </asp:Label>
<p>
<asp:LinkButton ID="lnkViewConsentSetting" runat="server" CommandArgument="<%# Container.DataItemIndex %>" CommandName="ConsentSetting" Visible="<%# ApplyCareSetting %>" >View Consent Settings</asp:LinkButton>
</p>
<p>
<asp:LinkButton ID="lnkViewHealthSummary" runat="server" CommandArgument="<%# Container.DataItemIndex %>" CommandName="HealthSummary" Visible ='<%# SetHESVisible("SEHR") %>'>View Health Summary</asp:LinkButton>
<asp:LinkButton ID="lnkViewHealthSummaryConsent" runat="server" Visible ='<%# SetHESVisible("CONSENT") %>' Text="View Health Summary"></asp:LinkButton>
</p>
</td>
</tr>
</table>
</div>
</ItemTemplate>
I have the following HTML:
<table cellspacing="10px" cellpadding="10px" width="100%" style="border-spacing: 10px">
<tr align="left">
<td>
<asp:Label ID="Label0" runat="server" Text="<%$ Resources:Strings, OrderReference %>" />
<asp:Label ID="TRANS_NB_LB" runat="server" />
<asp:Label ID="Label5" runat="server" TabIndex="5" Text="<%$ Resources:Strings, Shipment %>" />
<asp:Label ID="SHIP_COST_LB" runat="server" />
</td>
</tr>
<tr align="left">
<td>
<asp:Label ID="Label1" runat="server" TabIndex="5" Text="<%$ Resources:Strings, OrderAmount %>" />
<asp:Label ID="TRANS_AMOUNT_LB" runat="server" />
<asp:Label ID="Label2" runat="server" TabIndex="5" Text="<%$ Resources:Strings, ShippingMethod %>" />
<asp:Label ID="SHIPP_METH_LB" runat="server" />
</td>
</tr>
<tr align="left">
<td>
<asp:Label ID="Label3" runat="server" TabIndex="5" Text="<%$ Resources:Strings, Date %>" />
<asp:Label ID="TRANS_DATE_LB" runat="server" />
<%-- --%>
</td>
</tr>
<tr>
<td>
<asp:Label ID="Label4" runat="server" TabIndex="5" Text="<%$ Resources:Strings, BillNumber %>" />
<asp:Label ID="SHIP_BILL_NUMBER_LB" runat="server" />
<%-- --%>
</td>
</tr>
</table>
It displays the following table:
I'd like to fix the columns so that they are properly displayed under each other such as: (Replace "_" by space)
Order Reference__OSP-00060000308__________Shipment_________100.00000.
Order Amount_____879.00000________________Shipping Method.
Date_____________7/13/2016 11:17:38 AM.
Bill Number______SHIP-000000000227.
How do I fix that? How can I add border spacing? Also is there a way I can add ":" after the element names (such as Order Reference: )?
Sorry I'm new at this, found my answer:
<table cellspacing="10px" cellpadding="10px" width="100%" style="border-spacing: 10px">
<tr align="left">
<td>
<asp:Label ID="Label0" runat="server" Text="<%$ Resources:Strings, OrderReference %>" />
</td>
<td>
<asp:Label ID="TRANS_NB_LB" runat="server" />
</td>
<td>
<asp:Label ID="Label5" runat="server" TabIndex="5" Text="<%$ Resources:Strings, Shipment %>" />
</td>
<td>
<asp:Label ID="SHIP_COST_LB" runat="server" />
</td>
</tr>
<tr align="left">
<td>
<asp:Label ID="Label1" runat="server" TabIndex="5" Text="<%$ Resources:Strings, OrderAmount %>" />
</td>
<td>
<asp:Label ID="TRANS_AMOUNT_LB" runat="server" />
</td>
<td>
<asp:Label ID="Label2" runat="server" TabIndex="5" Text="<%$ Resources:Strings, ShippingMethod %>" />
</td>
<td>
<asp:Label ID="SHIPP_METH_LB" runat="server" />
</td>
</tr>
<tr align="left">
<td>
<asp:Label ID="Label3" runat="server" TabIndex="5" Text="<%$ Resources:Strings, Date %>" />
</td>
<td>
<asp:Label ID="TRANS_DATE_LB" runat="server" />
</td>
</tr>
<tr>
<td>
<asp:Label ID="Label4" runat="server" TabIndex="5" Text="<%$ Resources:Strings, BillNumber %>" />
</td>
<td>
<asp:Label ID="SHIP_BILL_NUMBER_LB" runat="server" />
</td>
</tr>
</table>
Hope I didn't waste your time and that this may be useful for noobs like me :)
I am creating a webpage which has been divide into two sides. On the left there is an image and on the right there can be various user inputs. I put the image into a table cell with float left and the inputs into a cell and float right.
Everything look like what I expect until I add a grid on the right using
<tr>
<asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource1">
</asp:GridView>
</tr>
Then the alignment of the contents on the right all move to the bottom of the left hand side. Can anyone can help me on this how to make it stick back to the right?
Here is my mark-up
<table id="leftT">
<tr id ="table_left" >
<td>
<asp:Image ID="Image1" runat="server" Height="356px" ImageUrl="~/Image/search.jpg" Width="200px" style="vertical-align:text-top"/>
</td>
</tr>
</table>
<table id ="rightT">
<tr>
<td>
<asp:Label ID="lblUserName" runat="server" Text="Label"></asp:Label>
</td>
<td>
<asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="SqlDataSource1" DataTextField="USERNAME" DataValueField="USERNAME">
<asp:ListItem></asp:ListItem>
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:SOConnectionString %>" ProviderName="<%$ ConnectionStrings:SOConnectionString.ProviderName %>" SelectCommand="SELECT USERNAME FROM USERMASTER WHERE USERSTATUS = 1 AND USERACCESSRIGHTS = 'Non-Administrator'"></asp:SqlDataSource>
</td>
<td>
<asp:Label ID="lblCreateOnM" runat="server" Text="Label"></asp:Label>
</td>
<td>
<asp:Label ID="lblCreateOn" runat="server" Text="Label"></asp:Label>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblDate" runat="server" Text="Label"></asp:Label>
</td>
<td><asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />
<asp:TextBox ID="txtDate" runat="server" Enabled="False"></asp:TextBox>
<asp:Calendar ID="Calendar1" runat="server" OnSelectionChanged="Calendar1_SelectionChanged"></asp:Calendar></td>
<td>
<asp:Label ID="lblUpdateOnM" runat="server" Text="Label"></asp:Label>
</td>
<td>
<asp:Label ID="lblUpdateOn" runat="server" Text="Label"></asp:Label>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblTask" runat="server" Text="Label"></asp:Label>
</td>
<td>
<asp:DropDownList ID="DropDownList2" runat="server" DataSourceID="SqlDataSource2" DataTextField="TASKNAME" DataValueField="TASKNAME">
<asp:ListItem></asp:ListItem>
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:SOConnectionString %>" ProviderName="<%$ ConnectionStrings:SOConnectionString.ProviderName %>" SelectCommand="SELECT DISTINCT TASKNAME FROM TASKMASTER"></asp:SqlDataSource>
</td>
<td>
<asp:Label ID="lblUpdateByM" runat="server" Text="Label"></asp:Label>
</td>
<td>
<asp:Label ID="lblUpdateBy" runat="server" Text="Label"></asp:Label>
</td>
</tr>
</table>
Here The mistake you are doing is, you are creating two tables one below the other.Instead take only one table and two columns and places all the controls in these two columns as shown below
ex-
<table>
<tr>
<td id='Left_id'>
//Put all the left controls here
</td>
<td id='Right_id'>
//Put some controls here if required
<table>
<tr>
<td>
//some Controls Here
</td>
</tr>
</table>
</td>
</tr>
</table>
My reqular expression is not working but error is not popping
Here is my brief code - It looks simple, I could not able figure out the error in my code.
<TR id="ROW2" runat="server" visible="false">
<TD class="main" align=left>
<asp:Label id="Lab3" runat="server" Text="Cheque No: "></asp:Label>
</TD>
<TD vAlign=top align=left>
<asp:TextBox id="TxtChequeno" runat="server" MaxLength="20" cssclass="textbox"></asp:TextBox>
<asp:RegularExpressionValidator style="VERTICAL-ALIGN: top" id="REVMobile" runat="server"
ControlToValidate="TxtChequeno"
ErrorMessage="Please enter valid Cheque number"
ValidationExpression="^(?=.*\d).{10}$"
ValidationGroup="tripSheet">*</asp:RegularExpressionValidator>
</TD>
</TR>
<TR id="ROW3" runat="server" visible="false">
<TD class="main" align=left>
<asp:Label id="Lab4" runat="server" Text="Cheque Date: "></asp:Label>
</TD>
<TD vAlign=top align=left>
<asp:TextBox id="txtFromDate" runat="server" CssClass="textbox" MaxLength="11" Width="128px"></asp:TextBox>
<asp:Image style="CURSOR: pointer" id="ImaArr1" runat="server" ImageUrl="./images/CAL.GIF"></asp:Image>
<cc1:CalendarExtender id="CalendarExtender2" runat="server" CssClass="yui" TargetControlID="TxtCardDte" PopupButtonID="ImaArr1" Format="dd-MMM-yyyy"></cc1:CalendarExtender>
<asp:RequiredFieldValidator id="RFtxtFromDate" runat="server" ControlToValidate="txtFromDate" ErrorMessage="Select Arrival date" SetFocusOnError="True" ValidationGroup="tripSheet">*</asp:RequiredFieldValidator>
<asp:CustomValidator ID="CustxtFromDate" runat="server" ClientValidationFunction="CallDateFunForToDate1" ControlToValidate="txtFromDate" ValidationGroup="tripSheet" errormessage="Invalid Cheque Date." style="vertical-align:top;">*</asp:CustomValidator>
</td>
</TD>
</TR>
<TR id="RowBtn" runat="server" visible="false">
<td>
<asp:Button ID="BtnAdd" runat="server" Text="Add" CssClass="button" ValidationGroup="tripSheet" />
</td>
</TR>
Hi I am not good in Html alignment. Can you please help me. I want make some space between two button (add, cancel button).(Please see the image) I tried ti fix it but no luck. Please help me. see the image link(http://i.stack.imgur.com/7M9sE.jpg)
<table style="background-color: #F5F5E9" cellspacing="2">
<tr>
<td align="left" style="width: 70px;">
Note Type
</td>
<td align="left" style="width: 82px; height: 24px;">
<telerik:RadComboBox ID="RadComboBox1" EmptyMessage="Please select" runat="server"
MarkFirstMatch="True" CollapseDelay="0" Width="115px" DropDownWidth="100px" AllowCustomText="True">
<CollapseAnimation Duration="0" />
</telerik:RadComboBox>
<asp:RequiredFieldValidator InitialValue="" ValidationGroup="Notes" ID="RequiredFieldValidator1"
runat="server" ControlToValidate="ddlNoteType" ClientValidationFunction="ddlNt"
Display="None" ErrorMessage="Please select Note Type."></asp:RequiredFieldValidator>
<cc2:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" TargetControlID="custValCou"
runat="server" Enabled="True">
</cc2:ValidatorCalloutExtender>
</td>
<td>
</td>
</tr>
<tr>
<td align="left" valign="middle" style="width: 70px;">
Notes
</td>
<td align="left">
<asp:TextBox ID="TextBox1" runat="server" TextMode="MultiLine" Rows="3" Width="570px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" ValidationGroup="Notes"
ControlToValidate="txtNoteDesc" Display="None" runat="server" ErrorMessage="Please enter Notes."></asp:RequiredFieldValidator>
<cc2:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" TargetControlID="valCliID"
runat="server">
</cc2:ValidatorCalloutExtender>
</td>
<td>
<span style="padding-bottom: 4px;">
<asp:Button ID="Button1" Width="60px" OnClick="btnAddNote_Click" ValidationGroup="Notes"
runat="server" Text="Add" /></span>
<asp:Button ID="Button2" Width="60px" runat="server" OnClientClick="return hideAddNotes()"
Text="Cancel" />
</td>
</tr>
instead of:
<span style="padding-bottom: 4px;">
use:
<div style="padding-bottom: 4px;">
You could also add a break tag in between your buttons:
<asp:Button ID="Button1" Width="60px" OnClick="btnAddNote_Click"
ValidationGroup="Notes" runat="server" Text="Add" /></span>
<br />
<asp:Button ID="Button2" Width="60px" runat="server"
OnClientClick="return hideAddNotes()" Text="Cancel" />