.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old June 30th, 2009, 03:35 PM
webgirl1 webgirl1 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2009
Posts: 4 webgirl1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 47 m 37 sec
Reputation Power: 0
In Over My Head with ASP

Hi. I have found myself in over my head and am looking for any help anyone can provide. I am working on a redesign for a client and they have a database connected to their website that users can use to search their inventory. Problem #1: I don't have any experience with asp and am in the process of learning php now. Problem #2: I am working on a Mac and the existing code is written in asp. Not sure if it has to be translated so that I can work with it on my Mac or not.

The client would like the search function added to several new pages of their website. It currently is only installed on one page. Problem #3: How do I install it on the new pages? Is it as simple as cut and paste? (I'm working in Dreamweaver CS3) I don't think so but I'm not sure.

Help... I'm so confused and my deadline is Friday!!

Reply With Quote
  #2  
Old June 30th, 2009, 03:58 PM
mystic7's Avatar
mystic7 mystic7 is offline
Contributing User
Click here for more information.
 
Join Date: Sep 2006
Posts: 1,480 mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 11 h 7 m 17 sec
Reputation Power: 270
Yes, you can just cut and paste the search box (it should be a form which is the same in any language). If there are include files in the page that currently contains the search box, you may want to include them in the other pages as well, just in case. they would look something like this
Code:
<!--#include file="file_name.asp"-->


As for your other questions, as long as you're not testing your new code on your computer but uploading it to your client's server, it doesn't matter whether you're using a mac or a pc. It's just text until you put it on a server.

Reply With Quote
  #3  
Old June 30th, 2009, 04:00 PM
webgirl1 webgirl1 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2009
Posts: 4 webgirl1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 47 m 37 sec
Reputation Power: 0
Thank you. I'll try cuttting and pasting the search box.
:-)


Quote:
Originally Posted by mystic7
Yes, you can just cut and paste the search box (it should be a form which is the same in any language). If there are include files in the page that currently contains the search box, you may want to include them in the other pages as well, just in case. they would look something like this
Code:
<!--#include file="file_name.asp"-->


As for your other questions, as long as you're not testing your new code on your computer but uploading it to your client's server, it doesn't matter whether you're using a mac or a pc. It's just text until you put it on a server.

Reply With Quote
  #4  
Old June 30th, 2009, 05:33 PM
mystic7's Avatar
mystic7 mystic7 is offline
Contributing User
Click here for more information.
 
Join Date: Sep 2006
Posts: 1,480 mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 11 h 7 m 17 sec
Reputation Power: 270
If you have a problem, post the code here and we'll show you what you need to copy from the code to paste in the other pages.

Reply With Quote
  #5  
Old July 1st, 2009, 12:06 PM
webgirl1 webgirl1 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2009
Posts: 4 webgirl1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 47 m 37 sec
Reputation Power: 0
Here is the code...

Here's the code from the current page:
Code:
<%@ Page Language="C#" MasterPageFile="~/KRN2007.master" AutoEventWireup="true" CodeFile="inventory_search.aspx.cs" Inherits="inventory_search" Title="Inventory Search" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MiddleContent" Runat="Server">
		<div class="content">


			<img src="file:///Macintosh HD/Users/elizabethlangford/Documents/Liz/Elizabeth Langford LLC/Client Files/Project Management/KRN Aviation Services/Website/Original KRN website/new/img/partssearch_title_ani.gif" alt=""/>
	
			<br />
            
			<div class="content_inventory_search">
			
			<h2>Parts Search</h2>
			
			<table width="730" border="0" cellspacing="0" cellpadding="0" style="border-color: Red">
        	<tr align="left"><td colspan="3">&nbsp;</td></tr>
        	<tr align="left" valign="top">
            	<td>
                <table border="0" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td align="right"><b>Part #:</b></td>
                        <td>&nbsp;</td>
                        <td align="left">
                        <asp:TextBox ID="txtPartNumber" runat="server" /></td>
                        <td>&nbsp;</td>
                        <td align="left">                        
                        <asp:Button ID="btnPartSearch" Text="Search" runat="server" OnCommand="btnPartSearch_Click" /></td>
                    </tr>
                    <tr>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td align="right"><b>Description:</b></td>
                        <td>&nbsp;</td>
                        <td align="left">
                        <asp:TextBox ID="txtDescription" runat="server" /></td>
                        <td>&nbsp;</td>
                        <td align="left">
                        <asp:Button ID="btnDescSearch" Text="Search" runat="server" OnCommand="btnDescSearch_Click" /></td>
                    </tr>
                </table>
            	</td>
            <td>&nbsp;</td>
            <td valign="top">
                <table border="0" cellspacing="0" cellpadding="0">
                    <asp:Panel ID="pnlSearchResultInstruction" runat="server" Visible="false" >
                    <tr><td>&nbsp;</td></tr>
                    <tr>
                        <td>
                            Click on the " 
                            <img src="file:///Macintosh HD/Users/elizabethlangford/Documents/Liz/Elizabeth Langford LLC/Client Files/Project Management/KRN Aviation Services/Website/Original KRN website/new/img/Plus.gif" border="0" width="11" height="11" /> " icon for more information<br />
                            ie. Condition, Cert Source and Alternate Part.
                        </td>
                    </tr>
                    </asp:Panel>
                </table>
            </td>
        	</tr>
        	<tr align="left">
        		<td colspan="3">&nbsp;</td>
        	</tr>    
       <asp:Panel ID="pnlSearchResultSection" runat="server" Visible="false">
        <tr align="left" valign="top">
            <td colspan="3">
                <table border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td style="line-height:20pt; color:#1515D0"><b>Search Results:</b></td>                        
                    </tr>
                    <tr>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td width="100%">
                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <div runat="server" id="pnlSearchResultGrid" />
                                <div runat="server" id="pnlSearchResultGridNextPage">
                                <tr>
                                    <td colspan="3" align="right" class="clsTableRowBottomRight">
                                        < 
                                        <asp:LinkButton ID="btnPrevious10" runat="server" OnCommand="btnPrevious10_Click" Text="Previous 10" /> >&nbsp;
                                        < 
                                        <asp:LinkButton ID="btnNext10" runat="server" OnCommand="btnNext10_Click" Text="Next 10" /> >
                                    </td>
                                </tr>
                                </div>
                                <tr>
                                    <td colspan="3">&nbsp;</td>
                                </tr>
                                <tr>
                                    <td colspan="3" align="center" style="color:#1515D0; font-weight:bold">
                                        For orders or price quotes: call (800) 366-6462 or (480) 753-0752 or
                                        <br />email:  <a href="mailto:websales@krn.com">websales@krn.com</a>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="3"><br /><br /><br /></td>
                                </tr>                                                               
                            </table>
                        </td>                        
                    </tr>
                </table>
            </td>
        </tr>
        </asp:Panel>        	
    		</table>
            
            </div>
            
            <div class="inventory_search">
			<img style="padding-right:10px; padding-top:0px;" src="file:///Macintosh HD/Users/elizabethlangford/Documents/Liz/Elizabeth Langford LLC/Client Files/Project Management/KRN Aviation Services/Website/Original KRN website/new/img/inventory_search.gif" border="0" align="left">
			</div>
			
			<div class="inventory_bullets">
			<ul>
			<li>CESSNA PARTS: SINGLE & MULTI ENGINE AND TURBO-PROP</li>
			<br /><br />
  			<li>PIPER PARTS: SINGLE & MULTI ENGINE AND TURBO-PROP</li>
  			<br /><br />
  			<li>BEECHCRAFT PARTS: SINGLE & MULTI ENGINE AND TURBO-PROP</li>
  			<br /><br />
  			<li>CESSNA CITATION: AIRFRAME PARTS</li>
  			<br /><br />
 	 		<li>LEARJET: AIRFRAME PARTS</li>
 	 		<br /><br />
  			<li>FAIRCHILD / METRO: AIRFRAME PARTS</li>
  			<br /><br />
  			<li>CONTINENTAL MOTORS: ENGINE & IGNITION PARTS</li>
  			<br /><br />
  			<li>TEXTRON LYCOMING: ENGINE PARTS</li>
  			<br /><br />
  			<li>PRATT & WHITNEY: ENGINE PARTS</li>
  			<br /><br />
  			<li>GARRETT / ALLIED SIGNAL: ENGINE PARTS, WASTEGATES, VALVES & CONTROLLERS</li>
  			<br /><br />
  			<li>CLEVELAND: BRAKES, WHEELS, AND DISCS</li>
  			<br /><br />
  			<li>DISTRIBUTORS OF: RAPCO, MCFARLANE, & PMA PRODUCTS</li>
  			</ul>
			</div>

			<div class="clearer">&nbsp;</div>

	</div>
