Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
I am creating a login page with username and password. I want to put a text heading "Login App" at he top left side of the login panel table. I tried using panel tag but didn't work. You know there is a heading above the login panel or login table on almost any login page? I just want to do that.
Is there a really simple and easy way/tag i can use to do this? I even tried placeholder but couldn't achieve this.
Thanks
Simplest way to have heading to login table is
fieldset and legend
<!DOCTYPE html>
<html>
<head>
<style>
fieldset {position: relative; width:50%}
legend {color:#893039 }
</style>
</head>
<body>
<fieldset>
<legend align="center">Login App:</legend>
<table>
<tr>
<td>Name</td>
<td><input type="text"></td>
</tr>
<tr>
<td>Password</td>
<td><input type="password"></td>
</tr>
</table>
</fieldset>
</body>
</html>
working sample is given in jsfiddle in this link:
http://jsfiddle.net/Manirajss/QKeHq/
Just copy the following design and put it in aspx
<h2>
Log In
</h2>
<p>
Please enter your username and password.
<asp:HyperLink ID="RegisterHyperLink" runat="server" EnableViewState="false">Register</asp:HyperLink> if you don't have an account.
</p>
<asp:Login ID="LoginUser" runat="server" EnableViewState="false" RenderOuterTable="false">
<LayoutTemplate>
<span class="failureNotification">
<asp:Literal ID="FailureText" runat="server"></asp:Literal>
</span>
<asp:ValidationSummary ID="LoginUserValidationSummary" runat="server" CssClass="failureNotification"
ValidationGroup="LoginUserValidationGroup"/>
<div class="accountInfo">
<fieldset class="login">
<legend>Account Information</legend>
<p>
<asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">Username:</asp:Label>
<asp:TextBox ID="UserName" runat="server" CssClass="textEntry"></asp:TextBox>
<asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName"
CssClass="failureNotification" ErrorMessage="User Name is required." ToolTip="User Name is required."
ValidationGroup="LoginUserValidationGroup">*</asp:RequiredFieldValidator>
</p>
<p>
<asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label>
<asp:TextBox ID="Password" runat="server" CssClass="passwordEntry" TextMode="Password"></asp:TextBox>
<asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password"
CssClass="failureNotification" ErrorMessage="Password is required." ToolTip="Password is required."
ValidationGroup="LoginUserValidationGroup">*</asp:RequiredFieldValidator>
</p>
<p>
<asp:CheckBox ID="RememberMe" runat="server"/>
<asp:Label ID="RememberMeLabel" runat="server" AssociatedControlID="RememberMe" CssClass="inline">Keep me logged in</asp:Label>
</p>
</fieldset>
<p class="submitButton">
<asp:Button ID="LoginButton" runat="server" CommandName="Login" Text="Log In" ValidationGroup="LoginUserValidationGroup"/>
</p>
</div>
</LayoutTemplate>
</asp:Login>
Related
I am creating a website. It requires users to login.
When I click on the Username text box, as soon as I enter the first letter of the name it turns into a drop down list displaying every name ever entered, that starts with that letter!
I have found a lot of articles on how to accomplish this, but none how to PREVENT this from happening.
I want the text box to act like a text box.
I am using .NET version 4.62
I have searched here and there are many questions about making this happen, I could find none on how to stop it.
If you know how to stop this from happening, and can reply with the answer, I will be forever grateful.
The ASPX of the form is as follows
<%# Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb"
Inherits="Crescent._Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server" link= "stylesheet" href="styles.css">
<title></title>
</head>
<body>
<form id="Default" runat="server">
<div>
<p> <asp:Image ID="Image1" runat="server" Height="54px"
ImageUrl="Images/CrescentLogo2007.bmp" Width="175px" />
<asp:Label ID="Label1" runat="server" top="1px" Font-Names="Arial" ForeColor="Black"
Text="Call us at 1-800-560-7867" CssClass="style2"></asp:Label>
</p>
</div>
<p>
<asp:Label ID="Label2" runat="server" Font-Names="Arial" Text="Log In"></asp:Label>
</p>
<p>
</p>
<p>
<asp:Label ID="Label3" runat="server" Font-Names="Arial" Font-Size="Small"
Height="25px" Text="User Name:"></asp:Label>
<asp:TextBox ID="txtUserName" runat="server" cache=" "></asp:TextBox>
</p>
<p>
<asp:Label ID="Label4" runat="server" style="margin-left:5px" Font-Names="Arial" Font-
Size="Small"
Height="25px" Text="Password:"></asp:Label>
<asp:TextBox ID="txtPassword" runat="server" style="margin-left: 5px"
Width="164px" TextMode="Password"></asp:TextBox>
</p>
<p>
<asp:button runat="server" text="Login" style="margin-left: 58px"
Width="153px" ID="btnLogin" onclick="btnLogin_Click" />
</p>
</form>
</body>
</html>
I have a textbox centered on a page. What I would like to have is an error label display to the right of it, if necessary, and keep the textbox centered on the page. The page contains a Panel, which is centering the entire page.
<asp:Panel ID="pnlStart" runat="server" CssClass="center">
...
...
...
<tr>
<td>
<div>
<input type="text" id="pName" name="pName" runat="server" class="pName" style="color:#7A0000;width:33%;"
value="Enter Your Name" onfocus="inputFocus(this)" onblur="inputBlur(this)" />
<asp:Label ID="pNameValidationLabel" style="width:33%;" name="pName" runat="server" Text="*Please enter your name." class="pName" visible="false"></asp:Label>
</div>
</td>
</tr>
On page load, the textbox is centered properly. but when the visibility of the pNameValidate Label appears, it tries to force both object into the Center.
Is there a way for the textbox to be centered and the label off centered, to the right?
Many thanks for looking.
You can try and add text-align:right; to the style tag in the pName element.
I went with a table and this quickly provided me what I needed...
<tr>
<td>
<table width="100%">
<tr>
<td width="33%"> </td>
<td width="33%">
<div id="shaker">
<input type="text" id="pName" autocomplete="false" clientidmode="Static" name="pName" runat="server" class="pName"
value="Please Enter Your Name Here" onfocus="inputFocus(this)" onblur="inputBlur(this)" />
</div>
</td>
</tr>
</table>
</td>
</tr>
I am working to get a HTML File Upload control in place in a ASPX Web Form page. I have used the below code
<td class="ClientDetailTableLeftColumn">
<asp:Label ID="lblUpload" runat="server" Text="Upload File"></asp:Label>
</td>
<td "ClientDetailTableControls" colspan="2">
<p id="UploadArea">
<input id="FileUploadInput" type="file" size="20"/>
<asp:Button ID="btnUpload" runat="server" Text="Click To Upload" CssClass="btnFormSubmit" />
</p>
<input id="btnUploadMore" type="button" value="Add New Attachment" onclick="AddUploadBox" />
</td>
But while running in Local IIS I am getting an error.
System.Web.UI.HtmlControls.HtmlTableCellCollection must have items of
type System.Web.UI.HtmlControls.HtmlTableCell'. 'p' is of type
System.Web.UI.HtmlControls.HtmlGenericControl'.
The code is failing in the 2nd Line :
Line 85: <td "ClientDetailTableControls" colspan="2">
Line 86: <p id="UploadArea">
Can somebody please help me what could be the resolution to this? Or why is this failing?
Try this
<td class="ClientDetailTableLeftColumn">
<asp:Label ID="lblUpload" runat="server" Text="Upload File"></asp:Label>
</td>
<td "ClientDetailTableControls" colspan="2">
<div id="UploadArea">
<input id="FileUploadInput" type="file" size="20"/>
<asp:Button ID="btnUpload" runat="server" Text="Click To Upload" CssClass="btnFormSubmit" />
</div>
<input id="btnUploadMore" type="button" value="Add New Attachment" onclick="AddUploadBox" />
</td>
I wanna emulate this on .NET:
<label for="contact_name">
Nombre
<span class="color2">*</span>
</label>
<input type="text" name="contact_name" id="contact_name"
value="" size="22" tabindex="3"
class="validate[required,minSize[3],maxSize[100],custom[onlyLetterSp]]" />
I used:
<asp:Label ID="lblNombre" AssociatedControlID="txtNombre" Text="Nombre" runat="server" />
<asp:TextBox ID="txtNombre" runat="server" />
But I need to use the class color 2 on the *, and it must be at the side right side of Nombre and not below or something else. If I create a label on the side of the one that is associated to the textbox with the * and the class, the * its gonna show below. How do I align this perfectly?
Easiest way is just to keep using the <label> control instead of using a server control, assuming you don't need to access your label in the code.
<label for="<%= txtNombre.ClientID %>">
Nombre <span class="color2">*</span>
</label>
<asp:TextBox ID="txtNombre" runat="server" />
Or if you do need to access it from the server, you can still do it:
<%-- This line can go in the code-behind if you want --%>
<% lblNombre.Attributes["for"] = txtNombre.ClientID; %>
<label id="lblNombre" runat="server">
Nombre <span class="color2">*</span>
</label>
<asp:TextBox ID="txtNombre" runat="server" />
Actually, you can have HTML in your Label's text, so this will also work:
<asp:Label ID="lblNombre" AssociatedControlID="txtNombre"
Text="Nombre <span class='color2'>*</span>" runat="server" />
<asp:TextBox ID="txtNombre" runat="server" />
I assume you're doing a required field implementation.
Add a class to the .net label - for ex requiredlbl & then in css
.requiredlbl:after { content:" *";color:red; }
EDIT - for color
<asp:Label ID="lblNombre" CssClass="requiredlbl" Text="Nombre" runat="server" />
Try this:
<asp:Label ID="lblNombre" AssociatedControlID="txtNombre" runat="server" >
Nombre: <font color="red">*</font>
</asp:Label>
<asp:TextBox ID="txtNombre" runat="server" />
I am having a real struggle trying to accomplish something for work.
I have a starting page with a textbox and a button. I want to be able to post the value entered in the textbox to an iframe, but the iframe is on another another web page called iframeholder.
I am not allowed to session variables or querystring. It has to be post.
I want to send the value of TextBox_Link to the iframe and be able to store it as the value of a ListItem in the RadioButtonList. I greatly appreciate any feedback.
Starting Page
<body>
<form id="form1" runat="server">
<div>
<table>
<tr>
<td><asp:TextBox ID="TextBox_Link" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td><asp:Button ID="Button_Post" runat="server" Text="Button" /></td>
</tr>
</table>
</div>
</form>
iframeholder page
<body>
<form id="form1" runat="server">
<div>
<iframe src ="iframe.aspx" name="iframe" width="100%" height="300">
</div
</form>
</body>
iframe
<body>
<form id="form1" runat="server">
<div>
<asp:RadioButtonList ID="RadioButtonList1" runat="server">
<asp:ListItem>Link1</asp:ListItem>
</asp:RadioButtonList>
<br />
<asp:Button ID="Button1" runat="server" Text="Submit" />
</div>
</form>
</body>
Try adding target='iframe' in your <form> tag.