Submit button, onClick does not work automaticlly
-
Hi All... I have a form that adds users to the application, I use a submit button to add with event onClick_Button, when I insert all data in fields and then press enter, it does not add until I click on to the submit button, I want to know how to fire the onClick_button event when I click enter button,, Thanks alot... Nour Abdel-Salam
-
Hi All... I have a form that adds users to the application, I use a submit button to add with event onClick_Button, when I insert all data in fields and then press enter, it does not add until I click on to the submit button, I want to know how to fire the onClick_button event when I click enter button,, Thanks alot... Nour Abdel-Salam
This is probably to do with how browsers handle submit buttons and forms. If there is only one submit button (and I mean an input with type="submit" on the client, whatever server-side controls you have) this should no problem, but if the button is rendered as type="button" or there is more than one this won't happen (although if theres more than one I think it fires the first....could be wrong). Either the submit button isn't really rendering as a proper submit or you have more than one on your page.
-
This is probably to do with how browsers handle submit buttons and forms. If there is only one submit button (and I mean an input with type="submit" on the client, whatever server-side controls you have) this should no problem, but if the button is rendered as type="button" or there is more than one this won't happen (although if theres more than one I think it fires the first....could be wrong). Either the submit button isn't really rendering as a proper submit or you have more than one on your page.
-
Thanx for your response My form has only 2 textboxes and a submit button (type submit)... When I press enter, it does not insert the data, until i press the button by mouse... regards
-
web.config is as under:
web2.config is as under:
ObjectAConfiguration class is as under: using System; using System.Collections.Generic; using System.Text; using System.Configuration; using System.Xml; namespace MyApp { [Serializable] public class ObjectAConfiguration:ConfigurationSection { #region Properties [ConfigurationProperty("property1", DefaultValue = 60.00F)] public float Property1 { get { return (float)this["property1"]; } set { this["property1"] = value; } } [ConfigurationProperty("property2", DefaultValue = 1.50F)] public float Property2 { get { return (float)this["property2"]; } set { this["property2"] = value; } } #endregion } } Problem Area is bellow: MyApp.ObjectAConfiguration objAConf= (MyApp.ObjectAConfiguration)ConfigurationManager.GetSection("objectAConfiguration"); The above did not find the web2.config file and thus objectASection section. Thanks.
-
Sorry! the site did not display my contents entirly and correctly. web.config is as under:
web2.config is as under:
ObjectAConfiguration class is as under:
using System;
using System.Collections.Generic;
using System.Text;using System.Configuration;
using System.Xml;namespace MyApp
{
[Serializable]
public class ObjectAConfiguration:ConfigurationSection
{#region Properties \[ConfigurationProperty("property1", DefaultValue = 60.00F)\] public float Property1 { get { return (float)this\["property1"\]; } set { this\["property1"\] = value; } } \[ConfigurationProperty("property2", DefaultValue = 1.50F)\] public float Property2 { get { return (float)this\["property2"\]; } set { this\["property2"\] = value; } } #endregion }
}
Problem Area is bellow:
MyApp.ObjectAConfiguration objAConf= (MyApp.ObjectAConfiguration)ConfigurationManager.GetSection("objectAConfiguration");
The above did not find the web2.config file and thus objectASection section. Thanks.
-
web.config is as under:
web2.config is as under:
ObjectAConfiguration class is as under: using System; using System.Collections.Generic; using System.Text; using System.Configuration; using System.Xml; namespace MyApp { [Serializable] public class ObjectAConfiguration:ConfigurationSection { #region Properties [ConfigurationProperty("property1", DefaultValue = 60.00F)] public float Property1 { get { return (float)this["property1"]; } set { this["property1"] = value; } } [ConfigurationProperty("property2", DefaultValue = 1.50F)] public float Property2 { get { return (float)this["property2"]; } set { this["property2"] = value; } } #endregion } } Problem Area is bellow: MyApp.ObjectAConfiguration objAConf= (MyApp.ObjectAConfiguration)ConfigurationManager.GetSection("objectAConfiguration"); The above did not find the web2.config file and thus objectASection section. Thanks.
-
Imports System.Data Imports System.Data.OleDb Partial Class Links Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Session("ID") = Nothing Then Response.Redirect("default.aspx?flag=2") End If Dim conn As New OleDbConnection Dim cm As New OleDb.OleDbCommand Dim dr As OleDb.OleDbDataReader HyperLink1.Enabled = False HyperLink2.Enabled = False HyperLink3.Enabled = False Try conn.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Hosting;Data Source=JICC" conn.Open() cm.Connection = conn cm.CommandText = "Select * From users where u_id=" & Session("id") & " " dr = cm.ExecuteReader() If dr.HasRows Then Do While dr.Read If dr.GetValue(7) = 1 Then HyperLink1.Enabled = True End If If dr.GetValue(8) = 1 Then HyperLink2.Enabled = True End If If dr.GetValue(9) = 1 Then HyperLink3.Enabled = True End If Loop dr.Close() conn.Close() Else dr.Close() conn.Close() End If Catch ex As Exception Response.Write(Err.Description) End Try End Sub Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Dim conn As New OleDbConnection Dim cm As New OleDb.OleDbCommand Dim dr As OleDb.OleDbDataReader Try conn.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Hosting;Data Source=JICC" conn.Open() cm.Connection = conn cm.CommandText = "Select * From types where t_name='" & TextBox1.Text & "' " dr = cm.ExecuteReader() If dr.HasRows Then Do While dr.Read Label1.Text = " نوع العقار موجود سابقاُ" Label1.Visible = True Loop
-
Imports System.Data Imports System.Data.OleDb Partial Class Links Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Session("ID") = Nothing Then Response.Redirect("default.aspx?flag=2") End If Dim conn As New OleDbConnection Dim cm As New OleDb.OleDbCommand Dim dr As OleDb.OleDbDataReader HyperLink1.Enabled = False HyperLink2.Enabled = False HyperLink3.Enabled = False Try conn.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Hosting;Data Source=JICC" conn.Open() cm.Connection = conn cm.CommandText = "Select * From users where u_id=" & Session("id") & " " dr = cm.ExecuteReader() If dr.HasRows Then Do While dr.Read If dr.GetValue(7) = 1 Then HyperLink1.Enabled = True End If If dr.GetValue(8) = 1 Then HyperLink2.Enabled = True End If If dr.GetValue(9) = 1 Then HyperLink3.Enabled = True End If Loop dr.Close() conn.Close() Else dr.Close() conn.Close() End If Catch ex As Exception Response.Write(Err.Description) End Try End Sub Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Dim conn As New OleDbConnection Dim cm As New OleDb.OleDbCommand Dim dr As OleDb.OleDbDataReader Try conn.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Hosting;Data Source=JICC" conn.Open() cm.Connection = conn cm.CommandText = "Select * From types where t_name='" & TextBox1.Text & "' " dr = cm.ExecuteReader() If dr.HasRows Then Do While dr.Read Label1.Text = " نوع العقار موجود سابقاُ" Label1.Visible = True Loop