You must Sign In to post a response.
  • Category: ASP.NET

    Basic form with validations

    I want a registration form with basic fields like Name, Address, City, State, Country, Zip, Phone, and Email
    a. dynamically load the states dropdown based on country selection without page refresh
    b. validate user enters correct email id using regular expression
    c. validate user enters correct US,India phone format using regex
    d. in the page load show available data in a grid, if there is no data in table show message as "No records found" instead of showing empty grid
    e. page should have a link to add/edit the record that should show popup
    f.Adding fields in popup should be updated in database
  • #762905

    1. dynamically load the states dropdown based on country selection without page refresh
    - You need cascade drop downlist to load country and state list, see below link to know how to do it
    you can use Update panel to avoid postbacks
    http://www.aspneto.com/asp-net-dropdownlist-country-state-city-cascading-without-page-refresh.html
    2. validate user enters correct email id using regular expression
    you can use below regular expression to validate email id
    "\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b"
    3. validate user enters correct US,India phone format using regex
    use below regex to validate US or INDIA phone number
    "^\([0-9]{3}\)[0-9]{3}-[0-9]{4}$"
    4. in the page load show available data in a grid, if there is no data in table show message as "No records found" instead of showing empty grid
    do not show empty grid, check if your dataset or datatable rows.count is 0 then you can hide gridview


    Thanks
    Koolprasd2003
    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]

  • #762909
    Hi,

    You can check the following links for your requirements

    a. dynamically load the states dropdown based on country selection without page refresh

    http://www.webcodeexpert.com/2013/07/how-to-fill-countrystatecities-in.html
    http://www.aspsnippets.com/Articles/How-to-populate-DropDownList-in-GridView-in-ASPNet.aspx

    d. in the page load show available data in a grid, if there is no data in table show message as "No records found" instead of showing empty grid

    http://www.c-sharpcorner.com/uploadfile/abhikumarvatsa/simple-application-form-in-Asp-Net/

    e. page should have a link to add/edit the record that should show popup
    f.Adding fields in popup should be updated in database

    http://www.aspdotnet-suresh.com/2011/02/how-to-inserteditupdate-and-delete-data.html
    http://www.aspsnippets.com/Articles/Insert-Update-Edit-Delete-record-in-GridView-using-SqlDataSource-in-ASPNet.aspx

    Thanks & Regards,
    Mahesh Durgam

  • #762913
    Hello,

    A--> You can load states based on the country without refreshing your page :
    --> http://www.aspdotnet-suresh.com/2012/11/country-state-city-cascading.html

    B--> Regular expression for email address validation :
    ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"

    C--> Validate US, Indian Phone Format :
    ^(?:(?:\+|0{0,2})91(\s*[\-]\s*)?|[0]?)?[789]\d{9}$ - Indian
    ^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$ - US and CANADA

    D--> Show "No Records Found" if there is no data in grid :
    Set EmptyDataText="No records found" inside Gridview control tag

    E--> Add/Edit/Delete record with popup :
    http://www.codeproject.com/Articles/706078/Popup-Editing-Adding-Deleting-Records-with-GridVie

    Hope this will help you.

    Regards,
    Nirav Lalan
    DNS Gold Member
    "Failure is the path of least persistence"

  • #762921
    Thanks all for replying.
    Regards

    Sai Krishna Reddy.


Sign In to post your comments