×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

html page calls default.aspx.vb and gets Ispostback false

html page calls default.aspx.vb and gets Ispostback false

html page calls default.aspx.vb and gets Ispostback false

(OP)
Hi,
I have an asp html page that allows the user to input data into a web page. When they click the submit button it calls a default.aspx.vb. The ISPostback is always false so it skips my sql add parameters. Here is the code:

<pre lang="xml">&lt;%@ Page Language=&quot;VB&quot; AutoEventWireup=&quot;false&quot; CodeFile=&quot;default.aspx.vb&quot; Inherits=&quot;_default&quot;%&gt;

&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitiona...;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head id=&quot;Head1&quot; runat=&quot;server&quot;&gt;
&lt;title&gt;GDR Request Form&lt;/title&gt;

&lt;script src=&quot;Scripts/jquery-1.8.2.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;Scripts/jQuery.maskedinput.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;

&lt;link href=&quot;Styles/style2.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;
&lt;/head&gt;

&lt;body&gt;

&lt;form id=&quot;form1&quot; runat=&quot;server&quot;&gt;

&lt;div id=&quot;content&quot; style=&quot;text-align:center&quot; &gt;
&lt;table class=&quot;ftitle2&quot; &gt;
&lt;tr&gt;
&lt;td style=&quot;text-align:left&quot; width=&quot;295px&quot;&gt;
Organization name (if different from the Sponsor):&lt;/td&gt;
&lt;td&gt;
&lt;asp:TextBox ID=&quot;txtOrganization&quot; runat=&quot;server&quot; Width=&quot;466px&quot;&gt;&lt;/asp:TextBox&gt;

&lt;/td&gt;
&lt;td width=&quot;25px&quot;&gt;
Date:&lt;/td&gt;
&lt;td&gt;
&lt;asp:TextBox ID=&quot;txtRequester_Date&quot; runat=&quot;server&quot; width=&quot;70px&quot;
ToolTip=&quot;Please Enter The Request Date. (MM/DD/YYYY)&quot;&gt;&lt;/asp:TextBox&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;/table&gt;
&lt;asp:Button ID=&quot;Button1&quot; runat=&quot;server&quot; Text=&quot;Submit&quot; /&gt;
&lt;br /&gt;

&lt;/div&gt;</pre>

***************************************************************************
default.aspx.vb
***************************************************************************
Imports System.Data.SqlClient
Imports System.Data

Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) _
Handles Me.Load

txtRequester_Date.Text = Date.Today
txtRequestDate.Text = Date.Today

If (IsPostBack) Then
' this creates the connection.
Dim sqlConn As New SqlConnection("Data Source=JITC-PC\GEOINT; Initial catalog=DEV_GEOINT; Integrated Security=SSPI;")
' create the command object
Dim sqlCmd As New SqlCommand("sp_InsertRequest", sqlConn)
' define the connection for the command object
sqlCmd.Connection = sqlConn
sqlCmd.CommandType = CommandType.StoredProcedure
' define the SQL parameter
sqlCmd.Parameters.AddWithValue("@Org", txtOrganization.Text)
sqlCmd.Parameters.AddWithValue("@REQ_Date", txtRequester_Date.Text)
' open the connection
sqlConn.Open()
' execute the data insertion
sqlCmd.ExecuteNonQuery()
' close SQL connection
sqlConn.Close()
' dispose of the connection object (mostly optional but good practice)
sqlConn.Dispose()
' Notify the submission was accepted
Response.Write("Thank-you for your Request!")
End If
End Sub

Private Function isempty(ByVal p1 As Object) As String
Throw New NotImplementedException
End Function

End Class

RE: html page calls default.aspx.vb and gets Ispostback false

May have better results posting this question in forum855: Microsoft: ASP.NET


Mark

"You guys pair up in groups of three, then line up in a circle."
- Bill Peterson, a Florida State football coach

RE: html page calls default.aspx.vb and gets Ispostback false

(OP)
Thank you. I rebuilt the whole thing and now it works.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close