<html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <title></title> <style type="text/css"> #form1 { text-align: right; } .style1 { width: 98%; } .style3 { width: 1096px; text-align: left; } .style5 { width: 585px; height: 137px; } .style6 { width: 100%; } .style7 { width: 68px; } .style8 { font-weight: bold; } </style> </head> <body background="Images/bkg-blu.jpg"> <form id="form1" runat="server"> <div style="font-size: x-large; font-weight: 700; text-align: center"> <table class="style1"> <tr> <td class="style3"> <table class="style1"> <tr> <td style="text-align: justify"> <img class="style5" src="Images/buildout_header.jpg" /></td> </tr> </table> </td> </tr> </table> </div> <p> </p> <table class="style6"> <tr> <td class="style7" style="text-align: left"> <asp:Label ID="Label1" runat="server" CssClass="style8" Text="INSTID"></asp:Label> </td> <td style="text-align: left"> <asp:Label ID="Label2" runat="server" CssClass="style8" Text="INSTITUTION"></asp:Label> </td> <td style="text-align: left"> </td> </tr> <tr> <td class="style7" style="text-align: left"> <asp:Label ID="lblINST_ID" runat="server" style="font-weight: 700"></asp:Label> </td> <td style="text-align: left"> <asp:TextBox ID="TextBoxLongName" runat="server" ontextchanged="TextBoxLongName_TextChanged" Width="415px"></asp:TextBox> </td> <td style="text-align: left"> <asp:TextBox ID="TextBoxINST_ID" runat="server"></asp:TextBox> </td> </tr> </table> <br /> <p> </p> </form> </body> </html>
using System; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; using System.Drawing; using System.Text; using System.Collections.Generic; using System.Linq; using System.Data.SqlClient; using System.Configuration; using System.Drawing.Printing; using System.IO; using CrystalDecisions.CrystalReports.Engine; using CrystalDecisions.Shared; namespace SACSCOCLogin1._1 { public partial class BranchOffsiteCamp : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void TextBoxLongName_TextChanged(object sender, EventArgs e) { SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["HotConnectionString"].ConnectionString); con.Open(); SqlCommand scmd = new SqlCommand("Select INST_ID, LongName from Table23 where LongName = '" + TextBoxLongName.Text + "'", con); SqlDataReader dr = scmd.ExecuteReader(); if (dr.Read()) { lblINST_ID.Text = dr["INST_ID"].ToString(); TextBoxINST_ID.Text = dr["INST_ID"].ToString(); } dr.Close(); con.Close(); } } }
AutoPostBack="True"
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)