</asp:Content>




There is also a css page, here is that code:

Code:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using System.Data.SqlClient;
using System.Text;
using System.Web.Configuration;
using System.IO;

public partial class inventory_search : System.Web.UI.Page
{
    private const string DBCONNECTION = "KRN_DB_CONNECTION";    

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            ViewState["Previous10"] = null;
            ViewState["Next10"] = null;
            ViewState["SearchByType"] = null;
            ViewState["SearchByValue"] = null;
        }
    }

    public void btnPrevious10_Click(Object sender, System.EventArgs e)
    {
        try
        {
            int seqID = Convert.ToInt32(ViewState["Previous10"]);
            if (Convert.ToString(ViewState["SearchByType"]) != null)
            {
                SqlConnection cnn = new SqlConnection();
                cnn.ConnectionString = WebConfigurationManager.ConnectionStrings[DBCONNECTION].ConnectionString.ToString();

                SqlCommand command = new SqlCommand();
                command.Connection = cnn;
                command.CommandType = System.Data.CommandType.StoredProcedure;
                command.CommandText = "krn_SearchParts";

                if (Convert.ToString(ViewState["SearchByType"]) == "BYNUMBER")
                {
                    command.Parameters.AddWithValue("@partnumber", Convert.ToString(ViewState["SearchByValue"]));
                    command.Parameters.AddWithValue("@partdescription", DBNull.Value);
                }
                else
                {
                    command.Parameters.AddWithValue("@partnumber", DBNull.Value);
                    command.Parameters.AddWithValue("@partdescription", Convert.ToString(ViewState["SearchByValue"]));
                }
                command.Parameters.AddWithValue("@startseq", seqID);

                SqlDataAdapter adapter = new SqlDataAdapter();
                adapter.SelectCommand = command;
                DataSet ds = new DataSet();
                adapter.Fill(ds);
                if (ds != null)
                {
                    pnlSearchResultInstruction.Visible = true;
                    pnlSearchResultGrid.InnerHtml = RenderSearchResultTable(ds);
                    pnlSearchResultSection.Visible = true;
                }
                ds.Dispose();
                command.Dispose();
                adapter.Dispose();
                cnn.Close();
            }
        }
        catch (Exception ex)
        {
            throw (ex);
        }
    }


    public void btnNext10_Click(Object sender, System.EventArgs e)
    {
        try
        {
            int seqID = Convert.ToInt32(ViewState["Next10"]);
            if (Convert.ToString(ViewState["SearchByType"]) != null)
            {
                SqlConnection cnn = new SqlConnection();
                cnn.ConnectionString = WebConfigurationManager.ConnectionStrings[DBCONNECTION].ConnectionString.ToString();

                SqlCommand command = new SqlCommand();
                command.Connection = cnn;
                command.CommandType = System.Data.CommandType.StoredProcedure;
                command.CommandText = "krn_SearchParts";

                if (Convert.ToString(ViewState["SearchByType"]) == "BYNUMBER")
                {
                    command.Parameters.AddWithValue("@partnumber", Convert.ToString(ViewState["SearchByValue"]));
                    command.Parameters.AddWithValue("@partdescription", DBNull.Value);
                }
                else
                {
                    command.Parameters.AddWithValue("@partnumber", DBNull.Value);
                    command.Parameters.AddWithValue("@partdescription", Convert.ToString(ViewState["SearchByValue"]));
                }
                command.Parameters.AddWithValue("@startseq", seqID);

                SqlDataAdapter adapter = new SqlDataAdapter();
                adapter.SelectCommand = command;
                DataSet ds = new DataSet();
                adapter.Fill(ds);
                if (ds != null)
                {
                    pnlSearchResultInstruction.Visible = true;
                    pnlSearchResultGrid.InnerHtml = RenderSearchResultTable(ds);
                    pnlSearchResultSection.Visible = true;
                }
                ds.Dispose();
                command.Dispose();
                adapter.Dispose();
                cnn.Close();
            }
        }
        catch (Exception ex)
        {
            throw (ex);
        }
    }

    public void btnDescSearch_Click(Object sender, System.EventArgs e)
    {
        try
        {
            if (txtDescription.Text.Trim() != string.Empty)
            {
                SqlConnection cnn = new SqlConnection();
                cnn.ConnectionString = WebConfigurationManager.ConnectionStrings[DBCONNECTION].ConnectionString.ToString();

                SqlCommand command = new SqlCommand();
                command.Connection = cnn;
                command.CommandType = System.Data.CommandType.StoredProcedure;
                command.CommandText = "krn_SearchParts";
                command.Parameters.AddWithValue("@partnumber", DBNull.Value);
                command.Parameters.AddWithValue("@partdescription", txtDescription.Text.Trim());
                command.Parameters.AddWithValue("@startseq", DBNull.Value);

                SqlDataAdapter adapter = new SqlDataAdapter();
                adapter.SelectCommand = command;
                DataSet ds = new DataSet();
                adapter.Fill(ds);
                if (ds != null)
                {
                    pnlSearchResultInstruction.Visible = true;
                    pnlSearchResultGrid.InnerHtml = RenderSearchResultTable(ds);
                    pnlSearchResultSection.Visible = true;
                }
                else
                {

                }
                ds.Dispose();
                command.Dispose();
                adapter.Dispose();
                cnn.Close();

                txtPartNumber.Text = "";

                ViewState["SearchByType"] = "BYDESC";
                ViewState["SearchByValue"] = txtDescription.Text.Trim();
            }
        }
        catch (Exception ex)
        {
            throw (ex);
        }
    }

    public void btnPartSearch_Click(object sender, System.EventArgs e)
    {
        try
        {
            if (txtPartNumber.Text.Trim() != string.Empty)
            {
                SqlConnection cnn = new SqlConnection();
                cnn.ConnectionString = WebConfigurationManager.ConnectionStrings[DBCONNECTION].ConnectionString.ToString();

                SqlCommand command = new SqlCommand();
                command.Connection = cnn;
                command.CommandType = System.Data.CommandType.StoredProcedure;
                command.CommandText = "krn_SearchParts";
                command.Parameters.AddWithValue("@partnumber", txtPartNumber.Text.TrimEnd());
                command.Parameters.AddWithValue("@partdescription", DBNull.Value);
                command.Parameters.AddWithValue("@startseq", DBNull.Value);

                SqlDataAdapter adapter = new SqlDataAdapter();
                adapter.SelectCommand = command;
                DataSet ds = new DataSet();
                adapter.Fill(ds);
                if (ds != null)
                {
                    pnlSearchResultInstruction.Visible = true;
                    pnlSearchResultGrid.InnerHtml = RenderSearchResultTable(ds);
                    pnlSearchResultSection.Visible = true;
                }
                else
                {

                }
                ds.Dispose();
                command.Dispose();
                adapter.Dispose();
                cnn.Close();

                txtDescription.Text = "";

                ViewState["SearchByType"] = "BYNUMBER";
                ViewState["SearchByValue"] = txtPartNumber.Text.TrimEnd();
            }
        }
        catch (Exception ex)
        {
            throw (ex);
        }

    }

    private string RenderSearchResultTable(DataSet dsResult)
    {
        string outputHTMLGrid = string.Empty;
        try
        {
            //Start construct the HTML to emit.
            StringBuilder sb = new StringBuilder();
            System.Diagnostics.Debug.WriteLine(HttpUtility.Htm  lEncode(">"));
            if (dsResult.Tables[0].Rows.Count < 1)
            {
                pnlSearchResultGridNextPage.Visible = false;
                pnlSearchResultInstruction.Visible = false;
                sb.Append("<tr>");
                sb.Append("<td colspan=\"3\" width=\"100%\" ><b><font color='RED'>No matches were found.</font></b></td>");
                sb.Append("</tr>");

            }
            else
            {
                pnlSearchResultGridNextPage.Visible = true;
                sb.Append("<tr>");
                sb.Append("<td width=\"29%\" class=\"clsTableHeaderLeft\"><b>Part #</b></td>");
                sb.Append("<td width=\"50%\" class=\"clsTableHeaderLeft\"><b>Description</b></td>");
                sb.Append("<td width=\"21%\" class=\"clsTableHeaderRight\" align=\"center\" ><b>Available Quantity</b></td>");
                sb.Append("</tr>");

                foreach (DataRow r in dsResult.Tables[0].Rows)
                {
                    if ((bool)r["SELECTED"])
                    {
                        //sb.Append("<tr class=\"clsTableRowHighlight\" style='display' id=\"row_h_" + r["SEQ"].ToString() + "\" onmouseover=\"javascript:HighlightRow(this, null, 'on');\" onmouseout=\"javascript:HighlightRow(this, null, 'off');\">");
                        sb.Append("<tr class=\"clsTableRowHighlight\" style='display' id=\"row_h_" + r["SEQ"].ToString() + "\" >");
                    }
                    else
                    {
                        sb.Append("<tr style='display' id=\"row_h_" + r["SEQ"].ToString() + "\" onmouseover=\"javascript:HighlightRow(this, null, 'on');\" onmouseout=\"javascript:HighlightRow(this, null, 'off');\">");
                    }

                    sb.Append("<td class=\"clsTableRowLeft\"><img onclick=\"javascript:ExpandPart('" + r["SEQ"].ToString() + "')\" src=\"img/Plus.gif\" border=\"0\" /> " + r["PN"].ToString() + "</td>");
                    sb.Append("<td class=\"clsTableRowLeft\">" + r["DESCRIPTION"].ToString() + "&nbsp;</td>");

                    sb.Append("<td class=\"clsTableRowRight\" align=\"center\">" + r["QTY_AVAILABLE"].ToString() + "</td>");
                    sb.Append("</tr>");

                    if ((bool)r["SELECTED"])
                    {
                        sb.Append("<tr style='display:none;' class=\"clsTableRowHighlight\" id=\"row_eh_" + r["SEQ"].ToString() + "\" >");
                        sb.Append("<td class=\"clsTableRowHeadExpandedLeft\"><img onclick=\"javascript:CollapsePart('" + r["SEQ"].ToString() + "');\" src=\"img/Minus.gif\" border=\"0\" /> " + r["PN"].ToString() + "</td>");
                        sb.Append("<td class=\"clsTableRowHeadExpandedMiddle\">" + r["DESCRIPTION"].ToString() + "</td>");
                        sb.Append("<td class=\"clsTableRowHeadExpandedRight\" align=\"left\">Total Available:&nbsp;" + r["QTY_AVAILABLE"].ToString() + "</td>");
                        sb.Append("</tr>");


                        sb.Append("<tr style='display:none;' class=\"clsTableRowHighlight\" id=\"row_ed_" + r["SEQ"].ToString() + "\" >");
                        sb.Append("<td colspan=\"3\" class=\"clsTableRowDetailExpanded\">");
                        sb.Append("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"border-color: Red\">");
                    }
                    else
                    {
                        sb.Append("<tr style='display:none;' id=\"row_eh_" + r["SEQ"].ToString() + "\" onmouseover=\"javascript:HighlightRow(this, 'row_ed_" + r["SEQ"].ToString() + "', 'on');\" onmouseout=\"javascript:HighlightRow(this, 'row_ed_" + r["SEQ"].ToString() + "', 'off');\">");
                        sb.Append("<td class=\"clsTableRowHeadExpandedLeft\"><img onclick=\"javascript:CollapsePart('" + r["SEQ"].ToString() + "');\" src=\"img/Minus.gif\" border=\"0\" /> " + r["PN"].ToString() + "</td>");
                        sb.Append("<td class=\"clsTableRowHeadExpandedMiddle\">" + r["DESCRIPTION"].ToString() + "</td>");
                        sb.Append("<td class=\"clsTableRowHeadExpandedRight\" align=\"left\">Total Available:&nbsp;" + r["QTY_AVAILABLE"].ToString() + "</td>");
                        sb.Append("</tr>");


                        sb.Append("<tr style='display:none;' id=\"row_ed_" + r["SEQ"].ToString() + "\" onmouseover=\"javascript:HighlightRow(this, 'row_eh_" + r["SEQ"].ToString() + "', 'on');\" onmouseout=\"javascript:HighlightRow(this, 'row_eh_" + r["SEQ"].ToString() + "', 'off');\">");
                        sb.Append("<td colspan=\"3\" class=\"clsTableRowDetailExpanded\">");
                        sb.Append("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"border-color: Red\">");
                    }

                    int total_rDetail = dsResult.Tables[1].Select("PNM_AUTO_KEY = " + r["PNM_AUTO_KEY"].ToString()).Length;
                    int current_index = 0;

                    foreach (DataRow rdetail in dsResult.Tables[1].Select("PNM_AUTO_KEY = " + r["PNM_AUTO_KEY"].ToString()))
                    {
                        sb.Append("<tr>");

                        current_index++;
                        if (current_index < total_rDetail)
                            sb.Append("    <td width=\"40\" align=\"right\"><img src=\"img/T.gif\" border=\"0\" /></td>");
                        else
                            sb.Append("    <td width=\"40\" align=\"right\"><img src=\"img/L.gif\" border=\"0\" /></td>");

                        sb.Append("    <td width=\"40\" align=\"right\">Condition:&nbsp;</td>");
                        sb.Append("    <td width=\"30\">" + rdetail["CONDITION_CODE"].ToString() + "</td>");
                        sb.Append("    <td width=\"120\" align=\"right\">Location Code:&nbsp;</td>");
                        sb.Append("    <td >" + rdetail["LOCATION_CODE"].ToString() + "&nbsp;</td>");
                        sb.Append("    <td width=\"120\" align=\"right\">Cert Source:&nbsp;</td>");
                        sb.Append("    <td width=\"120\">" + rdetail["CERT_SOURCE"].ToString() + "&nbsp;</td>");
                        sb.Append("    <td align=\"right\" width=\"74\">Qty:&nbsp;</td>");
                        sb.Append("    <td width=\"74\">" + rdetail["QTY_AVAILABLE"].ToString() + "&nbsp;</td>");
                        sb.Append("</tr>");
                    }

                    int total_alternate = dsResult.Tables[2].Select("PNM_AUTO_KEY = " + r["PNM_AUTO_KEY"].ToString()).Length;
                    if (total_alternate > 0)
                    {
                        string alternatePartsString = string.Empty;


                        foreach (DataRow rAlternate in dsResult.Tables[2].Select("PNM_AUTO_KEY = " + r["PNM_AUTO_KEY"].ToString()))
                        {
                            alternatePartsString += rAlternate["ALT_PN"].ToString().Trim() + ", ";
                        }
                        alternatePartsString = alternatePartsString.Substring(0, alternatePartsString.Length - 2);
                        sb.Append("<tr><td colspan=\"9\">&nbsp;</td></tr>");
                        sb.Append("<tr>");
                        sb.Append("    <td width=\"40\">&nbsp;&nbsp;</td>");
                        sb.Append("    <td align=\"left\" colspan=\"8\">Alternate Part#:&nbsp;" + alternatePartsString + "</td>");
                        sb.Append("</tr>");
                        //sb.Append("<tr>");
                        //sb.Append("    <td width=\"40\">&nbsp;&nbsp;</td>");
                        //sb.Append("    <td align=\"left\" colspan=\"7\">" + alternatePartsString + "</td>");
                        //sb.Append("    <td width=\"74\">&nbsp;</td>");
                        //sb.Append("</tr>");
                    }
                    sb.Append("<tr><td colspan=\"9\">&nbsp;</td></tr>");
                    sb.Append("</table>");
                    sb.Append("</td>");
                    sb.Append("</tr>");
                }

                string sTemp = (string)dsResult.Tables[0].Rows[0]["SEQ"].ToString();
                int pTemp = Convert.ToInt32(sTemp);
                int nTemp = Convert.ToInt32(sTemp);
                pTemp = pTemp - 9;
                nTemp = nTemp + 9;

                if (Convert.ToInt32(sTemp) <= 1)
                {
                    btnPrevious10.Enabled = false;
                    ViewState["Previous10"] = null;
                }
                else
                {
                    btnPrevious10.Enabled = true;
                    if (pTemp < 1) pTemp = 0;
                    ViewState["Previous10"] = pTemp.ToString();
                }

                if (nTemp >= Convert.ToInt32(dsResult.Tables[3].Rows[0]["Max_Seq"]))
                {
                    ViewState["Next10"] = null;
                    ViewState["Previous10"] = Convert.ToString(pTemp);
                    btnNext10.Enabled = false;
                }
                else
                {
                    ViewState["Next10"] = nTemp.ToString();
                    btnNext10.Enabled = true;
                }
            }
            return sb.ToString();
        }
        catch (Exception ex)
        {
            throw (ex);
        }
    }
}



