ASP.NET 1.0 and 1.1 BasicsASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.
You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
Hello and thanks for taking a second. I am simply trying to query the Northwind database. The user will give the order number and the name of the employee who took the order and the order date will be displayed in separate html div tags. The page builds but my events do not seem to be running. Any Advice? Below is my .aspx and code behind. Thanks- Jason
<%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="orderinfoweb.WebForm1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>WebForm1</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<b>Put the Order ID in to Find out who took the order and on what date the order
was placed:</b> <INPUT type="text" id="orderID" runat="server"><br>
<br>
<input type="submit" value="search" id="txtsearch" OnShowInfo="ShowInfo" runat="server"><br>
<br>
Order Date<div id="DivOrderDate" runat="server"></div>
<br>
Employee who took order was
<div id="DivEmployee" runat="server"></div>
<br>
<br>
<div id="DivError" runat="server"></div>
</form>
</body>
</HTML>
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void ShowInfo(Object sender,EventArgs e)
{
//Declare connection and stored proc to get info
SqlConnection myConnection = new SqlConnection();
myConnection.ConnectionString="Data Source=Jason;" + "Initial Catalog=Pubs; User ID=sa";
SqlCommand sqlCom = new SqlCommand("usp_retrieve_Order_info");