Search Results

Search found 83 results on 4 pages for 'requiredfieldvalidator'.

Page 2/4 | < Previous Page | 1 2 3 4  | Next Page >

  • A problem with the asp.net create user control

    - by Sir Psycho
    Hi, I've customised the asp.net login control and it seems to create new accounts fine, but if I duplicate the user id thats already registered or enter an email thats already used, the error messages arn't displaying. Its driving me crazy. The page just refreshes without showing an error. I've included the as instructed on the MSDN site but nothing. http://msdn.microsoft.com/en-us/library/ms178342.aspx <asp:CreateUserWizard ErrorMessageStyle-BorderColor="Azure" ID="CreateUserWizard1" runat="server" ContinueDestinationPageUrl="~/home.aspx"> <WizardSteps> <asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server"> <ContentTemplate> <asp:Literal ID="ErrorMessage" runat="server"></asp:Literal> <div class="fieldLine"> <asp:Label ID="lblFirstName" runat="server" Text="First Name:" AssociatedControlID="tbxFirstName"></asp:Label> <asp:Label ID="lblLastName" runat="server" Text="Last Name:" AssociatedControlID="tbxLastName"></asp:Label> </div> <div class="fieldLine"> <asp:TextBox ID="tbxFirstName" runat="server"></asp:TextBox> <asp:TextBox ID="tbxLastName" runat="server"></asp:TextBox> </div> <asp:Label ID="lblEmail" runat="server" Text="Email:" AssociatedControlID="Email"></asp:Label> <asp:TextBox ID="Email" runat="server" CssClass="wideInput"></asp:TextBox><br /> <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" CssClass="aspValidator" Display="Dynamic" ControlToValidate="Email" ErrorMessage="Required"></asp:RequiredFieldValidator> <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" Display="Dynamic" CssClass="aspValidator" ControlToValidate="Email" SetFocusOnError="true" ValidationExpression="^(?:[a-zA-Z0-9_'^&amp;/+-])+(?:\.(?:[a-zA-Z0-9_'^&amp;/+-])+)*@(?:(?:\[?(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))\.){3}(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\]?)|(?:[a-zA-Z0-9-]+\.)+(?:[a-zA-Z]){2,}\.?)$" ErrorMessage="Email address not valid"></asp:RegularExpressionValidator> <asp:Label ID="lblEmailConfirm" runat="server" Text="Confirm Email Address:" AssociatedControlID="tbxEmailConfirm"></asp:Label> <asp:TextBox ID="tbxEmailConfirm" runat="server" CssClass="wideInput"></asp:TextBox><br /> <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" CssClass="aspValidator" Display="Dynamic" ControlToValidate="tbxEmailConfirm" ErrorMessage="Required"></asp:RequiredFieldValidator> <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" Display="Dynamic" CssClass="aspValidator" ControlToValidate="tbxEmailConfirm" SetFocusOnError="true" ValidationExpression="^(?:[a-zA-Z0-9_'^&amp;/+-])+(?:\.(?:[a-zA-Z0-9_'^&amp;/+-])+)*@(?:(?:\[?(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))\.){3}(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\]?)|(?:[a-zA-Z0-9-]+\.)+(?:[a-zA-Z]){2,}\.?)$" ErrorMessage="Email address not valid"></asp:RegularExpressionValidator> <asp:CompareValidator ID="CompareValidator1" runat="server" Display="Dynamic" SetFocusOnError="true" CssClass="aspValidator" ControlToCompare="Email" ControlToValidate="tbxEmailConfirm" ErrorMessage="Email address' do not match"></asp:CompareValidator> <asp:Label ID="lblUsername" runat="server" Text="Username:" AssociatedControlID="UserName"></asp:Label> <asp:TextBox ID="UserName" runat="server" MaxLength="12"></asp:TextBox><br /> <asp:CustomValidator ID="CustomValidatorUserName" runat="server" Display="Dynamic" SetFocusOnError="true" CssClass="aspValidator" ValidateEmptyText="true" ControlToValidate="UserName" ErrorMessage="Username can be between 6 and 12 characters." ClientValidationFunction="ValidateLength" OnServerValidate="ValidateUserName"></asp:CustomValidator> <div class="fieldLine"> <asp:Label ID="lblPassword" runat="server" Text="Password:" AssociatedControlID="Password"></asp:Label> <asp:Label ID="lblPasswordConfirm" runat="server" Text="Confirm Password:" AssociatedControlID="ConfirmPassword" CssClass="confirmPassword"></asp:Label> </div> <div class="fieldLine"> <asp:TextBox ID="Password" runat="server" TextMode="Password"></asp:TextBox> <asp:TextBox ID="ConfirmPassword" runat="server" TextMode="Password"></asp:TextBox><br /> <asp:CustomValidator ID="CustomValidatorPassword" runat="server" Display="Dynamic" SetFocusOnError="true" CssClass="aspValidator" ControlToValidate="Password" ValidateEmptyText="true" ErrorMessage="Password can be between 6 and 12 characters" ClientValidationFunction="ValidateLength" OnServerValidate="ValidatePassword"></asp:CustomValidator> <asp:CustomValidator ID="CustomValidatorConfirmPassword" runat="server" Display="Dynamic" SetFocusOnError="true" CssClass="aspValidator" ControlToValidate="ConfirmPassword" ValidateEmptyText="true" ErrorMessage="Password can be between 6 and 12 characters" ClientValidationFunction="ValidateLength" OnServerValidate="ValidatePassword"></asp:CustomValidator> <asp:CompareValidator ID="CompareValidator2" runat="server" Enabled="false" Display="Dynamic" SetFocusOnError="true" CssClass="aspValidator" ControlToCompare="Password" ControlToValidate="ConfirmPassword" ErrorMessage="Passwords do not match"></asp:CompareValidator> </div> <asp:Label ID="lblCaptch" runat="server" Text="Captcha:" AssociatedControlID="imgCaptcha"></asp:Label> <div class="borderBlue" style="width:200px;"> <asp:Image ID="imgCaptcha" runat="server" ImageUrl="~/JpegImage.aspx" /><br /> </div> <asp:TextBox ID="tbxCaptcha" runat="server" CssClass="captchaText"></asp:TextBox> <asp:RequiredFieldValidator ControlToValidate="tbxCaptcha" CssClass="aspValidator" ID="RequiredFieldValidator3" runat="server" ErrorMessage="Required"></asp:RequiredFieldValidator> <asp:CustomValidator ID="CustomValidator1" ControlToValidate="tbxCaptcha" runat="server" OnServerValidate="ValidateCaptcha" ErrorMessage="Captcha incorrect"></asp:CustomValidator> </ContentTemplate> <CustomNavigationTemplate> <div style="float:left;"> <asp:Button ID="CreateUser" runat="server" Text="Register Now!" CausesValidation="true" CommandName="CreateUser" OnCommand="CreateUserClick" CssClass="registerButton" /> </div> </CustomNavigationTemplate> </asp:CreateUserWizardStep> <asp:CompleteWizardStep ID="CompleteWizardStep1" runat="server"> <ContentTemplate> <table border="0" style="font-size: 100%; font-family: Verdana" id="TABLE1" > <tr> <td align="center" colspan="2" style="font-weight: bold; color: white; background-color: #5d7b9d; height: 18px;"> Complete</td> </tr> <tr> <td> Your account has been successfully created.<br /> </td> </tr> <tr> <td align="right" colspan="2"> <asp:Button ID="Button1" PostBackUrl="~/home.aspx" runat="server" Text="Button" /> </td> </tr> </table> </ContentTemplate> </asp:CompleteWizardStep> </WizardSteps> </asp:CreateUserWizard>

    Read the article

  • Where is my validator?

    - by Danny Chen
    I have a validator in my page: <asp:RequiredFieldValidator ID="rfv1" runat="server" ControlToValidate="IdentifySEDSED1TxtDate" ErrorMessage="Significant Event Date 1 is missing" ValidType="SEDate">*</asp:RequiredFieldValidator> I found that in Page_Load: (below is a screen shot from the Watch Window) this.FindControl("rfv1") {Text = "*"} rfv1 The name 'rfv1' does not exist in the current context See, I can get this control with FindControl, but I can't get it using ID directly! What happens?

    Read the article

  • CustomValidator, pagemethods and JQuery what fun

    - by Goosey
    Hey all, I have a CustomValidator, RequiredFieldValidator and ValidationSummary controls on an aspx page to check the current password and make sure the new password is not blank. When I click submit I get the js alert() box from the summary control telling me about just the RequiredFieldValidator being false, but the client script for the CustomValidator does not seem to get its return value used. I have checked the "arguments.IsValid" value using FireBug, so it is getting called and returning the correct bool, but it never shows up in the val summary box? Thanks, Goosey

    Read the article

  • ASP.NET how to save textbox in database?

    - by mahsoon
    I used some textboxes to get some info from users + a sqldatasource <tr> <td class="style3" colspan="3" style="font-size: medium; font-family: 'B Nazanin'; font-weight: bold; position: relative; right: 170px" > &nbsp; ????? ??????? ????</td> </tr> <tr> <td class="style3"> &nbsp;&nbsp;&nbsp; <asp:Label ID="Label1" runat="server" Text=" ???: " Font-Bold="True" Font-Names="B Nazanin" Font-Size="Medium"></asp:Label> </td> <td class="style2"> <asp:TextBox ID="FirstName" runat="server"></asp:TextBox> </td> <td class="style4"> <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" Display="Dynamic" ErrorMessage="???? ???? ??? ?????? ???" ControlToValidate="FirstName">*</asp:RequiredFieldValidator> </td> </tr> <tr> <td class="style3"> &nbsp;&nbsp;&nbsp;<asp:Label ID="Label2" runat="server" Text=" ??? ????????: " Font-Bold="True" Font-Names="B Nazanin" Font-Size="Medium"></asp:Label> </td> <td class="style2"> <asp:TextBox ID="LastName" runat="server"></asp:TextBox> </td> <td class="style4"> <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" Display="Dynamic" ErrorMessage="???? ???? ??? ???????? ?????? ???" ControlToValidate="LastName">*</asp:RequiredFieldValidator> </td> </tr> <tr> <td class="style3"> &nbsp;&nbsp;&nbsp;<asp:Label ID="Label3" runat="server" Text=" ????? ???????? : " Font-Bold="True" Font-Names="B Nazanin" Font-Size="Medium"></asp:Label> </td> <td class="style2"> <asp:TextBox ID="StudentNumber" runat="server"></asp:TextBox> </td> <td class="style4"> <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" Display="Dynamic" ErrorMessage="???? ???? ????? ???????? ?????? ???" ControlToValidate="StudentNumber">*</asp:RequiredFieldValidator> </td> </tr> <tr> <td class="style3"> &nbsp;&nbsp;<asp:Label ID="Label4" runat="server" Text="  ????? ???? : " Font-Bold="True" Font-Names="B Nazanin" Font-Size="Medium"></asp:Label> </td> <td class="style2"> <asp:TextBox ID="DateOfBirth" runat="server"></asp:TextBox> </td> <td class="style4"> <asp:CompareValidator ID="CompareValidator1" runat="server" Display="Dynamic" ErrorMessage="????? ???? ?????? ?? ???? ??????" Operator="DataTypeCheck" Type="Date" ControlToValidate="dateOfBirth"></asp:CompareValidator> </td> </tr> <tr> <td class="style3"> &nbsp;</td> <td class="style2"> <asp:Button ID="SaveButton" runat="server" Text=" ????? ???????" Width="102px" style="margin-right: 15px; height: 26px;" /> </td> <td class="style4"> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ASPNETDBConnectionString1 %>" SelectCommand="SELECT aspnet_personalInformation.FirstName, aspnet_personalInformation.LastName, aspnet_personalInformation.StudentNumber, aspnet_personalInformation.DateOfBirth FROM aspnet_personalInformation INNER JOIN aspnet_Users ON aspnet_personalInformation.UserId = aspnet_Users.UserId WHERE aspnet_personalInformation.UserId=aspnet_Users.UserId ORDER BY aspnet_personalInformation.LastName" InsertCommand="INSERT INTO aspnet_PersonalInformation(UserId) SELECT UserId FROM aspnet_Profile"> </asp:SqlDataSource> </td> </tr> </table> i wanna save firstname lastname studentnumber and dateofbirth in aspnet_personalinformation table in database but before that, i fill one column of aspnet_personalinformation table named UserId by inserting sql command with aspnet_profile.userid now by running this code my table has still blankes protected void SaveButton_Click(object sender, EventArgs e) { string str= "Data Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\ASPNETDB.MDF;Integrated Security=True;User Instance=True"; SqlConnection con = new SqlConnection(str); con.Open(); string query = "INSERT INTO aspnet_PersonalInformation( FirstName, LastName,StudentNumber,DateOfBirth) VALUES ('" + this.FirstName.Text + "','" + this.LastName.Text + "','" + this.StudentNumber.Text + "','" + this.DateOfBirth.Text + "') where aspnet_PersonalInformation.UserId=aspnet_Profile.UserID"; SqlCommand cmd=new SqlCommand(query,con); cmd.ExecuteNonQuery(); con.Close(); } but it doesn't work help me plz

    Read the article

  • How does Page.IsValid work?

    - by Lijo
    I have following code with a RequiredFieldValidator. The EnableClientScript property is set as "false" in the validation control. Also I have disabled script in browser. I am NOT using Page.IsValid in code behind. Still, when I submit without any value in textbox I will get error message. From comments of @Dai, I came to know that this can be an issue, if there is any code in Page_Load that is executed in a postback. There will be no validation errors thrown. (However, for button click handler, there is no need to check Page.IsValid) if (Page.IsPostBack) { string value = txtEmpName.Text; txtEmpName.Text = value + "Appended"; } QUESTION Why the server side validation does not happen before Page_Load? Why it works fine when I use Page.IsValid? UPDATE It seems like, we need to add If(Page.IsValid) in button click also if we are using a Custom Validator with server side validation. Refer CustomValidator not working well. Note: Client side validation question is present here: Whether to use Page_IsValid or Page_ClientValidate() (for Client Side Events) MARKUP <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script type="text/javascript"> alert('haiii'); </script> </head> <body> <form id="form1" runat="server"> <div> <asp:ValidationSummary runat="server" ID="vsumAll" DisplayMode="BulletList" CssClass="validationsummary" ValidationGroup="ButtonClick" /> <asp:TextBox ID="txtEmpName" runat="server"></asp:TextBox> <asp:RequiredFieldValidator ID="valEmpName" runat="server" ControlToValidate="txtEmpName" EnableClientScript="false" ErrorMessage="RequiredFieldValidator" Text="*" Display="Dynamic" ValidationGroup="ButtonClick"></asp:RequiredFieldValidator> <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" ValidationGroup="ButtonClick" /> </div> </form> </body> </html> CODE BEHIND protected void Button1_Click(object sender, EventArgs e) { string value = txtEmpName.Text; SubmitEmployee(value); } References: Should I always call Page.IsValid? ASP.NET Validation Controls – Important Points, Tips and Tricks CustomValidator not working well

    Read the article

  • Validation control issue

    - by Mael
    Hello, I have a multiview that simulates a menu with different kind of options. Each view within the multiview control holds a bunch of controls (listbox, label, etc..) Everything worked just fine, until i wanted to implement Validation control(s). For example when i click on my menu viewA gets displayed with its controls. There i wish to implement a RequiredFieldValidator. But the problem is, if i click on a other menu option (which is in fact a other view in my multiview) then it gives the error message 'Please enter a message" which is the errorMessage of the first RequiredFieldValidator of the first menu option (first view). All my controls are named with a unique name, so there is no mixup amongst the ControlToValidate="" Offcourse this is not suitable, cause those menu choices are indepentant. And its not the intention i have to fill in everything, cause its a menu afterall, and not a form where i have to enter everything at once. How can i have a RequiredFieldValidator on my views that do not take each other in account? Some code on how my active view is handled protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { View activeView = (View)this.mvMultiview.FindControl(this.getViewFromRequest()); if (!(activeView == null)) { this.mvMultiview.SetActiveView(activeView); } } } Thanks.

    Read the article

  • ASP.NET Membership API not working on Win2008 server/IIS7

    - by Program.X
    I have a very odd problem. I have a web app that uses the .NET Membership API to provide login functionality. This works fine on my local dev machine, using WebDev 4.0 server. I'm using .NET 4.0 with some URL Rewriting, but not on the pages where login is required. I have a Windows Server 2008 with IIS7 However, the Membership API seemingly does not work on the server. I have set up remote debugging and the LoginUser.LoggedIn event of the LoginUser control gets fired okay, but the MembershipUser is null. I get no answer about the username/password being invalid so it seems to be recognising it. If I enter an invalid username/password, I get an invalid username/password response. Some code, if it helps: <asp:ValidationSummary ID="LoginUserValidationSummary" runat="server" CssClass="validation-error-list" 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="validation-error" Display="Dynamic" 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="validation-error" Display="Dynamic" 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="login-action"> <asp:Button ID="LoginButton" runat="server" CommandName="Login" CssClass="submitButton" Text="Log In" ValidationGroup="LoginUserValidationGroup"/> </p> and the code behind: protected void Page_Load(object sender, EventArgs e) { LoginUser.LoginError += new EventHandler(LoginUser_LoginError); LoginUser.LoggedIn += new EventHandler(LoginUser_LoggedIn); } void LoginUser_LoggedIn(object sender, EventArgs e) { // this code gets run so it appears logins work Roles.DeleteCookie(); // this behaviour has been removed for testing - no difference } void LoginUser_LoginError(object sender, EventArgs e) { HtmlGenericControl htmlGenericControl = LoginUser.FindControl("errorMessageSpan") as HtmlGenericControl; if (htmlGenericControl != null) htmlGenericControl.Visible = true; } I have "Fiddled" with the Login form reponse and I get the following Cookie-Set headers: Set-Cookie: ASP.NET_SessionId=lpyyiyjw45jjtuav1gdu4jmg; path=/; HttpOnly Set-Cookie: .ASPXAUTH=A7AE08E071DD20872D6BBBAD9167A709DEE55B352283A7F91E1066FFB1529E5C61FCEDC86E558CEA1A837E79640BE88D1F65F14FA8434AA86407DA3AEED575E0649A1AC319752FBCD39B2A4669B0F869; path=/; HttpOnly Set-Cookie: .ASPXROLES=; expires=Mon, 11-Oct-1999 23:00:00 GMT; path=/; HttpOnly I don't know what is useful here because it is obviously encrypted but I find the .APXROLES cookie having no value interesting. It seems to fail to register the cookie, but passes authentication

    Read the article

  • Side effect of calling ValidatorEnable method: sets focus to control associated with validator

    - by Velika2
    When I called this function to enable a validator from client javascript: `ValidatorEnable(document.getElementById('<%=valPassportOtherText.ClientID%>'), true); //enable` validation control The side effect was that focus was shifted to the txtSpecifyOccupation textbox (the control associated with the Validation control) <asp:TextBox ID="txtSpecifyOccupation" runat="server" AutoCompleteType="Disabled" CssClass="DefaultTextBox DefaultWidth" MaxLength="24" Rows="2"></asp:TextBox> <asp:RequiredFieldValidator ID="valSpecifyOccupation" runat="server" ControlToValidate="txtSpecifyOccupation" ErrorMessage="1.14b Please specify your &lt;b&gt;Occupation&lt;/b&gt;" SetFocusOnError="True">&nbsp;Required</asp:RequiredFieldValidator> Perhaps there is a way to enable the (required) validator without having it simultaneously perform the validation (at least until the user has tabbed off of it?)

    Read the article

  • Asp.Net Login control (Visual Web Dev)

    - by craig
    This is the code when you take the Login control from the toolbox. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_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 runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <asp:Login ID="Login1" runat="server" onauthenticate="Login1_Authenticate" BackColor="#F7F7DE" BorderColor="#CCCC99" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" Font-Size="10pt"> <LayoutTemplate> <table border="0" cellpadding="1" cellspacing="0" style="border-collapse:collapse;"> <tr> <td> <table border="0" cellpadding="0"> <tr> <td align="center" colspan="2"> Log In</td> </tr> <tr> <td align="right"> <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">User Name:</asp:Label> </td> <td> <asp:TextBox ID="UserName" runat="server" ></asp:TextBox> <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName" ErrorMessage="User Name is required." ToolTip="User Name is required." ValidationGroup="Login1">*</asp:RequiredFieldValidator> </td> </tr> <tr> <td align="right"> <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label> </td> <td> <asp:TextBox ID="Password" runat="server" TextMode="Password"></asp:TextBox> <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password" ErrorMessage="Password is required." ToolTip="Password is required." ValidationGroup="Login1">*</asp:RequiredFieldValidator> </td> </tr> <tr> <td colspan="2"> <asp:CheckBox ID="RememberMe" runat="server" Text="Remember me next time." /> </td> </tr> <tr> <td align="center" colspan="2" style="color:Red;"> <asp:Literal ID="FailureText" runat="server" EnableViewState="False"></asp:Literal> </td> </tr> <tr> <td align="right" colspan="2"> <asp:Button ID="LoginButton" runat="server" CommandName="Login" Text="Log In" ValidationGroup="Login1" onclick="LoginButton_Click" /> </td> </tr> </table> </td> </tr> </table> </LayoutTemplate> <TitleTextStyle BackColor="#6B696B" Font-Bold="True" ForeColor="#FFFFFF" /> </asp:Login> </div> </form> </body> </html> Part of my aspx.cs protected void LoginButton_Click(object sender, EventArgs e) { String sUserName = UserName.Text; String sPassword = Password.Text; Error 1 The name 'UserName' does not exist in the current context Error 2 The name 'Password' does not exist in the current context Error 3 'ASP.default_aspx' does not contain a definition for 'Login1_Authenticate' and no extension method 'Login1_Authenticate' accepting a first argument of type 'ASP.default_aspx' could be found (are you missing a using directive or an assembly reference?) What am I doing wrong?

    Read the article

  • Issues with RegularExpressionValidator in VB .NET 2005 using ASP File Uploader

    - by JFV
    I'm looking to validate a single word: detail (upper/lower/mix-case) prior to submitting my VB .NET 2005 page. I used Regex Builder and the below code validates, but it's not working in my web page... Does anyone have any ideas? Input file location: <input id="btnBrowseForFile" runat="server" enableviewstate="true" name="btnBrowseForFile" style="width: 500px" type="file" /> <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="btnBrowseForFile" ErrorMessage="*Please select an input file." Display="Dynamic"></asp:RequiredFieldValidator> <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="btnBrowseForFile" Display="Dynamic" ErrorMessage='*Please select a file that contains the word "detail"' ValidationExpression="(\b|\s|\w)(d|D)(e|E)(t|T)(a|A)(i|I)(l|L)(\s|\b|\w)"></asp:RegularExpressionValidator>&nbsp; Thanks!!! JFV

    Read the article

  • Ajax AsyncFileUpload contains Filename Every time

    - by Kartik Patel
    I have used the Ajax AsyncFileUpload.I have three field. 1.Name 2.Asynchronous File Upload 3.Description 4.Save buttton when I click on Save new Record created.after creating new record when i enter all above details except select the Asynchronous File Upload.However when i click on Save button the Asynchronous File Upload contains the before Asynchronous upload File Name inspite of i didnt select the File from File Upload...How its possible getting confused.. My code is like this i have used master page. <asp:Content ID="Content2" ContentPlaceHolderID="body" runat="server"> <script type="text/javascript" language="javascript"> function UploadComplete() { document.getElementById('<%=lblmsg.ClientID %>').innerHTML = "Image Uploaded Successfully."; } function UploadError() { document.getElementById('<%=lblmsg.ClientID %>').innerHTML = "Image Upload Failed."; } </script> <table> <tr> <td colspan="2"> <h1 style="color: #008000"> Add Project Details</h1> </td> </tr> <tr> <td align="left"> <asp:Label ID="lblProjectName" runat="server" Text="Project Name" Font-Bold="true"></asp:Label> </td> <td align="left"> <asp:TextBox ID="txtProjectName" runat="server" MaxLength="50" Width="150px" ValidationGroup="Save"></asp:TextBox> <asp:RequiredFieldValidator ID="rfvprojectname" runat="server" Text="Project Name is Required." ErrorMessage="Project Name is Required." ControlToValidate="txtProjectName" ForeColor="Red" ValidationGroup="Save"></asp:RequiredFieldValidator> </td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td align="left"> <asp:Label ID="lblselectimage" runat="server" Text="Select Image" Font-Bold="true"></asp:Label> </td> <td align="left"> <table> <tr> <td> <cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"> </cc1:ToolkitScriptManager> <cc1:AsyncFileUpload ID="AsyncFileUpload1" runat="server" OnClientUploadComplete="UploadComplete" OnClientUploadError="UploadError" CompleteBackColor="White" Width="350px" UploaderStyle="Traditional" UploadingBackColor="#CCFFFF" ThrobberID="imgLoad" OnUploadedComplete="fileuploadComplete" ClientIDMode="AutoID" EnableViewState="true"/> </td> <td> <asp:Image ID="imgUpload" runat="server" Width="50px" Height="50px" /> </td> </tr> </table> </td> </tr> <tr> <td> </td> <td> <asp:Image ID="imgLoad" runat="server" ImageUrl="~/Images/loading-gif-animation.gif" Width="50px" Height="50px" /> <asp:Label ID="lblmsg" runat="server" ForeColor="Blue" Font-Bold="true"></asp:Label> </td> </tr> <tr> <td align="left"> <asp:Label ID="lblDescription" runat="server" Text="Description" Font-Bold="true"></asp:Label> </td> <td align="left"> <asp:TextBox ID="txtDescription" runat="server" MaxLength="1000" Width="300" TextMode="MultiLine" ValidationGroup="Save" Height="100px"></asp:TextBox> <asp:RequiredFieldValidator ID="RfvtxtDescription" runat="server" Text="Project Description is Required." ErrorMessage="Project Description is Required." ControlToValidate="txtDescription" ForeColor="Red" ValidationGroup="Save"></asp:RequiredFieldValidator> </td> </tr> <tr> <td> </td> <td align="left"> <asp:ImageButton ID="btnsave" runat="server" ImageUrl="~/Images/Save.jpg" OnClick="btnSave_Click" Height="37px" ValidationGroup="Save" /> </td> </tr> </table>

    Read the article

  • Validating User Input with ASP.NET 3.5

    In the first part of this three-part series explaining the basics of user input validation in ASP.NET 3.5 you were introduced to the concepts of user input validation and saw a sample configuration of the RequiredFieldValidator web controls. In this part you will learn about several types of input validation web controls and their methods of configuration.... Charter Business Bundle? Get High Speed Internet & Telephone for Only $99/Monthly. Limited-Time Offer!

    Read the article

  • how to display user name in login name control

    - by user569285
    I have a master page that holds the loginview content that appears on all subsequent pages based on the master page. i have a username control also nested in the loginview to display the name of the user when they are logged in. the code for the loginview from the master page is displayed as follows: <div class="loginView"> <asp:LoginView ID="MasterLoginView" runat="server"> <LoggedInTemplate> Welcome <span class="bold"><asp:LoginName ID="HeadLoginName" runat="server" /> <asp:Label ID="userNameLabel" runat="server" Text="Label"></asp:Label></span>! [ <asp:LoginStatus ID="HeadLoginStatus" runat="server" LogoutAction="Redirect" LogoutText="Log Out" LogoutPageUrl="~/Logout.aspx"/> ] <%--Welcome: <span class="bold"><asp:LoginName ID="MasterLoginName" runat="server" /> </span>!--%> </LoggedInTemplate> <AnonymousTemplate> Welcome: Guest [ <a href="~/Account/Login.aspx" ID="HeadLoginStatus" runat="server">Log In</a> ] </AnonymousTemplate> </asp:LoginView> <%--&nbsp;&nbsp; [&nbsp;<asp:LoginStatus ID="MasterLoginStatus" runat="server" LogoutAction="Redirect" LogoutPageUrl="~/Logout.aspx" />&nbsp;]&nbsp;&nbsp;--%> </div> Since VS2010 launches with a default login page in the accounts folder, i didnt think it necessary to create a separate log in page, so i just used the same log in page. please find the code for the login control below: <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 style="text-align:left; font-size:1.2em; color:White;">Account Information</legend> <p style="text-align:left; font-size:1.2em; color:White;"> <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">User ID:</asp:Label> <asp:TextBox ID="UserName" runat="server" CssClass="textEntry"></asp:TextBox> <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName" CssClass="failureNotification" ErrorMessage="User ID is required." ToolTip="User ID field is required." ValidationGroup="LoginUserValidationGroup">*</asp:RequiredFieldValidator> </p> <p style="text-align:left; font-size:1.2em; color:White;"> <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 style="text-align:left; font-size:1.2em; color:White;"> <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" onclick="LoginButton_Click"/> </p> </div> </LayoutTemplate> </asp:Login> I then wrote my own code for authentication since i had my own database. the following displays the code in the login buttons click event.: public partial class Login : System.Web.UI.Page { //create string objects string userIDStr, pwrdStr; protected void LoginButton_Click(object sender, EventArgs e) { //assign textbox items to string objects userIDStr = LoginUser.UserName.ToString(); pwrdStr = LoginUser.Password.ToString(); //SQL connection string string strConn; strConn = WebConfigurationManager.ConnectionStrings["CMSSQL3ConnectionString"].ConnectionString; SqlConnection Conn = new SqlConnection(strConn); //SqlDataSource CSMDataSource = new SqlDataSource(); // CSMDataSource.ConnectionString = ConfigurationManager.ConnectionStrings["CMSSQL3ConnectionString"].ToString(); //SQL select statement for comparison string sqlUserData; sqlUserData = "SELECT StaffID, StaffPassword, StaffFName, StaffLName, StaffType FROM Staffs"; sqlUserData += " WHERE (StaffID ='" + userIDStr + "')"; sqlUserData += " AND (StaffPassword ='" + pwrdStr + "')"; SqlCommand com = new SqlCommand(sqlUserData, Conn); SqlDataReader rdr; string usrdesc; string lname; string fname; string staffname; try { //string CurrentData; //CurrentData = (string)com.ExecuteScalar(); Conn.Open(); rdr = com.ExecuteReader(); rdr.Read(); usrdesc = (string)rdr["StaffType"]; fname = (string)rdr["StaffFName"]; lname = (string)rdr["StaffLName"]; staffname = lname.ToString() + " " + fname.ToString(); LoginUser.UserName = staffname.ToString(); rdr.Close(); if (usrdesc.ToLower() == "administrator") { Response.Redirect("~/CaseAdmin.aspx", false); } else if (usrdesc.ToLower() == "manager") { Response.Redirect("~/CaseManager.aspx", false); } else if (usrdesc.ToLower() == "investigator") { Response.Redirect("~/Investigator.aspx", false); } else { Response.Redirect("~/Default.aspx", false); } } catch(Exception ex) { string script = "<script>alert('" + ex.Message + "');</script>"; } finally { Conn.Close(); } } My authentication works perfectly and the page gets redirected to the designated destination. However, the login view does not display the users name. i actually cant figure out how to pass the users name that i had picked from the database to the login name control to be displayed. taking a close look i also noticed the logout text that should be displayed after successful log in does not show. that leaves me wondering if the loggedin template control on the masterpage even fires at all or its still the anonymous template control that keeps displaying.? How do i get this to work as expected? Please help....

    Read the article

  • Updating with using custom class collection not working

    - by Risho
    I've posted this yesterday on asp forum but no one replied so perhaps I'll have better luck here. For some reason the OnUpdating method does not pull new values from the grid which is in edit mode. I've search and have come across several blogs and sites, some sugesting that an ObjectDataSource is required in order to use the "e.NewValue" construct others provide code to the contrary. I don't get any errors - the variables in the code file would contain the old values rather then new ones. I don't want to use the ODS way of manipulating the data. My delete method works but not the update one. Can you suggest what is wrong with the code? Here is what I've got: aspx file: <asp:GridView ID="gvBlack" runat="server" AutoGenerateColumns="False" OnRowUpdating="gvBlack_OnUpdating" OnRowEditing="gvBlack_RowEditing"> <Columns> <%--<asp:BoundField DataField="Ident_Black" ReadOnly="True" visible="false" />--%> <asp:TemplateField ItemStyle-Width="1px"> <EditItemTemplate> <asp:Label ID="lblIdent_Black" runat="server" Text='<%# Bind("Ident_Black") %>' Visible="false" /> </EditItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Model" > <ItemTemplate> <asp:Label ID="lblModel_Black" runat="server" Text='<%# Bind("Model_Black") %>' width="130px" /> </ItemTemplate> <EditItemTemplate> <asp:TextBox ID="txtModel_Black" runat="server" Text='<%# Eval("Model_Black") %>' width="100px" /> <asp:RequiredFieldValidator ID="rfvModel_Black" runat="server" ControlToValidate="txtModel_Black" SetFocusOnError="true" ErrorMessage="*" ValidationGroup="CurrentMfg" ForeColor="Red" Font-Bold="true" /> </EditItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Description" > <ItemTemplate> <asp:Label ID="lblDesc_Black" runat="server" Text='<%# Bind("Desc_Black") %>' width="200px" /> </ItemTemplate> <EditItemTemplate> <asp:TextBox ID="txtDesc_Black" runat="server" Text='<%# Eval("Desc_Black") %>' width="170px" /> <span></span> </EditItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Qty" > <ItemTemplate> <asp:Label ID="lblQty_Black" runat="server" Text='<%# Bind("Qty_Black") %>' width="35px" /> </ItemTemplate> <EditItemTemplate> <asp:TextBox ID="txtQty_Black" runat="server" Text='<%# Eval("Qty_Black") %>' width="35px" /> <asp:RequiredFieldValidator ID="rfvQty_Black" runat="server" ControlToValidate="txtQty_Black" SetFocusOnError="true" ErrorMessage="*" ValidationGroup="CurrentMfg" ForeColor="Red" Font-Bold="true" /> </EditItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Reorder<br />Limit"> <ItemTemplate> <asp:Label ID="lblBlack_Reorder_Limit" runat="server" Text='<%# Bind("Black_Reorder_Limit") %>' width="35px" /> </ItemTemplate> <EditItemTemplate> <asp:TextBox ID="txtBlack_Reorder_Limit" runat="server" Text='<%# Eval("Black_Reorder_Limit") %>' width="35px" /> <asp:RequiredFieldValidator ID="rfvBlack_Reorder_Limit" runat="server" ControlToValidate="txtBlack_Reorder_Limit" SetFocusOnError="true" ErrorMessage="*" ValidationGroup="CurrentMfg" ForeColor="Red" Font-Bold="true" /> </EditItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Notes"> <ItemTemplate> <asp:Label ID="lblNotes" runat="server" Text='<%# Bind("Notes") %>' width="200px" /> </ItemTemplate> <EditItemTemplate> <asp:TextBox ID="txtNotes" runat="server" Text='<%# Eval("Notes") %>' width="170px" /> <span></span> </EditItemTemplate> </asp:TemplateField> <asp:CommandField ShowEditButton="True" ShowDeleteButton="false" ValidationGroup="CurrentToner" /> </Columns> </asp:GridView> aspx.cs file: protected void Page_Load(object sender, EventArgs e) { LoadData_TonerBlack(); } private void LoadData_TonerBlack() { dalConsumables_TonerBlack drTonerBlack = new dalConsumables_TonerBlack(); gvBlack.DataSource = drTonerBlack.GetListTonersBlack(); gvBlack.DataBind(); } protected void gvBlack_OnUpdating(object sender, GridViewUpdateEventArgs e) { //GridView gvBlack = (GridView)sender; //GridViewRow gvBlackRow = (GridViewRow)gvBlack.Rows[e.RowIndex]; int _Ident_Black = Convert.ToInt32(gvBlack.DataKeys[e.RowIndex].Values[0].ToString()); TextBox _txtModel_Black = (TextBox)gvBlack.Rows[e.RowIndex].FindControl("txtModel_Black"); TextBox _txtDesc_Black = (TextBox)gvBlack.Rows[e.RowIndex].FindControl("txtDesc_Black"); TextBox _txtQty_Black = (TextBox)gvBlack.Rows[e.RowIndex].FindControl("txtQty_Black"); TextBox _txtBlack_Reorder_Limit = (TextBox)gvBlack.Rows[e.RowIndex].FindControl("txtBlack_Reorder_Limit"); TextBox _txtNotes = (TextBox)gvBlack.Rows[e.RowIndex].FindControl("txtNotes"); string _updatedBy = Request.ServerVariables["AUTH_USER"].ToString(); dalConsumables_TonerBlack updateTonerBlack = new dalConsumables_TonerBlack(); updateTonerBlack.UpdateTonerBlack(_Ident_Black, _txtModel_Black.Text, _txtDesc_Black.Text, Convert.ToInt32(_txtQty_Black.Text), Convert.ToInt32(_txtBlack_Reorder_Limit.Text), _txtNotes.Text, _updatedBy); gvBlack.EditIndex = -1; LoadData_TonerBlack(); } protected void gvBlack_RowEditing(object sender, GridViewEditEventArgs e) { gvBlack.EditIndex = e.NewEditIndex; LoadData_TonerBlack(); } Thanks in advance! Risho

    Read the article

  • ValidationProperty not returning entered value for textbox in custom ontrol

    - by nat
    hi I have a custom control, (relevant code at the bottom) it consists of some text/links and a hidden textbox (rather than a hidden input). when rendered, the user via another dialog and some JS sets the value of the textbox to an integer and clicks submit on the form. i am trying to assure that the user has entered a number (via the JS) and that the textbox is not still set to its default of "0" the requiredfieldvalidator works just fine, if i dont change the value it spots it on the client and fills the validation summary on the page with the appropriate message. unfortunately when i do fill the textbox, the validator also rejests the post as the controls textbox text value is still set to "0", even though on the form it has changed. clearly i am doing something wrong.. but cant work out what it is? could someone enlighten me please, this is driving me potty if i step through the code, when the get of the mediaidtext is hit,the findcontrol finds does not the textbox, if i inspect the controls collection however i can find the textbox, but its value is still "0" it also seems that when findcontrol is called, the createchildcontrols is called again - thus resetting the value back to "0" there.. ! how can i ever assure the control realises that the textbox value has changed? many thanks code below nat [ValidationProperty("MediaIdText")] public class MediaLibraryFileControl: CompositeControl { private int mediaId = 0; public int MediaId { get { return mediaId; } set { mediaId = value; } } public string MediaIdText { get { string txt = "0"; Control ctrl = this.FindControl(this.UniqueID+ "_hidden"); try { txt = ((TextBox)ctrl).Text; MediaId = Convert.ToInt32(txt); } catch { MediaId = 0; } return txt; } } protected override void CreateChildControls() { this.Controls.Add(new LiteralControl("<span>")); this.Controls.Add(new LiteralControl("<span id=\"" + TextControlName + "\">" + getMediaDetails() + "</span>")); TextBox tb = new TextBox(); tb.Text = this.MediaId.ToString(); tb.ID = this.UniqueID + "_hidden"; tb.CssClass = "hidden"; this.Controls.Add(tb); if (Select == true) { this.Controls.Add(new LiteralControl(string.Format("&nbsp;[<a href=\"javascript:{0}(this,'{1}','{2}')\" class=\"select\">{3}</a>]", dialog, this.UniqueID, this.categoryId, "select"))); this.Controls.Add(new LiteralControl(string.Format("&nbsp;[<a href=\"javascript:{0}(this,'{1}')\" class=\"select\">{2}</a>]", clearDialog, this.ID, "clear"))); } this.Controls.Add(new LiteralControl("</span>")); } protected virtual string getMediaDetails() { //... return String.Empty; } } this is the code adding the validationcontrol the editcontrol is the instance of the control above public override Control RenderValidationControl(Control editControl) { Control ctrl = new PlaceHolder(); RequiredFieldValidator req = new RequiredFieldValidator(); req.ID = editControl.ClientID + "_validator"; req.ControlToValidate = editControl.ID; req.Display = ValidatorDisplay.None; req.InitialValue = "0"; req.EnableClientScript = false; req.ErrorMessage = "control cannot be blank"; ctrl.Controls.Add(req); return ctrl; }

    Read the article

  • ValidationProperty not returning entered value for textbox

    - by nat
    hi I have a custom control, (relevant code at the bottom) it consists of some text/links and a hidden textbox (rather than a hidden input). when rendered, the user via another dialog and some JS sets the value of the textbox to an integer and clicks submit on the form. i am trying to assure that the user has entered a number (via the JS) and that the textbox is not still set to its default of "0" the requiredfieldvalidator works just fine, if i dont change the value it spots it on the client and fills the validation summary on the page with the appropriate message. unfortunately when i do fill the textbox, the validator also rejests the post as the controls textbox text value is still set to "0", even though on the form it has changed. clearly i am doing something wrong.. but cant work out what it is? could someone enlighten me please, this is driving me potty if i step through the code, when the get of the mediaidtext is hit,the findcontrol finds the textbox, but the value is still set to "0" many thanks code below nat [ValidationProperty("MediaIdText")] public class MediaLibraryFileControl: CompositeControl { private int mediaId = 0; public int MediaId { get { return mediaId; } set { mediaId = value; } } public string MediaIdText { get { string txt = "0"; Control ctrl = this.FindControl(this.UniqueID+ "_hidden"); try { txt = ((TextBox)ctrl).Text; MediaId = Convert.ToInt32(txt); } catch { MediaId = 0; } return txt; } } protected override void CreateChildControls() { this.Controls.Add(new LiteralControl("<span>")); this.Controls.Add(new LiteralControl("<span id=\"" + TextControlName + "\">" + getMediaDetails() + "</span>")); TextBox tb = new TextBox(); tb.Text = this.MediaId.ToString(); tb.ID = this.UniqueID + "_hidden"; tb.CssClass = "hidden"; this.Controls.Add(tb); if (Select == true) { this.Controls.Add(new LiteralControl(string.Format("&nbsp;[<a href=\"javascript:{0}(this,'{1}','{2}')\" class=\"select\">{3}</a>]", dialog, this.UniqueID, this.categoryId, "select"))); this.Controls.Add(new LiteralControl(string.Format("&nbsp;[<a href=\"javascript:{0}(this,'{1}')\" class=\"select\">{2}</a>]", clearDialog, this.ID, "clear"))); } this.Controls.Add(new LiteralControl("</span>")); } protected virtual string getMediaDetails() { //... return String.Empty; } } this is the code adding the validationcontrol the editcontrol is the instance of the control above public override Control RenderValidationControl(Control editControl) { Control ctrl = new PlaceHolder(); RequiredFieldValidator req = new RequiredFieldValidator(); req.ID = editControl.ClientID + "_validator"; req.ControlToValidate = editControl.ID; req.Display = ValidatorDisplay.None; req.InitialValue = "0"; req.EnableClientScript = false; req.ErrorMessage = "control cannot be blank"; ctrl.Controls.Add(req); return ctrl; }

    Read the article

  • May 2011 Release of the Ajax Control Toolkit

    - by Stephen Walther
    I’m happy to announce that the Superexpert team has published the May 2011 release of the Ajax Control Toolkit at CodePlex. You can download the new release at the following URL: http://ajaxcontroltoolkit.codeplex.com/releases/view/65800 This release focused on improving the ModalPopup and AsyncFileUpload controls. Our team closed a total of 34 bugs related to the ModalPopup and AsyncFileUpload controls. Enhanced ModalPopup Control You can take advantage of the Ajax Control Toolkit ModalPopup control to easily create popup dialogs in your ASP.NET Web Forms applications. When the dialog appears, you cannot interact with any page content which appears behind the modal dialog. For example, the following page contains a standard ASP.NET Button and Panel. When you click the Button, the Panel appears as a popup dialog: <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Simple.aspx.vb" Inherits="ACTSamples.Simple" %> <%@ Register TagPrefix="act" Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit" %> <!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 runat="server"> <title>Simple Modal Popup Sample</title> <style type="text/css"> html { background-color: blue; } #dialog { border: 2px solid black; width: 500px; background-color: White; } #dialogContents { padding: 10px; } .modalBackground { background-color:Gray; filter:alpha(opacity=70); opacity:0.7; } </style> </head> <body> <form id="form1" runat="server"> <div> <act:ToolkitScriptManager ID="tsm" runat="server" /> <asp:Panel ID="dialog" runat="server"> <div id="dialogContents"> Here are the contents of the dialog. <br /> <asp:Button ID="btnOK" Text="OK" runat="server" /> </div> </asp:Panel> <asp:Button ID="btnShow" Text="Open Dialog" runat="server" /> <act:ModalPopupExtender TargetControlID="btnShow" PopupControlID="dialog" OkControlID="btnOK" DropShadow="true" BackgroundCssClass="modalBackground" runat="server" /> </div> </form> </body> </html>     Notice that the page includes two controls from the Ajax Control Toolkit: the ToolkitScriptManager and the ModalPopupExtender control. Any page which uses any of the controls from the Ajax Control Toolkit must include a ToolkitScriptManager. The ModalPopupExtender is used to create the popup. The following properties are set: · TargetControlID – This is the ID of the Button or LinkButton control which causes the modal popup to be displayed. · PopupControlID – This is the ID of the Panel control which contains the content displayed in the modal popup. · OKControlID – This is the ID of a Button or LinkButton which causes the modal popup to close. · DropShadow – Displays a drop shadow behind the modal popup. · BackgroundCSSClass – The name of a Cascading Style Sheet class which is used to gray out the background of the page when the modal popup is displayed. The ModalPopup is completely cross-browser compatible. For example, the following screenshots show the same page displayed in Firefox 4, Internet Explorer 9, and Chrome 11: The ModalPopup control has lots of nice properties. For example, you can make the ModalPopup draggable. You also can programmatically hide and show a modal popup from either server-side or client-side code. To learn more about the properties of the ModalPopup control, see the following website: http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/ModalPopup/ModalPopup.aspx Animated ModalPopup Control In the May 2011 release of the Ajax Control Toolkit, we enhanced the Modal Popup control so that it supports animations. We made this modification in response to a feature request posted at CodePlex which got 65 votes (plenty of people wanted this feature): http://ajaxcontroltoolkit.codeplex.com/workitem/6944 I want to thank Dani Kenan for posting a patch to this issue which we used as the basis for adding animation support for the modal popup. Thanks Dani! The enhanced ModalPopup in the May 2011 release of the Ajax Control Toolkit supports the following animations: OnShowing – Called before the modal popup is shown. OnShown – Called after the modal popup is shown. OnHiding – Called before the modal popup is hidden. OnHidden – Called after the modal popup is hidden. You can use these animations, for example, to fade-in a modal popup when it is displayed and fade-out the popup when it is hidden. Here’s the code: <act:ModalPopupExtender ID="ModalPopupExtender1" TargetControlID="btnShow" PopupControlID="dialog" OkControlID="btnOK" DropShadow="true" BackgroundCssClass="modalBackground" runat="server"> <Animations> <OnShown> <Fadein /> </OnShown> <OnHiding> <Fadeout /> </OnHiding> </Animations> </act:ModalPopupExtender>     So that you can experience the full joy of this animated modal popup, I recorded the following video: Of course, you can use any of the animations supported by the Ajax Control Toolkit with the modal popup. The animation reference is located here: http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/Walkthrough/AnimationReference.aspx Fixes to the AsyncFileUpload In the May 2011 release, we also focused our energies on performing bug fixes for the AsyncFileUpload control. We fixed several major issues with the AsyncFileUpload including: It did not work in master pages It did not work when ClientIDMode=”Static” It did not work with Firefox 4 It did not work when multiple AsyncFileUploads were included in the same page It generated markup which was not HTML5 compatible The AsyncFileUpload control is a super useful control. It enables you to upload files in a form without performing a postback. Here’s some sample code which demonstrates how you can use the AsyncFileUpload: <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Simple.aspx.vb" Inherits="ACTSamples.Simple1" %> <%@ Register TagPrefix="act" Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit" %> <!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"> <title>Simple AsyncFileUpload</title> </head> <body> <form id="form1" runat="server"> <div> <act:ToolkitScriptManager ID="tsm" runat="server" /> User Name: <br /> <asp:TextBox ID="txtUserName" runat="server" /> <asp:RequiredFieldValidator EnableClientScript="false" ErrorMessage="Required" ControlToValidate="txtUserName" runat="server" /> <br /><br /> Avatar: <act:AsyncFileUpload ID="async1" ThrobberID="throbber" UploadingBackColor="yellow" ErrorBackColor="red" CompleteBackColor="green" UploaderStyle="Modern" PersistFile="true" runat="server" /> <asp:Image ID="throbber" ImageUrl="uploading.gif" style="display:none" runat="server" /> <br /><br /> <asp:Button ID="btnSubmit" Text="Submit" runat="server" /> </div> </form> </body> </html> And here’s the code-behind for the page above: Public Class Simple1 Inherits System.Web.UI.Page Private Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click If Page.IsValid Then ' Get Form Fields Dim userName As String Dim file As Byte() userName = txtUserName.Text If async1.HasFile Then file = async1.FileBytes End If ' Save userName, file to database ' Redirect to success page Response.Redirect("SimpleDone.aspx") End If End Sub End Class   The form above contains an AsyncFileUpload which has values for the following properties: ThrobberID – The ID of an element in the page to display while a file is being uploaded. UploadingBackColor – The color to display in the upload field while a file is being uploaded. ErrorBackColor – The color to display in the upload field when there is an error uploading a file. CompleteBackColor – The color to display in the upload field when the upload is complete. UploaderStyle – The user interface style: Traditional or Modern. PersistFile – When true, the uploaded file is persisted in Session state. The last property PersistFile, causes the uploaded file to be stored in Session state. That way, if completing a form requires multiple postbacks, then the user needs to upload the file only once. For example, if there is a server validation error, then the user is not required to re-upload the file after fixing the validation issue. In the sample code above, this condition is simulated by disabling client-side validation for the RequiredFieldValidator control. The RequiredFieldValidator EnableClientScript property has the value false. The following video demonstrates how the AsyncFileUpload control works: You can learn more about the properties and methods of the AsyncFileUpload control by visiting the following page: http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/AsyncFileUpload/AsyncFileUpload.aspx Conclusion In the May 2011 release of the Ajax Control Toolkit, we addressed over 30 bugs related to the ModalPopup and AsyncFileUpload controls. Furthermore, by building on code submitted by the community, we enhanced the ModalPopup control so that it supports animation (Thanks Dani). In our next sprint for the June release of the Ajax Control Toolkit, we plan to focus on the HTML Editor control. Subscribe to this blog to keep updated.

    Read the article

  • What's New in ASP.NET 4

    - by Navaneeth
    The .NET Framework version 4 includes enhancements for ASP.NET 4 in targeted areas. Visual Studio 2010 and Microsoft Visual Web Developer Express also include enhancements and new features for improved Web development. This document provides an overview of many of the new features that are included in the upcoming release. This topic contains the following sections: ASP.NET Core Services ASP.NET Web Forms ASP.NET MVC Dynamic Data ASP.NET Chart Control Visual Web Developer Enhancements Web Application Deployment with Visual Studio 2010 Enhancements to ASP.NET Multi-Targeting ASP.NET Core Services ASP.NET 4 introduces many features that improve core ASP.NET services such as output caching and session state storage. Extensible Output Caching Since the time that ASP.NET 1.0 was released, output caching has enabled developers to store the generated output of pages, controls, and HTTP responses in memory. On subsequent Web requests, ASP.NET can serve content more quickly by retrieving the generated output from memory instead of regenerating the output from scratch. However, this approach has a limitation — generated content always has to be stored in memory. On servers that experience heavy traffic, the memory requirements for output caching can compete with memory requirements for other parts of a Web application. ASP.NET 4 adds extensibility to output caching that enables you to configure one or more custom output-cache providers. Output-cache providers can use any storage mechanism to persist HTML content. These storage options can include local or remote disks, cloud storage, and distributed cache engines. Output-cache provider extensibility in ASP.NET 4 lets you design more aggressive and more intelligent output-caching strategies for Web sites. For example, you can create an output-cache provider that caches the "Top 10" pages of a site in memory, while caching pages that get lower traffic on disk. Alternatively, you can cache every vary-by combination for a rendered page, but use a distributed cache so that the memory consumption is offloaded from front-end Web servers. You create a custom output-cache provider as a class that derives from the OutputCacheProvider type. You can then configure the provider in the Web.config file by using the new providers subsection of the outputCache element For more information and for examples that show how to configure the output cache, see outputCache Element for caching (ASP.NET Settings Schema). For more information about the classes that support caching, see the documentation for the OutputCache and OutputCacheProvider classes. By default, in ASP.NET 4, all HTTP responses, rendered pages, and controls use the in-memory output cache. The defaultProvider attribute for ASP.NET is AspNetInternalProvider. You can change the default output-cache provider used for a Web application by specifying a different provider name for defaultProvider attribute. In addition, you can select different output-cache providers for individual control and for individual requests and programmatically specify which provider to use. For more information, see the HttpApplication.GetOutputCacheProviderName(HttpContext) method. The easiest way to choose a different output-cache provider for different Web user controls is to do so declaratively by using the new providerName attribute in a page or control directive, as shown in the following example: <%@ OutputCache Duration="60" VaryByParam="None" providerName="DiskCache" %> Preloading Web Applications Some Web applications must load large amounts of data or must perform expensive initialization processing before serving the first request. In earlier versions of ASP.NET, for these situations you had to devise custom approaches to "wake up" an ASP.NET application and then run initialization code during the Application_Load method in the Global.asax file. To address this scenario, a new application preload manager (autostart feature) is available when ASP.NET 4 runs on IIS 7.5 on Windows Server 2008 R2. The preload feature provides a controlled approach for starting up an application pool, initializing an ASP.NET application, and then accepting HTTP requests. It lets you perform expensive application initialization prior to processing the first HTTP request. For example, you can use the application preload manager to initialize an application and then signal a load-balancer that the application was initialized and ready to accept HTTP traffic. To use the application preload manager, an IIS administrator sets an application pool in IIS 7.5 to be automatically started by using the following configuration in the applicationHost.config file: <applicationPools> <add name="MyApplicationPool" startMode="AlwaysRunning" /> </applicationPools> Because a single application pool can contain multiple applications, you specify individual applications to be automatically started by using the following configuration in the applicationHost.config file: <sites> <site name="MySite" id="1"> <application path="/" serviceAutoStartEnabled="true" serviceAutoStartProvider="PrewarmMyCache" > <!-- Additional content --> </application> </site> </sites> <!-- Additional content --> <serviceAutoStartProviders> <add name="PrewarmMyCache" type="MyNamespace.CustomInitialization, MyLibrary" /> </serviceAutoStartProviders> When an IIS 7.5 server is cold-started or when an individual application pool is recycled, IIS 7.5 uses the information in the applicationHost.config file to determine which Web applications have to be automatically started. For each application that is marked for preload, IIS7.5 sends a request to ASP.NET 4 to start the application in a state during which the application temporarily does not accept HTTP requests. When it is in this state, ASP.NET instantiates the type defined by the serviceAutoStartProvider attribute (as shown in the previous example) and calls into its public entry point. You create a managed preload type that has the required entry point by implementing the IProcessHostPreloadClient interface, as shown in the following example: public class CustomInitialization : System.Web.Hosting.IProcessHostPreloadClient { public void Preload(string[] parameters) { // Perform initialization. } } After your initialization code runs in the Preload method and after the method returns, the ASP.NET application is ready to process requests. Permanently Redirecting a Page Content in Web applications is often moved over the lifetime of the application. This can lead to links to be out of date, such as the links that are returned by search engines. In ASP.NET, developers have traditionally handled requests to old URLs by using the Redirect method to forward a request to the new URL. However, the Redirect method issues an HTTP 302 (Found) response (which is used for a temporary redirect). This results in an extra HTTP round trip. ASP.NET 4 adds a RedirectPermanent helper method that makes it easy to issue HTTP 301 (Moved Permanently) responses, as in the following example: RedirectPermanent("/newpath/foroldcontent.aspx"); Search engines and other user agents that recognize permanent redirects will store the new URL that is associated with the content, which eliminates the unnecessary round trip made by the browser for temporary redirects. Session State Compression By default, ASP.NET provides two options for storing session state across a Web farm. The first option is a session state provider that invokes an out-of-process session state server. The second option is a session state provider that stores data in a Microsoft SQL Server database. Because both options store state information outside a Web application's worker process, session state has to be serialized before it is sent to remote storage. If a large amount of data is saved in session state, the size of the serialized data can become very large. ASP.NET 4 introduces a new compression option for both kinds of out-of-process session state providers. By using this option, applications that have spare CPU cycles on Web servers can achieve substantial reductions in the size of serialized session state data. You can set this option using the new compressionEnabled attribute of the sessionState element in the configuration file. When the compressionEnabled configuration option is set to true, ASP.NET compresses (and decompresses) serialized session state by using the .NET Framework GZipStreamclass. The following example shows how to set this attribute. <sessionState mode="SqlServer" sqlConnectionString="data source=dbserver;Initial Catalog=aspnetstate" allowCustomSqlDatabase="true" compressionEnabled="true" /> ASP.NET Web Forms Web Forms has been a core feature in ASP.NET since the release of ASP.NET 1.0. Many enhancements have been in this area for ASP.NET 4, such as the following: The ability to set meta tags. More control over view state. Support for recently introduced browsers and devices. Easier ways to work with browser capabilities. Support for using ASP.NET routing with Web Forms. More control over generated IDs. The ability to persist selected rows in data controls. More control over rendered HTML in the FormView and ListView controls. Filtering support for data source controls. Enhanced support for Web standards and accessibility Setting Meta Tags with the Page.MetaKeywords and Page.MetaDescription Properties Two properties have been added to the Page class: MetaKeywords and MetaDescription. These two properties represent corresponding meta tags in the HTML rendered for a page, as shown in the following example: <head id="Head1" runat="server"> <title>Untitled Page</title> <meta name="keywords" content="keyword1, keyword2' /> <meta name="description" content="Description of my page" /> </head> These two properties work like the Title property does, and they can be set in the @ Page directive. For more information, see Page.MetaKeywords and Page.MetaDescription. Enabling View State for Individual Controls A new property has been added to the Control class: ViewStateMode. You can use this property to disable view state for all controls on a page except those for which you explicitly enable view state. View state data is included in a page's HTML and increases the amount of time it takes to send a page to the client and post it back. Storing more view state than is necessary can cause significant decrease in performance. In earlier versions of ASP.NET, you could reduce the impact of view state on a page's performance by disabling view state for specific controls. But sometimes it is easier to enable view state for a few controls that need it instead of disabling it for many that do not need it. For more information, see Control.ViewStateMode. Support for Recently Introduced Browsers and Devices ASP.NET includes a feature that is named browser capabilities that lets you determine the capabilities of the browser that a user is using. Browser capabilities are represented by the HttpBrowserCapabilities object which is stored in the HttpRequest.Browser property. Information about a particular browser's capabilities is defined by a browser definition file. In ASP.NET 4, these browser definition files have been updated to contain information about recently introduced browsers and devices such as Google Chrome, Research in Motion BlackBerry smart phones, and Apple iPhone. Existing browser definition files have also been updated. For more information, see How to: Upgrade an ASP.NET Web Application to ASP.NET 4 and ASP.NET Web Server Controls and Browser Capabilities. The browser definition files that are included with ASP.NET 4 are shown in the following list: •blackberry.browser •chrome.browser •Default.browser •firefox.browser •gateway.browser •generic.browser •ie.browser •iemobile.browser •iphone.browser •opera.browser •safari.browser A New Way to Define Browser Capabilities ASP.NET 4 includes a new feature referred to as browser capabilities providers. As the name suggests, this lets you build a provider that in turn lets you write custom code to determine browser capabilities. In ASP.NET version 3.5 Service Pack 1, you define browser capabilities in an XML file. This file resides in a machine-level folder or an application-level folder. Most developers do not need to customize these files, but for those who do, the provider approach can be easier than dealing with complex XML syntax. The provider approach makes it possible to simplify the process by implementing a common browser definition syntax, or a database that contains up-to-date browser definitions, or even a Web service for such a database. For more information about the new browser capabilities provider, see the What's New for ASP.NET 4 White Paper. Routing in ASP.NET 4 ASP.NET 4 adds built-in support for routing with Web Forms. Routing is a feature that was introduced with ASP.NET 3.5 SP1 and lets you configure an application to use URLs that are meaningful to users and to search engines because they do not have to specify physical file names. This can make your site more user-friendly and your site content more discoverable by search engines. For example, the URL for a page that displays product categories in your application might look like the following example: http://website/products.aspx?categoryid=12 By using routing, you can use the following URL to render the same information: http://website/products/software The second URL lets the user know what to expect and can result in significantly improved rankings in search engine results. the new features include the following: The PageRouteHandler class is a simple HTTP handler that you use when you define routes. You no longer have to write a custom route handler. The HttpRequest.RequestContext and Page.RouteData properties make it easier to access information that is passed in URL parameters. The RouteUrl expression provides a simple way to create a routed URL in markup. The RouteValue expression provides a simple way to extract URL parameter values in markup. The RouteParameter class makes it easier to pass URL parameter values to a query for a data source control (similar to FormParameter). You no longer have to change the Web.config file to enable routing. For more information about routing, see the following topics: ASP.NET Routing Walkthrough: Using ASP.NET Routing in a Web Forms Application How to: Define Routes for Web Forms Applications How to: Construct URLs from Routes How to: Access URL Parameters in a Routed Page Setting Client IDs The new ClientIDMode property makes it easier to write client script that references HTML elements rendered for server controls. Increasing use of Microsoft Ajax makes the need to do this more common. For example, you may have a data control that renders a long list of products with prices and you want to use client script to make a Web service call and update individual prices in the list as they change without refreshing the entire page. Typically you get a reference to an HTML element in client script by using the document.GetElementById method. You pass to this method the value of the id attribute of the HTML element you want to reference. In the case of elements that are rendered for ASP.NET server controls earlier versions of ASP.NET could make this difficult or impossible. You were not always able to predict what id values ASP.NET would generate, or ASP.NET could generate very long id values. The problem was especially difficult for data controls that would generate multiple rows for a single instance of the control in your markup. ASP.NET 4 adds two new algorithms for generating id attributes. These algorithms can generate id attributes that are easier to work with in client script because they are more predictable and that are easier to work with because they are simpler. For more information about how to use the new algorithms, see the following topics: ASP.NET Web Server Control Identification Walkthrough: Making Data-Bound Controls Easier to Access from JavaScript Walkthrough: Making Controls Located in Web User Controls Easier to Access from JavaScript How to: Access Controls from JavaScript by ID Persisting Row Selection in Data Controls The GridView and ListView controls enable users to select a row. In previous versions of ASP.NET, row selection was based on the row index on the page. For example, if you select the third item on page 1 and then move to page 2, the third item on page 2 is selected. In most cases, is more desirable not to select any rows on page 2. ASP.NET 4 supports Persisted Selection, a new feature that was initially supported only in Dynamic Data projects in the .NET Framework 3.5 SP1. When this feature is enabled, the selected item is based on the row data key. This means that if you select the third row on page 1 and move to page 2, nothing is selected on page 2. When you move back to page 1, the third row is still selected. This is a much more natural behavior than the behavior in earlier versions of ASP.NET. Persisted selection is now supported for the GridView and ListView controls in all projects. You can enable this feature in the GridView control, for example, by setting the EnablePersistedSelection property, as shown in the following example: <asp:GridView id="GridView2" runat="server" PersistedSelection="true"> </asp:GridView> FormView Control Enhancements The FormView control is enhanced to make it easier to style the content of the control with CSS. In previous versions of ASP.NET, the FormView control rendered it contents using an item template. This made styling more difficult in the markup because unexpected table row and table cell tags were rendered by the control. The FormView control supports RenderOuterTable, a property in ASP.NET 4. When this property is set to false, as show in the following example, the table tags are not rendered. This makes it easier to apply CSS style to the contents of the control. <asp:FormView ID="FormView1" runat="server" RenderTable="false"> For more information, see FormView Web Server Control Overview. ListView Control Enhancements The ListView control, which was introduced in ASP.NET 3.5, has all the functionality of the GridView control while giving you complete control over the output. This control has been made easier to use in ASP.NET 4. The earlier version of the control required that you specify a layout template that contained a server control with a known ID. The following markup shows a typical example of how to use the ListView control in ASP.NET 3.5. <asp:ListView ID="ListView1" runat="server"> <LayoutTemplate> <asp:PlaceHolder ID="ItemPlaceHolder" runat="server"></asp:PlaceHolder> </LayoutTemplate> <ItemTemplate> <% Eval("LastName")%> </ItemTemplate> </asp:ListView> In ASP.NET 4, the ListView control does not require a layout template. The markup shown in the previous example can be replaced with the following markup: <asp:ListView ID="ListView1" runat="server"> <ItemTemplate> <% Eval("LastName")%> </ItemTemplate> </asp:ListView> For more information, see ListView Web Server Control Overview. Filtering Data with the QueryExtender Control A very common task for developers who create data-driven Web pages is to filter data. This traditionally has been performed by building Where clauses in data source controls. This approach can be complicated, and in some cases the Where syntax does not let you take advantage of the full functionality of the underlying database. To make filtering easier, a new QueryExtender control has been added in ASP.NET 4. This control can be added to EntityDataSource or LinqDataSource controls in order to filter the data returned by these controls. Because the QueryExtender control relies on LINQ, but you do not to need to know how to write LINQ queries to use the query extender. The QueryExtender control supports a variety of filter options. The following lists QueryExtender filter options. Term Definition SearchExpression Searches a field or fields for string values and compares them to a specified string value. RangeExpression Searches a field or fields for values in a range specified by a pair of values. PropertyExpression Compares a specified value to a property value in a field. If the expression evaluates to true, the data that is being examined is returned. OrderByExpression Sorts data by a specified column and sort direction. CustomExpression Calls a function that defines custom filter in the page. For more information, see QueryExtenderQueryExtender Web Server Control Overview. Enhanced Support for Web Standards and Accessibility Earlier versions of ASP.NET controls sometimes render markup that does not conform to HTML, XHTML, or accessibility standards. ASP.NET 4 eliminates most of these exceptions. For details about how the HTML that is rendered by each control meets accessibility standards, see ASP.NET Controls and Accessibility. CSS for Controls that Can be Disabled In ASP.NET 3.5, when a control is disabled (see WebControl.Enabled), a disabled attribute is added to the rendered HTML element. For example, the following markup creates a Label control that is disabled: <asp:Label id="Label1" runat="server"   Text="Test" Enabled="false" /> In ASP.NET 3.5, the previous control settings generate the following HTML: <span id="Label1" disabled="disabled">Test</span> In HTML 4.01, the disabled attribute is not considered valid on span elements. It is valid only on input elements because it specifies that they cannot be accessed. On display-only elements such as span elements, browsers typically support rendering for a disabled appearance, but a Web page that relies on this non-standard behavior is not robust according to accessibility standards. For display-only elements, you should use CSS to indicate a disabled visual appearance. Therefore, by default ASP.NET 4 generates the following HTML for the control settings shown previously: <span id="Label1" class="aspNetDisabled">Test</span> You can change the value of the class attribute that is rendered by default when a control is disabled by setting the DisabledCssClass property. CSS for Validation Controls In ASP.NET 3.5, validation controls render a default color of red as an inline style. For example, the following markup creates a RequiredFieldValidator control: <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"   ErrorMessage="Required Field" ControlToValidate="RadioButtonList1" /> ASP.NET 3.5 renders the following HTML for the validator control: <span id="RequiredFieldValidator1"   style="color:Red;visibility:hidden;">RequiredFieldValidator</span> By default, ASP.NET 4 does not render an inline style to set the color to red. An inline style is used only to hide or show the validator, as shown in the following example: <span id="RequiredFieldValidator1"   style"visibility:hidden;">RequiredFieldValidator</span> Therefore, ASP.NET 4 does not automatically show error messages in red. For information about how to use CSS to specify a visual style for a validation control, see Validating User Input in ASP.NET Web Pages. CSS for the Hidden Fields Div Element ASP.NET uses hidden fields to store state information such as view state and control state. These hidden fields are contained by a div element. In ASP.NET 3.5, this div element does not have a class attribute or an id attribute. Therefore, CSS rules that affect all div elements could unintentionally cause this div to be visible. To avoid this problem, ASP.NET 4 renders the div element for hidden fields with a CSS class that you can use to differentiate the hidden fields div from others. The new classvalue is shown in the following example: <div class="aspNetHidden"> CSS for the Table, Image, and ImageButton Controls By default, in ASP.NET 3.5, some controls set the border attribute of rendered HTML to zero (0). The following example shows HTML that is generated by the Table control in ASP.NET 3.5: <table id="Table2" border="0"> The Image control and the ImageButton control also do this. Because this is not necessary and provides visual formatting information that should be provided by using CSS, the attribute is not generated in ASP.NET 4. CSS for the UpdatePanel and UpdateProgress Controls In ASP.NET 3.5, the UpdatePanel and UpdateProgress controls do not support expando attributes. This makes it impossible to set a CSS class on the HTMLelements that they render. In ASP.NET 4 these controls have been changed to accept expando attributes, as shown in the following example: <asp:UpdatePanel runat="server" class="myStyle"> </asp:UpdatePanel> The following HTML is rendered for this markup: <div id="ctl00_MainContent_UpdatePanel1" class="expandoclass"> </div> Eliminating Unnecessary Outer Tables In ASP.NET 3.5, the HTML that is rendered for the following controls is wrapped in a table element whose purpose is to apply inline styles to the entire control: FormView Login PasswordRecovery ChangePassword If you use templates to customize the appearance of these controls, you can specify CSS styles in the markup that you provide in the templates. In that case, no extra outer table is required. In ASP.NET 4, you can prevent the table from being rendered by setting the new RenderOuterTable property to false. Layout Templates for Wizard Controls In ASP.NET 3.5, the Wizard and CreateUserWizard controls generate an HTML table element that is used for visual formatting. In ASP.NET 4 you can use a LayoutTemplate element to specify the layout. If you do this, the HTML table element is not generated. In the template, you create placeholder controls to indicate where items should be dynamically inserted into the control. (This is similar to how the template model for the ListView control works.) For more information, see the Wizard.LayoutTemplate property. New HTML Formatting Options for the CheckBoxList and RadioButtonList Controls ASP.NET 3.5 uses HTML table elements to format the output for the CheckBoxList and RadioButtonList controls. To provide an alternative that does not use tables for visual formatting, ASP.NET 4 adds two new options to the RepeatLayout enumeration: UnorderedList. This option causes the HTML output to be formatted by using ul and li elements instead of a table. OrderedList. This option causes the HTML output to be formatted by using ol and li elements instead of a table. For examples of HTML that is rendered for the new options, see the RepeatLayout enumeration. Header and Footer Elements for the Table Control In ASP.NET 3.5, the Table control can be configured to render thead and tfoot elements by setting the TableSection property of the TableHeaderRow class and the TableFooterRow class. In ASP.NET 4 these properties are set to the appropriate values by default. CSS and ARIA Support for the Menu Control In ASP.NET 3.5, the Menu control uses HTML table elements for visual formatting, and in some configurations it is not keyboard-accessible. ASP.NET 4 addresses these problems and improves accessibility in the following ways: The generated HTML is structured as an unordered list (ul and li elements). CSS is used for visual formatting. The menu behaves in accordance with ARIA standards for keyboard access. You can use arrow keys to navigate menu items. (For information about ARIA, see Accessibility in Visual Studio and ASP.NET.) ARIA role and property attributes are added to the generated HTML. (Attributes are added by using JavaScript instead of included in the HTML, to avoid generating HTML that would cause markup validation errors.) Styles for the Menu control are rendered in a style block at the top of the page, instead of inline with the rendered HTML elements. If you want to use a separate CSS file so that you can modify the menu styles, you can set the Menu control's new IncludeStyleBlock property to false, in which case the style block is not generated. Valid XHTML for the HtmlForm Control In ASP.NET 3.5, the HtmlForm control (which is created implicitly by the <form runat="server"> tag) renders an HTML form element that has both name and id attributes. The name attribute is deprecated in XHTML 1.1. Therefore, this control does not render the name attribute in ASP.NET 4. Maintaining Backward Compatibility in Control Rendering An existing ASP.NET Web site might have code in it that assumes that controls are rendering HTML the way they do in ASP.NET 3.5. To avoid causing backward compatibility problems when you upgrade the site to ASP.NET 4, you can have ASP.NET continue to generate HTML the way it does in ASP.NET 3.5 after you upgrade the site. To do so, you can set the controlRenderingCompatibilityVersion attribute of the pages element to "3.5" in the Web.config file of an ASP.NET 4 Web site, as shown in the following example: <system.web>   <pages controlRenderingCompatibilityVersion="3.5"/> </system.web> If this setting is omitted, the default value is the same as the version of ASP.NET that the Web site targets. (For information about multi-targeting in ASP.NET, see .NET Framework Multi-Targeting for ASP.NET Web Projects.) ASP.NET MVC ASP.NET MVC helps Web developers build compelling standards-based Web sites that are easy to maintain because it decreases the dependency among application layers by using the Model-View-Controller (MVC) pattern. MVC provides complete control over the page markup. It also improves testability by inherently supporting Test Driven Development (TDD). Web sites created using ASP.NET MVC have a modular architecture. This allows members of a team to work independently on the various modules and can be used to improve collaboration. For example, developers can work on the model and controller layers (data and logic), while the designer work on the view (presentation). For tutorials, walkthroughs, conceptual content, code samples, and a complete API reference, see ASP.NET MVC 2. Dynamic Data Dynamic Data was introduced in the .NET Framework 3.5 SP1 release in mid-2008. This feature provides many enhancements for creating data-driven applications, such as the following: A RAD experience for quickly building a data-driven Web site. Automatic validation that is based on constraints defined in the data model. The ability to easily change the markup that is generated for fields in the GridView and DetailsView controls by using field templates that are part of your Dynamic Data project. For ASP.NET 4, Dynamic Data has been enhanced to give developers even more power for quickly building data-driven Web sites. For more information, see ASP.NET Dynamic Data Content Map. Enabling Dynamic Data for Individual Data-Bound Controls in Existing Web Applications You can use Dynamic Data features in existing ASP.NET Web applications that do not use scaffolding by enabling Dynamic Data for individual data-bound controls. Dynamic Data provides the presentation and data layer support for rendering these controls. When you enable Dynamic Data for data-bound controls, you get the following benefits: Setting default values for data fields. Dynamic Data enables you to provide default values at run time for fields in a data control. Interacting with the database without creating and registering a data model. Automatically validating the data that is entered by the user without writing any code. For more information, see Walkthrough: Enabling Dynamic Data in ASP.NET Data-Bound Controls. New Field Templates for URLs and E-mail Addresses ASP.NET 4 introduces two new built-in field templates, EmailAddress.ascx and Url.ascx. These templates are used for fields that are marked as EmailAddress or Url using the DataTypeAttribute attribute. For EmailAddress objects, the field is displayed as a hyperlink that is created by using the mailto: protocol. When users click the link, it opens the user's e-mail client and creates a skeleton message. Objects typed as Url are displayed as ordinary hyperlinks. The following example shows how to mark fields. [DataType(DataType.EmailAddress)] public object HomeEmail { get; set; } [DataType(DataType.Url)] public object Website { get; set; } Creating Links with the DynamicHyperLink Control Dynamic Data uses the new routing feature that was added in the .NET Framework 3.5 SP1 to control the URLs that users see when they access the Web site. The new DynamicHyperLink control makes it easy to build links to pages in a Dynamic Data site. For information, see How to: Create Table Action Links in Dynamic Data Support for Inheritance in the Data Model Both the ADO.NET Entity Framework and LINQ to SQL support inheritance in their data models. An example of this might be a database that has an InsurancePolicy table. It might also contain CarPolicy and HousePolicy tables that have the same fields as InsurancePolicy and then add more fields. Dynamic Data has been modified to understand inherited objects in the data model and to support scaffolding for the inherited tables. For more information, see Walkthrough: Mapping Table-per-Hierarchy Inheritance in Dynamic Data. Support for Many-to-Many Relationships (Entity Framework Only) The Entity Framework has rich support for many-to-many relationships between tables, which is implemented by exposing the relationship as a collection on an Entity object. New field templates (ManyToMany.ascx and ManyToMany_Edit.ascx) have been added to provide support for displaying and editing data that is involved in many-to-many relationships. For more information, see Working with Many-to-Many Data Relationships in Dynamic Data. New Attributes to Control Display and Support Enumerations The DisplayAttribute has been added to give you additional control over how fields are displayed. The DisplayNameAttribute attribute in earlier versions of Dynamic Data enabled you to change the name that is used as a caption for a field. The new DisplayAttribute class lets you specify more options for displaying a field, such as the order in which a field is displayed and whether a field will be used as a filter. The attribute also provides independent control of the name that is used for the labels in a GridView control, the name that is used in a DetailsView control, the help text for the field, and the watermark used for the field (if the field accepts text input). The EnumDataTypeAttribute class has been added to let you map fields to enumerations. When you apply this attribute to a field, you specify an enumeration type. Dynamic Data uses the new Enumeration.ascx field template to create UI for displaying and editing enumeration values. The template maps the values from the database to the names in the enumeration. Enhanced Support for Filters Dynamic Data 1.0 had built-in filters for Boolean columns and foreign-key columns. The filters did not let you specify the order in which they were displayed. The new DisplayAttribute attribute addresses this by giving you control over whether a column appears as a filter and in what order it will be displayed. An additional enhancement is that filtering support has been rewritten to use the new QueryExtender feature of Web Forms. This lets you create filters without requiring knowledge of the data source control that the filters will be used with. Along with these extensions, filters have also been turned into template controls, which lets you add new ones. Finally, the DisplayAttribute class mentioned earlier allows the default filter to be overridden, in the same way that UIHint allows the default field template for a column to be overridden. For more information, see Walkthrough: Filtering Rows in Tables That Have a Parent-Child Relationship and QueryableFilterRepeater. ASP.NET Chart Control The ASP.NET chart server control enables you to create ASP.NET pages applications that have simple, intuitive charts for complex statistical or financial analysis. The chart control supports the following features: Data series, chart areas, axes, legends, labels, titles, and more. Data binding. Data manipulation, such as copying, splitting, merging, alignment, grouping, sorting, searching, and filtering. Statistical formulas and financial formulas. Advanced chart appearance, such as 3-D, anti-aliasing, lighting, and perspective. Events and customizations. Interactivity and Microsoft Ajax. Support for the Ajax Content Delivery Network (CDN), which provides an optimized way for you to add Microsoft Ajax Library and jQuery scripts to your Web applications. For more information, see Chart Web Server Control Overview. Visual Web Developer Enhancements The following sections provide information about enhancements and new features in Visual Studio 2010 and Visual Web Developer Express. The Web page designer in Visual Studio 2010 has been enhanced for better CSS compatibility, includes additional support for HTML and ASP.NET markup snippets, and features a redesigned version of IntelliSense for JScript. Improved CSS Compatibility The Visual Web Developer designer in Visual Studio 2010 has been updated to improve CSS 2.1 standards compliance. The designer better preserves HTML source code and is more robust than in previous versions of Visual Studio. HTML and JScript Snippets In the HTML editor, IntelliSense auto-completes tag names. The IntelliSense Snippets feature auto-completes whole tags and more. In Visual Studio 2010, IntelliSense snippets are supported for JScript, alongside C# and Visual Basic, which were supported in earlier versions of Visual Studio. Visual Studio 2010 includes over 200 snippets that help you auto-complete common ASP.NET and HTML tags, including required attributes (such as runat="server") and common attributes specific to a tag (such as ID, DataSourceID, ControlToValidate, and Text). You can download additional snippets, or you can write your own snippets that encapsulate the blocks of markup that you or your team use for common tasks. For more information on HTML snippets, see Walkthrough: Using HTML Snippets. JScript IntelliSense Enhancements In Visual 2010, JScript IntelliSense has been redesigned to provide an even richer editing experience. IntelliSense now recognizes objects that have been dynamically generated by methods such as registerNamespace and by similar techniques used by other JavaScript frameworks. Performance has been improved to analyze large libraries of script and to display IntelliSense with little or no processing delay. Compatibility has been significantly increased to support almost all third-party libraries and to support diverse coding styles. Documentation comments are now parsed as you type and are immediately leveraged by IntelliSense. Web Application Deployment with Visual Studio 2010 For Web application projects, Visual Studio now provides tools that work with the IIS Web Deployment Tool (Web Deploy) to automate many processes that had to be done manually in earlier versions of ASP.NET. For example, the following tasks can now be automated: Creating an IIS application on the destination computer and configuring IIS settings. Copying files to the destination computer. Changing Web.config settings that must be different in the destination environment. Propagating changes to data or data structures in SQL Server databases that are used by the Web application. For more information about Web application deployment, see ASP.NET Deployment Content Map. Enhancements to ASP.NET Multi-Targeting ASP.NET 4 adds new features to the multi-targeting feature to make it easier to work with projects that target earlier versions of the .NET Framework. Multi-targeting was introduced in ASP.NET 3.5 to enable you to use the latest version of Visual Studio without having to upgrade existing Web sites or Web services to the latest version of the .NET Framework. In Visual Studio 2008, when you work with a project targeted for an earlier version of the .NET Framework, most features of the development environment adapt to the targeted version. However, IntelliSense displays language features that are available in the current version, and property windows display properties available in the current version. In Visual Studio 2010, only language features and properties available in the targeted version of the .NET Framework are shown. For more information about multi-targeting, see the following topics: .NET Framework Multi-Targeting for ASP.NET Web Projects ASP.NET Side-by-Side Execution Overview How to: Host Web Applications That Use Different Versions of the .NET Framework on the Same Server How to: Deploy Web Site Projects Targeted for Earlier Versions of the .NET Framework

    Read the article

  • can't get jquery livequery to with an update panel

    - by Jeremy
    I have some basic html inside an asp.net update panel. Using livequery, I set up autocomplete, blur and keydown events so that they all continue to be wired up after the update panel does a partial page load. When the page initially loads, all the events work fine but after the update panel does a partial page reload, none of the events wired up with livequery continue to work. Are there known issues with livequery and update panels? Html: <asp:UpdatePanel ID="upData" runat="server" UpdateMode="Conditional"> <ContentTemplate> <asp:DataList ID="dlData" runat="server" DataSource='<%# this.Data %>' DataKeyField="ID"> <ItemTemplate> <table> <tr> <th class="required">Location</th> <td><asp:TextBox ID="txtFromLocation" MaxLength="10" CssClass="searchlocation fromlocation required" runat="server" Text='<%# Eval("FromLocation")%>'/><asp:RequiredFieldValidator ID="rvalFromLocation" runat="server" ControlToValidate="txtFromLocation" ValidationGroup="leg">*</asp:RequiredFieldValidator></td> </tr> </table> </ItemTemplate> </asp:DataList> </ContentTemplate> </asp:UpdatePanel> And then I have my javascript. Normally it has a bunch of other code, but I can reduce it down to this and still have the problem: $(document).ready(function() { $(".searchlocation").livequery(function() { $(this).keydown(function(event) {alert('test');}); }); });

    Read the article

  • why can't asp.net find my textbox?

    - by phunehehe
    Hello, I'm trying to add more fields to the CreateUserWizardStep, here is what I added: <asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server"> <ContentTemplate> <table border="0"> <tr> <td align="right"> <asp:Label ID="NickNameLabel" runat="server" AssociatedControlID="NickName">Nick Name:</asp:Label> </td> <td> <asp:TextBox ID="NickName" runat="server"></asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="NickName" ErrorMessage="Nick Name is required." ToolTip="Nick Name is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator> </td> </tr> <%-- The default code is left unchanged, but not shown here --%> </table> </ContentTemplate> </asp:CreateUserWizardStep> Then I tried to reference the objects like this protected void NewUserWizard_CreatedUser(object sender, EventArgs e) { CreateUserWizardStep step = NewUserWizard.FindControl("CreateUserWizardStep1") as CreateUserWizardStep; TextBox nickName= step.FindControl("NickName") as TextBox; // insert additional information to the database } The problem is, I'm getting nulls for nickName. Am I using FindControl("") incorrectly?

    Read the article

  • Calling server side method as filling value inside a textbox from calendar extender

    - by Dharmendra Singh
    I have a text box which i m filling of date from the calendar extender and the code is as below:- <label for="input-one" class="float"><strong>Date</strong></label><br /> <asp:TextBox ID="txtDate" runat="server" CssClass="inp-text" Enabled="false" AutoPostBack="true" Width="300px" ontextchanged="txtDate_TextChanged"></asp:TextBox> <asp:ImageButton ID="btnDate2" runat="server" AlternateText="cal2" ImageUrl="~/App_Themes/Images/icon_calendar.jpg" style="margin-top:auto;" CausesValidation="false" onclick="btnDate2_Click" /> <ajaxToolkit:CalendarExtender ID="calExtender2" runat="server" Format="dddd, MMMM dd, yyyy" OnClientDateSelectionChanged="CheckDateEalier" PopupButtonID="btnDate2" TargetControlID="txtDate" /> <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ControlToValidate="txtDate" ErrorMessage="Select a Date" Font-Bold="True" Font-Size="X-Small" ForeColor="Red"></asp:RequiredFieldValidator><br /> Javascript code is :- function CheckDateEalier(sender, args) { sender._textbox.set_Value(sender._selectedDate.format(sender._format)) } My requirement is that as the date is entered in to the textbox, I want to call this method: public void TimeSpentDisplay() { string date = txtDate.Text.ToString(); DateTime dateparsed = DateTime.ParseExact(date, "dddd, MMMM dd, yyyy", null); DateTime currentDate = System.DateTime.Now; if (dateparsed.Date > currentDate.Date) { divtimeSpent.Visible = true; } if (dateparsed.Date < currentDate.Date) { divtimeSpent.Visible = true; } if (dateparsed.Date == currentDate.Date) { divtimeSpent.Visible = false; } } Please help me that how i achieve this as i m calling this method inside txtDate_TextChanged method but the event is not firing as the text is changed inside the textbox. Please suggest how I can achieve this or give me an alternate idea to fulfill my requirement.

    Read the article

  • validation control unable to find its control to validate

    - by nat
    i have a repeater that is bound to a number of custom dataitems/types on the itemdatabound event for the repeater the code calls a renderedit function that depending on the custom datatype will render a custom control. it will also (if validation flag is set) render a validation control for the appropriate rendered edit control the edit control overrides the CreateChildControls() method for the custom control adding a number of literalControls thus protected override void CreateChildControls() { //other bits removed - but it is this 'hidden' control i am trying to validate this.Controls.Add(new LiteralControl(string.Format( "<input type=\"text\" name=\"{0}\" id=\"{0}\" value=\"{1}\" style=\"display:none;\" \">" , this.UniqueID , this.MediaId.ToString()) )); //some other bits removed } the validation control is rendered like this: where the passed in editcontrol is the control instance of which the above createchildcontrols is a method of.. public override Control RenderValidationControl(Control editControl) { Control ctrl = new PlaceHolder(); RequiredFieldValidator req = new RequiredFieldValidator(); req.ID = editControl.ClientID + "_validator"; req.ControlToValidate = editControl.UniqueID; req.Display = ValidatorDisplay.Dynamic; req.InitialValue = "0"; req.ErrorMessage = this.Caption + " cannot be blank"; ctrl.Controls.Add(req); return ctrl; } the problem is, altho the validation controls .ControlToValidate property is set to the uniqueid of the editcontrol. when i hit the page i get the following error: Unable to find control id 'FieldRepeater$ctl01$ctl00' referenced by the 'ControlToValidate' property of 'FieldRepeater_ctl01_ctl00_validator'. i have tried changing the literal in the createchildcontrols to a new TextBox(), and then set the id etc then, but i get a similar problem. can anyone enlighten me? is this because of the order the controls are rendered in? ie the validation control is written before the editcontrol? or... anyhow any help much appreciated thanks nat

    Read the article

  • ASP.NET validators alignment issue

    - by Mahesh
    Hi, I am developing contactus webpage which have a input field called Email. It is validated against a required field validator and regular expression validator with appropriate messages. Required: Enter Email Regular Expression: Invalid Email I am setting these two as given below: <asp:TextBox ID="txtEmail" runat="server"></asp:TextBox> <font color="#FF0000">*</font> <asp:RequiredFieldValidator ID="rfvemail" CssClass="error_text" ControlToValidate="txtEmail" runat="server" ErrorMessage="Enter email address."></asp:RequiredFieldValidator> <asp:RegularExpressionValidator ID="revemail" runat="server" ControlToValidate="txtEmail" ErrorMessage="Invalid Email" ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator> My problem is both Enter Email and Invalid Email is occupying its own space. For Ex: If I leave email as empty space and press submit, Enter Email is displaying right next to it. If I enter invalid email(xxx), Enter Email is off but taking the space, Invalid Email message is displayed after these space taken by 'Enter Email' before. Is there any way to remove this space?? Mahesh

    Read the article

  • How do you reenable a validation control w/o it simultaneously performing an immediate validation?

    - by Velika2
    When I called this function to enable a validator from client javascript: `ValidatorEnable(document.getElementById('<%=valPassportOtherText.ClientID%>'), true); //enable` validation control the required validation control immediately performed it validation, found the value in the associated text box blank and set focus to the textbox (because SetFocusOnError was set to true). As a result, the side effect was that focus was shifted to the control that was associated with the Validation control, i teh example, txtSpecifyOccupation. <asp:TextBox ID="txtSpecifyOccupation" runat="server" AutoCompleteType="Disabled" CssClass="DefaultTextBox DefaultWidth" MaxLength="24" Rows="2"></asp:TextBox> <asp:RequiredFieldValidator ID="valSpecifyOccupation" runat="server" ControlToValidate="txtSpecifyOccupation" ErrorMessage="1.14b Please specify your &lt;b&gt;Occupation&lt;/b&gt;" SetFocusOnError="True">&nbsp;Required</asp:RequiredFieldValidator> Perhaps there is a way to enable the (required) validator without having it simultaneously perform the validation (at least until the user has tabbed off of it?) I'd like validation of the txtSpecifyOccupation textbox to occur only on a Page submit or when the user has tabbed of the required txtSpecifyoccupation textbox. How can I achieve this?

    Read the article

  • Keep width even when column changes. (HTML)

    - by Andrew
    I have a login on the left sidebar of my website. When a user is logged in, the sidebar width doesn't remain the same as it was when the user wasn't logged in. Is there a way to keep the width the same? <!-- Start Sidebar --> <td id="sidebar" valign="top" height="400px" style="width: 200px"> <!-- Login Form --> <table id="TABLE2"> <tr> <td valign="top"> <asp:LoginView ID="LoginView1" runat="server"> <LoggedInTemplate> <br /> <br /> You are currently logged in. </LoggedInTemplate> <AnonymousTemplate> <asp:Login ID="Login1" runat="server" BorderPadding="0" BorderStyle="None" BorderWidth="0px" Font-Names="Verdana" Font-Size="0.8em" CreateUserText="Sign Up Now!" CreateUserUrl="http://www.tiltonindustries.com/Tilton/Login/CreateAccount.aspx" Height="1px" PasswordRecoveryText="Forgot your password?" PasswordRecoveryUrl="http://www.tiltonindustries.com/Tilton/Login/ForgotPassword.aspx" TextLayout="TextOnTop" Width="200px" DestinationPageUrl="http://www.tiltonindustries.com/Tilton/default.aspx"> <TitleTextStyle Font-Bold="True" Font-Size="0.9em"/> <InstructionTextStyle Font-Italic="True" ForeColor="Black" /> <TextBoxStyle Font-Size="0.8em" /> <LoginButtonStyle BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" Font-Size="0.8em" ForeColor="#990000" /> <LayoutTemplate> <table border="0" cellpadding="4" cellspacing="0" style="border-collapse: collapse; height: 159px;"> <tr> <td style="height: 176px; width: 135px;"> <table border="0" cellpadding="0" style="width: 219px; height: 1px" id="TABLE1"> <tr> <td align="center" style="font-weight: bold; font-size: 0.9em; color: white; height: 18px; background-color: #990000; text-align: center" colspan="2"> Log In</td> </tr> <tr> <td style="width: 94px; height: 10px;"> </td> <td style="height: 10px; width: 78px;"> </td> </tr> <tr> <td style="width: 94px; height: 20px; text-align: right"> <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">User Name:</asp:Label> &nbsp; </td> <td style="height: 20px; text-align: left; width: 78px;"> <asp:TextBox ID="UserName" runat="server" Font-Size="0.9em" EnableViewState="False" Width="100px" MaxLength="20"></asp:TextBox><asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName" ErrorMessage="User Name is required." ToolTip="User Name is required." ValidationGroup="ctl01$Login1">*</asp:RequiredFieldValidator></td> </tr> <tr> <td style="width: 94px; text-align: right"> <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label> &nbsp; </td> <td style="text-align: left; width: 78px;"> <asp:TextBox ID="Password" runat="server" Font-Size="0.9em" TextMode="Password" Width="100px"></asp:TextBox><asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password" ErrorMessage="Password is required." ToolTip="Password is required." ValidationGroup="ctl01$Login1">*</asp:RequiredFieldValidator></td> </tr> <tr> <td style="height: 20px; width: 94px;"> &nbsp;</td> <td style="height: 20px; text-align: left; width: 78px;"> <asp:CheckBox ID="chkRememberMe" runat="server" Text="Remember Me" Width="104px" /></td> </tr> <tr> <td align="center" style="color: red; width: 94px; height: 20px;"> </td> <td align="center" style="color: red; text-align: left; width: 78px; height: 20px;"> <asp:Button ID="LoginButton" runat="server" BorderStyle="Solid" BorderWidth="1px" CommandName="Login" Font-Names="Verdana" Font-Size="1.0 em" Text="Log In" ValidationGroup="ctl01$Login1" Width="59px" BackColor="Gray" BorderColor="Black" Height="20px" /></td> </tr> <tr> <td align="center" style="width: 250px; color: red; height: 35px; text-align: center;" colspan="2"> <asp:Literal ID="FailureText" runat="server" EnableViewState="False"></asp:Literal></td> </tr> <tr> <td style="height: 26px; width: 94px;"> <asp:HyperLink ID="CreateUserLink" runat="server" NavigateUrl="http://www.tiltonindustries.com/Tilton/Login/CreateAccount.aspx">Sign Up Now!</asp:HyperLink>&nbsp; </td> <td style="width: 78px; height: 26px"> <asp:HyperLink ID="PasswordRecoveryLink" runat="server" NavigateUrl="http://www.tiltonindustries.com/Tilton/Login/ForgotPassword.aspx">Forgot your password?</asp:HyperLink></td> </tr> </table> </td> </tr> </table> </LayoutTemplate> </asp:Login> </AnonymousTemplate> </asp:LoginView> <!-- End Login Form --> <!-- Quick Links --> <br /> <br /> <p style="font-size: 14px; font-weight: bold; color: White"> Quick Links:<br /> </p> <br /> <p id="quicklinks"> <a href="default.aspx">Home</a><br /> <a href="services.aspx">Services</a><br /> <a href="matching.aspx">Color Matching</a><br /> <a href="packaging.aspx">Custom Packaging</a><br /> <a href="decorals.aspx">Decorals</a><br /> <a href="delivery.aspx">Delivery</a><br /> <a href="items.aspx">Items</a><br /> <a href="msds.aspx">MSDS</a><br /> <a href="plant.aspx">Plant Capabilities</a><br /> <a href="standard.aspx">Standard Colors</a><br /> <a href="special.aspx">Special Effects</a><br /> <a href="coatings.aspx">Spray Coatings</a><br /> <a href="warranty.aspx">Warranty</a><br /> <a href="http://www.tiltonindustries.com/Tilton/Login/Login.aspx">My Account</a><br /> <a href="gallery.aspx">Gallery</a><br /> <a href="about.aspx">About</a><br /> <a href="faq.aspx">F.A.Q</a><br /> <a href="links.aspx">Links</a><br /> <a href="careers.aspx">Careers</a><br /> <a href="contact.aspx">Contact</a><br /> <br /> </p> </td> </tr> </table> </td> <!-- End Sidebar -->

    Read the article

< Previous Page | 1 2 3 4  | Next Page >