Thank you so much for your help as I am still lost.

Quote:
Originally Posted by mystic7
If you have a problem, post the code here and we'll show you what you need to copy from the code to paste in the other pages.

Last edited by mehere : July 1st, 2009 at 01:16 PM.

Reply With Quote
  #6  
Old July 1st, 2009, 12:43 PM
mystic7's Avatar
mystic7 mystic7 is offline
Contributing User
Click here for more information.
 
Join Date: Sep 2006
Posts: 1,480 mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 11 h 7 m 17 sec
Reputation Power: 270
Yikes, that looks like asp.net code to me. With C# thrown in for good measure. I don't see a form anywhere in there. btw,
You might want to wrap your code in code tags. Makes it easier to read. Like so
Code:
<%@ Page Language="C#" MasterPageFile="~/KRN2007.master" AutoEventWireup="true" CodeFile="inventory_search.aspx.cs" Inherits="inventory_search" Title="Inventory Search" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MiddleContent" Runat="Server">
<div class="content">


<img src="file:///Macintosh HD/Users/elizabethlangford/Documents/Liz/Elizabeth Langford LLC/Client Files/Project Management/KRN Aviation Services/Website/Original KRN website/new/img/partssearch_title_ani.gif" alt=""/>

<br />

<div class="content_inventory_search">

