Go Back   CodingForums.com > :: Server side development > ASP.NET

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-21-2012, 03:54 AM   PM User | #1
sharonc7
New to the CF scene

 
Join Date: Oct 2012
Location: Arizona, USA
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
sharonc7 is an unknown quantity at this point
html page calls default.aspx.vb and gets Ispostback false

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="default.aspx.vb" 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 id="Head1" runat="server">
<title>GDR Request Form</title>

<script src="Scripts/jquery-1.8.2.js" type="text/javascript"></script>
<script src="Scripts/jQuery.maskedinput.js" type="text/javascript"></script>

<script type="text/javascript">
jQuery(document).ready(function ($) {
$("#txtCommercial").mask("(999) 999-9999");
});
</script>
<link href="Styles/style2.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<table class="ftitle2">
<tr>
<td style="text-align:left" width="25px">
Commercial:</td>
<td>
<asp:TextBox ID="txtCommercial" runat="server" Width="110px" ToolTip="Please Enter999) 999-9999"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredCommercial" runat="server" SetFocusOnError="True" ErrorMessage="Mandatory!"
ControlToValidate="txtCommercial" ForeColor="Red" Font-Bold="True" Font-Underline="True" />
</td>
<td style="text-align:left" width="25px">
DSN:</td>
<td>
<asp:TextBox ID="txtDSN" runat="server" Width="110px" ToolTip="Please Enter: 999-9999"></asp:TextBox>
</td>
</tr>
</table>
<br />

<asp:Button ID="btnSave" runat="server" Text="Submit Request"
Font-Bold="True" />
</form>
</body>
</html>


****************************************************
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
sharonc7 is offline   Reply With Quote
Old 10-23-2012, 07:42 PM   PM User | #2
sharonc7
New to the CF scene

 
Join Date: Oct 2012
Location: Arizona, USA
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
sharonc7 is an unknown quantity at this point
this has been resolved. I had copy and pasted my code into a new web page and that screwed things up. I re did the page and it works fine.
sharonc7 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:53 PM.


Advertisement
Log in to turn off these ads.