Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6376047
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:41:40+00:00 2026-05-25T01:41:40+00:00

I need to add user data to my database via a form So I

  • 0

I need to add user data to my database via a form

So I have a form with a submit handler like this :

xtype: 'fieldset',
        title: 'User information',
        defaults: {
            //width: 230,
            labelStyle: 'font-size:10px',
            labelWidth: 105
        },
        defaultType: 'textfield',
        layout : 'anchor',
        items: [{
            fieldLabel: 'Name',
            anchor: '98%',
            allowBlank: false,
            name: 'company'
        }, {
            fieldLabel: 'Last Name',
            anchor: '98%',
            name: 'price'
        }, {
            fieldLabel: 'Email ',
            anchor: '98%',
            allowBlank: false,
            vtype: 'email',
            name: 'pctChange'
        }

        ]
    },
             { border: false,
                 buttons: [{
                     text: 'Update user',
                     handler: function () {


                         {
                             if (this.up('form').getForm().isValid()) 
                            {                           
                               this.up('form').getForm().submit({url : 'save.cs' }); // this would submit the form to the configured url
                               //this.up('form').getForm().reset();
                               Ext.MessageBox.show({
                                 title: 'Success !',
                                 msg: 'Changes saved successfully<br />',
                                 icon: Ext.MessageBox.INFO
                                                    })                              
                             }

from what i understood,the submit function call a script (in my case save.ashx) that should update my database!

I have two issues :

1-how do I access my data (submited in the form) I tried to add arguments in the save function as you will see below but im not quit sure about this

2-i get an internal server error when the save.ashx is called

Here is my script:

 public class save
{
    SqlConnection dbConn = new SqlConnection("............");


    public void saveUser(string firstname,string lastname,string email)
    {

    try
          {
              string str = "insert into UTILISATEUR  (firstname, lastname, email ) values ( \""+firstname+"\" , \""+lastname+"\" , \""+email+"\" )";
            SqlCommand sqlCommand = new SqlCommand(str);
            sqlCommand.Connection = dbConn;
            sqlCommand.CommandType = CommandType.Text;
            SqlDataAdapter sda = new SqlDataAdapter(sqlCommand);
            dbConn.Open();

            if (sqlCommand.Connection.State == ConnectionState.Open)
                {
                 sqlCommand.ExecuteNonQuery();
                dbConn.Close();
                }

          }
       catch (Exception ex)
         {
             throw ex;
         }
    }
}

thanks for ur time

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T01:41:41+00:00Added an answer on May 25, 2026 at 1:41 am

    .cs-files are forbidden by IIS – those are C# sources and should not be accessed by end users.
    End users should this way or another access compiled versions of those sources. E.g. you could create HTTP Handler(.ashx-file) that will handle your requests.

    This question will help you get the basics about submitting form to HTTP Handler.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

im trying to add a new user to my database via a form i
So I have this function that gets data from database and echoes it. The
I need to add user roles and permission system into my web application built
I need add a new user group for mediawiki. The new group has more
Through the website, I need to allow the user to add attachments and store
I need to add a specific column if it does not exist. I have
I need to add full web search to my site. I need something like
I have the following data: User System SubSystem user1 System1 SubSystem1 user2 System1 SubSystem2
Ok, i have some data that is being populated via a php query to
I am reading some data from a user's badge via a magnetic swipe. It

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.