<h2>Parts Search</h2>

<table width="730" border="0" cellspacing="0" cellpadding="0" style="border-color: Red">
<tr align="left"><td colspan="3">&nbsp;</td></tr>
<tr align="left" valign="top">
<td>
<table border="0" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td align="right"><b>Part #:</b></td>
<td>&nbsp;</td>
<td align="left">
<asp:TextBox ID="txtPartNumber" runat="server" /></td>
<td>&nbsp;</td>
<td align="left"> 
<asp:Button ID="btnPartSearch" Text="Search" runat="server" OnCommand="btnPartSearch_Click" /></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td align="right"><b>Description:</b></td>
<td>&nbsp;</td>
<td align="left">
<asp:TextBox ID="txtDescription" runat="server" /></td>
<td>&nbsp;</td>
<td align="left">
<asp:Button ID="btnDescSearch" Text="Search" runat="server" OnCommand="btnDescSearch_Click" /></td>
</tr>
</table>
</td>
<td>&nbsp;</td>
<td valign="top">
<table border="0" cellspacing="0" cellpadding="0">
<asp:Panel ID="pnlSearchResultInstruction" runat="server" Visible="false" >
<tr><td>&nbsp;</td></tr>
<tr>
<td>
Click on the " 
<img src="file:///Macintosh HD/Users/elizabethlangford/Documents/Liz/Elizabeth Langford LLC/Client Files/Project Management/KRN Aviation Services/Website/Original KRN website/new/img/Plus.gif" border="0" width="11" height="11" /> " icon for more information<br />
ie. Condition, Cert Source and Alternate Part.
</td>
</tr>
</asp:Panel>
</table>
</td>
</tr>
<tr align="left">
<td colspan="3">&nbsp;</td>
</tr> 
<asp:Panel ID="pnlSearchResultSection" runat="server" Visible="false">
<tr align="left" valign="top">
<td colspan="3">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td style="line-height:20pt; color:#1515D0"><b>Search Results:</b></td> 
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td width="100%">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<div runat="server" id="pnlSearchResultGrid" />
<div runat="server" id="pnlSearchResultGridNextPage">
<tr>
<td colspan="3" align="right" class="clsTableRowBottomRight">
< 
<asp:LinkButton ID="btnPrevious10" runat="server" OnCommand="btnPrevious10_Click" Text="Previous 10" /> >&nbsp;
< 
<asp:LinkButton ID="btnNext10" runat="server" OnCommand="btnNext10_Click" Text="Next 10" /> >
</td>
</tr>
</div>
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td colspan="3" align="center" style="color:#1515D0; font-weight:bold">
For orders or price quotes: call (800) 366-6462 or (480) 753-0752 or
<br />email: <a href="mailto:websales@krn.com">websales@krn.com</a>
</td>
</tr>
<tr>
<td colspan="3"><br /><br /><br /></td>
</tr> 
</table>
</td> 
</tr>
</table>
</td>
</tr>
</asp:Panel> 
</table>

</div>

<div class="inventory_search">
<img style="padding-right:10px; padding-top:0px;" src="file:///Macintosh HD/Users/elizabethlangford/Documents/Liz/Elizabeth Langford LLC/Client Files/Project Management/KRN Aviation Services/Website/Original KRN website/new/img/inventory_search.gif" border="0" align="left">
</div>

<div class="inventory_bullets">
<ul>
<li>CESSNA PARTS: SINGLE & MULTI ENGINE AND TURBO-PROP</li>
<br /><br />
<li>PIPER PARTS: SINGLE & MULTI ENGINE AND TURBO-PROP</li>
<br /><br />
<li>BEECHCRAFT PARTS: SINGLE & MULTI ENGINE AND TURBO-PROP</li>
<br /><br />
<li>CESSNA CITATION: AIRFRAME PARTS</li>
<br /><br />
<li>LEARJET: AIRFRAME PARTS</li>
<br /><br />
<li>FAIRCHILD / METRO: AIRFRAME PARTS</li>
<br /><br />
<li>CONTINENTAL MOTORS: ENGINE & IGNITION PARTS</li>
<br /><br />
<li>TEXTRON LYCOMING: ENGINE PARTS</li>
<br /><br />
<li>PRATT & WHITNEY: ENGINE PARTS</li>
<br /><br />
<li>GARRETT / ALLIED SIGNAL: ENGINE PARTS, WASTEGATES, VALVES & CONTROLLERS</li>
<br /><br />
<li>CLEVELAND: BRAKES, WHEELS, AND DISCS</li>
<br /><br />
<li>DISTRIBUTORS OF: RAPCO, MCFARLANE, & PMA PRODUCTS</li>
</ul>
</div>

<div class="clearer">&nbsp;</div>

</div>
</asp:Content>



There is also a css page, here is that code:

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using System.Data.SqlClient;
using System.Text;
using System.Web.Configuration;
using System.IO;

public partial class inventory_search : System.Web.UI.Page
{
private const string DBCONNECTION = "KRN_DB_CONNECTION"; 

protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
ViewState["Previous10"] = null;
ViewState["Next10"] = null;
ViewState["SearchByType"] = null;
ViewState["SearchByValue"] = null;
}
}

public void btnPrevious10_Click(Object sender, System.EventArgs e)
{
try
{
int seqID = Convert.ToInt32(ViewState["Previous10"]);
if (Convert.ToString(ViewState["SearchByType"]) != null)
{
SqlConnection cnn = new SqlConnection();
cnn.ConnectionString = WebConfigurationManager.ConnectionStrings[DBCONNECTION].ConnectionString.ToString();

SqlCommand command = new SqlCommand();
command.Connection = cnn;
command.CommandType = System.Data.CommandType.StoredProcedure;
command.CommandText = "krn_SearchParts";

if (Convert.ToString(ViewState["SearchByType"]) == "BYNUMBER")
{
command.Parameters.AddWithValue("@partnumber", Convert.ToString(ViewState["SearchByValue"]));
command.Parameters.AddWithValue("@partdescription", DBNull.Value);
}
else
{
command.Parameters.AddWithValue("@partnumber", DBNull.Value);
command.Parameters.AddWithValue("@partdescription", Convert.ToString(ViewState["SearchByValue"]));
}
command.Parameters.AddWithValue("@startseq", seqID);

SqlDataAdapter adapter = new SqlDataAdapter();
adapter.SelectCommand = command;
DataSet ds = new DataSet();
adapter.Fill(ds);
if (ds != null)
{
pnlSearchResultInstruction.Visible = true;
pnlSearchResultGrid.InnerHtml = RenderSearchResultTable(ds);
pnlSearchResultSection.Visible = true;
}
ds.Dispose();
command.Dispose();
adapter.Dispose();
cnn.Close();
}
}
catch (Exception ex)
{
throw (ex);
}
}


public void btnNext10_Click(Object sender, System.EventArgs e)
{
try
{
int seqID = Convert.ToInt32(ViewState["Next10"]);
if (Convert.ToString(ViewState["SearchByType"]) != null)
{
SqlConnection cnn = new SqlConnection();
cnn.ConnectionString = WebConfigurationManager.ConnectionStrings[DBCONNECTION].ConnectionString.ToString();

SqlCommand command = new SqlCommand();
command.Connection = cnn;
command.CommandType = System.Data.CommandType.StoredProcedure;
command.CommandText = "krn_SearchParts";

if (Convert.ToString(ViewState["SearchByType"]) == "BYNUMBER")
{
command.Parameters.AddWithValue("@partnumber", Convert.ToString(ViewState["SearchByValue"]));
command.Parameters.AddWithValue("@partdescription", DBNull.Value);
}
else
{
command.Parameters.AddWithValue("@partnumber", DBNull.Value);
command.Parameters.AddWithValue("@partdescription", Convert.ToString(ViewState["SearchByValue"]));
}
command.Parameters.AddWithValue("@startseq", seqID);

SqlDataAdapter adapter = new SqlDataAdapter();
adapter.SelectCommand = command;
DataSet ds = new DataSet();
adapter.Fill(ds);
if (ds != null)
{
pnlSearchResultInstruction.Visible = true;
pnlSearchResultGrid.InnerHtml = RenderSearchResultTable(ds);
pnlSearchResultSection.Visible = true;
}
ds.Dispose();
command.Dispose();
adapter.Dispose();
cnn.Close();
}
}
catch (Exception ex)
{
throw (ex);
}
}

public void btnDescSearch_Click(Object sender, System.EventArgs e)
{
try
{
if (txtDescription.Text.Trim() != string.Empty)
{
SqlConnection cnn = new SqlConnection();
cnn.ConnectionString = WebConfigurationManager.ConnectionStrings[DBCONNECTION].ConnectionString.ToString();

SqlCommand command = new SqlCommand();
command.Connection = cnn;
command.CommandType = System.Data.CommandType.StoredProcedure;
command.CommandText = "krn_SearchParts";
command.Parameters.AddWithValue("@partnumber", DBNull.Value);
command.Parameters.AddWithValue("@partdescription", txtDescription.Text.Trim());
command.Parameters.AddWithValue("@startseq", DBNull.Value);

SqlDataAdapter adapter = new SqlDataAdapter();
adapter.SelectCommand = command;
DataSet ds = new DataSet();
adapter.Fill(ds);
if (ds != null)
{
pnlSearchResultInstruction.Visible = true;
pnlSearchResultGrid.InnerHtml = RenderSearchResultTable(ds);
pnlSearchResultSection.Visible = true;
}
else
{

}
ds.Dispose();
command.Dispose();
adapter.Dispose();
cnn.Close();

txtPartNumber.Text = "";

ViewState["SearchByType"] = "BYDESC";
ViewState["SearchByValue"] = txtDescription.Text.Trim();
}
}
catch (Exception ex)
{
throw (ex);
}
}

public void btnPartSearch_Click(object sender, System.EventArgs e)
{
try
{
if (txtPartNumber.Text.Trim() != string.Empty)
{
SqlConnection cnn = new SqlConnection();
cnn.ConnectionString = WebConfigurationManager.ConnectionStrings[DBCONNECTION].ConnectionString.ToString();

SqlCommand command = new SqlCommand();
command.Connection = cnn;
command.CommandType = System.Data.CommandType.StoredProcedure;
command.CommandText = "krn_SearchParts";
command.Parameters.AddWithValue("@partnumber", txtPartNumber.Text.TrimEnd());
command.Parameters.AddWithValue("@partdescription", DBNull.Value);
command.Parameters.AddWithValue("@startseq", DBNull.Value);

SqlDataAdapter adapter = new SqlDataAdapter();
adapter.SelectCommand = command;
DataSet ds = new DataSet();
adapter.Fill(ds);
if (ds != null)
{
pnlSearchResultInstruction.Visible = true;
pnlSearchResultGrid.InnerHtml = RenderSearchResultTable(ds);
pnlSearchResultSection.Visible = true;
}
else
{

}
ds.Dispose();
command.Dispose();
adapter.Dispose();
cnn.Close();

txtDescription.Text = "";

ViewState["SearchByType"] = "BYNUMBER";
ViewState["SearchByValue"] = txtPartNumber.Text.TrimEnd();
}
}
catch (Exception ex)
{
throw (ex);
}

}

private string RenderSearchResultTable(DataSet dsResult)
{
string outputHTMLGrid = string.Empty;
try
{
//Start construct the HTML to emit.
StringBuilder sb = new StringBuilder();
System.Diagnostics.Debug.WriteLine(HttpUtility.Htm   lEncode(">"));
if (dsResult.Tables[0].Rows.Count < 1)
{
pnlSearchResultGridNextPage.Visible = false;
pnlSearchResultInstruction.Visible = false;
sb.Append("<tr>");
sb.Append("<td colspan=\"3\" width=\"100%\" ><b><font color='RED'>No matches were found.</font></b></td>");
sb.Append("</tr>");

}
else
{
pnlSearchResultGridNextPage.Visible = true;
sb.Append("<tr>");
sb.Append("<td width=\"29%\" class=\"clsTableHeaderLeft\"><b>Part #</b></td>");
sb.Append("<td width=\"50%\" class=\"clsTableHeaderLeft\"><b>Description</b></td>");
sb.Append("<td width=\"21%\" class=\"clsTableHeaderRight\" align=\"center\" ><b>Available Quantity</b></td>");
sb.Append("</tr>");

foreach (DataRow r in dsResult.Tables[0].Rows)
{
if ((bool)r["SELECTED"])
{
//sb.Append("<tr class=\"clsTableRowHighlight\" style='display' id=\"row_h_" + r["SEQ"].ToString() + "\" onmouseover=\"javascript:HighlightRow(this, null, 'on');\" onmouseout=\"javascript:HighlightRow(this, null, 'off');\">");
sb.Append("<tr class=\"clsTableRowHighlight\" style='display' id=\"row_h_" + r["SEQ"].ToString() + "\" >");
}
else
{
sb.Append("<tr style='display' id=\"row_h_" + r["SEQ"].ToString() + "\" onmouseover=\"javascript:HighlightRow(this, null, 'on');\" onmouseout=\"javascript:HighlightRow(this, null, 'off');\">");
}

sb.Append("<td class=\"clsTableRowLeft\"><img onclick=\"javascript:ExpandPart('" + r["SEQ"].ToString() + "')\" src=\"img/Plus.gif\" border=\"0\" /> " + r["PN"].ToString() + "</td>");
sb.Append("<td class=\"clsTableRowLeft\">" + r["DESCRIPTION"].ToString() + "&nbsp;</td>");

sb.Append("<td class=\"clsTableRowRight\" align=\"center\">" + r["QTY_AVAILABLE"].ToString() + "</td>");
sb.Append("</tr>");

if ((bool)r["SELECTED"])
{
sb.Append("<tr style='display:none;' class=\"clsTableRowHighlight\" id=\"row_eh_" + r["SEQ"].ToString() + "\" >");
sb.Append("<td class=\"clsTableRowHeadExpandedLeft\"><img onclick=\"javascript:CollapsePart('" + r["SEQ"].ToString() + "');\" src=\"img/Minus.gif\" border=\"0\" /> " + r["PN"].ToString() + "</td>");
sb.Append("<td class=\"clsTableRowHeadExpandedMiddle\">" + r["DESCRIPTION"].ToString() + "</td>");
sb.Append("<td class=\"clsTableRowHeadExpandedRight\" align=\"left\">Total Available:&nbsp;" + r["QTY_AVAILABLE"].ToString() + "</td>");
sb.Append("</tr>");


sb.Append("<tr style='display:none;' class=\"clsTableRowHighlight\" id=\"row_ed_" + r["SEQ"].ToString() + "\" >");
sb.Append("<td colspan=\"3\" class=\"clsTableRowDetailExpanded\">");
sb.Append("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"border-color: Red\">");
}
else
{
sb.Append("<tr style='display:none;' id=\"row_eh_" + r["SEQ"].ToString() + "\" onmouseover=\"javascript:HighlightRow(this, 'row_ed_" + r["SEQ"].ToString() + "', 'on');\" onmouseout=\"javascript:HighlightRow(this, 'row_ed_" + r["SEQ"].ToString() + "', 'off');\">");
sb.Append("<td class=\"clsTableRowHeadExpandedLeft\"><img onclick=\"javascript:CollapsePart('" + r["SEQ"].ToString() + "');\" src=\"img/Minus.gif\" border=\"0\" /> " + r["PN"].ToString() + "</td>");
sb.Append("<td class=\"clsTableRowHeadExpandedMiddle\">" + r["DESCRIPTION"].ToString() + "</td>");
sb.Append("<td class=\"clsTableRowHeadExpandedRight\" align=\"left\">Total Available:&nbsp;" + r["QTY_AVAILABLE"].ToString() + "</td>");
sb.Append("</tr>");


sb.Append("<tr style='display:none;' id=\"row_ed_" + r["SEQ"].ToString() + "\" onmouseover=\"javascript:HighlightRow(this, 'row_eh_" + r["SEQ"].ToString() + "', 'on');\" onmouseout=\"javascript:HighlightRow(this, 'row_eh_" + r["SEQ"].ToString() + "', 'off');\">");
sb.Append("<td colspan=\"3\" class=\"clsTableRowDetailExpanded\">");
sb.Append("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"border-color: Red\">");
}

int total_rDetail = dsResult.Tables[1].Select("PNM_AUTO_KEY = " + r["PNM_AUTO_KEY"].ToString()).Length;
int current_index = 0;

foreach (DataRow rdetail in dsResult.Tables[1].Select("PNM_AUTO_KEY = " + r["PNM_AUTO_KEY"].ToString()))
{
sb.Append("<tr>");

current_index++;
if (current_index < total_rDetail)
sb.Append(" <td width=\"40\" align=\"right\"><img src=\"img/T.gif\" border=\"0\" /></td>");
else
sb.Append(" <td width=\"40\" align=\"right\"><img src=\"img/L.gif\" border=\"0\" /></td>");

sb.Append(" <td width=\"40\" align=\"right\">Condition:&nbsp;</td>");
sb.Append(" <td width=\"30\">" + rdetail["CONDITION_CODE"].ToString() + "</td>");
sb.Append(" <td width=\"120\" align=\"right\">Location Code:&nbsp;</td>");
sb.Append(" <td >" + rdetail["LOCATION_CODE"].ToString() + "&nbsp;</td>");
sb.Append(" <td width=\"120\" align=\"right\">Cert Source:&nbsp;</td>");
sb.Append(" <td width=\"120\">" + rdetail["CERT_SOURCE"].ToString() + "&nbsp;</td>");
sb.Append(" <td align=\"right\" width=\"74\">Qty:&nbsp;</td>");
sb.Append(" <td width=\"74\">" + rdetail["QTY_AVAILABLE"].ToString() + "&nbsp;</td>");
sb.Append("</tr>");
}

int total_alternate = dsResult.Tables[2].Select("PNM_AUTO_KEY = " + r["PNM_AUTO_KEY"].ToString()).Length;
if (total_alternate > 0)
{
string alternatePartsString = string.Empty;


foreach (DataRow rAlternate in dsResult.Tables[2].Select("PNM_AUTO_KEY = " + r["PNM_AUTO_KEY"].ToString()))
{
alternatePartsString += rAlternate["ALT_PN"].ToString().Trim() + ", ";
}
alternatePartsString = alternatePartsString.Substring(0, alternatePartsString.Length - 2);
sb.Append("<tr><td colspan=\"9\">&nbsp;</td></tr>");
sb.Append("<tr>");
sb.Append(" <td width=\"40\">&nbsp;&nbsp;</td>");
sb.Append(" <td align=\"left\" colspan=\"8\">Alternate Part#:&nbsp;" + alternatePartsString + "</td>");
sb.Append("</tr>");
//sb.Append("<tr>");
//sb.Append(" <td width=\"40\">&nbsp;&nbsp;</td>");
//sb.Append(" <td align=\"left\" colspan=\"7\">" + alternatePartsString + "</td>");
//sb.Append(" <td width=\"74\">&nbsp;</td>");
//sb.Append("</tr>");
}
sb.Append("<tr><td colspan=\"9\">&nbsp;</td></tr>");
sb.Append("</table>");
sb.Append("</td>");
sb.Append("</tr>");
}

string sTemp = (string)dsResult.Tables[0].Rows[0]["SEQ"].ToString();
int pTemp = Convert.ToInt32(sTemp);
int nTemp = Convert.ToInt32(sTemp);
pTemp = pTemp - 9;
nTemp = nTemp + 9;

if (Convert.ToInt32(sTemp) <= 1)
{
btnPrevious10.Enabled = false;
ViewState["Previous10"] = null;
}
else
{
btnPrevious10.Enabled = true;
if (pTemp < 1) pTemp = 0;
ViewState["Previous10"] = pTemp.ToString();
}

if (nTemp >= Convert.ToInt32(dsResult.Tables[3].Rows[0]["Max_Seq"]))
{
ViewState["Next10"] = null;
ViewState["Previous10"] = Convert.ToString(pTemp);
btnNext10.Enabled = false;
}
else
{
ViewState["Next10"] = nTemp.ToString();
btnNext10.Enabled = true;
}
}
return sb.ToString();
}
catch (Exception ex)
{
throw (ex);
}
}
}

Last edited by mystic7 : July 1st, 2009 at 12:45 PM.

Reply With Quote
  #7  
Old July 1st, 2009, 04:43 PM
webgirl1 webgirl1 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2009
Posts: 4 webgirl1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 47 m 37 sec
Reputation Power: 0
So what's my next step?

So if it's asp.net code what do I need to do next? I'm thinking maybe I need to hire someone to do it for me.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgramming.NET Development > In Over My Head with ASP


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump





 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
Stay green...Green IT