[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.5

Disable/Enable Links to another page...

Asked by dmasini in Programming for ASP.NET

Tags: Microsoft, VWD 2005, VB

Experts...

Yes...still a rookie here so I'll try to be as clear as possible.  I have 2 .aspx pages:

Page 1) products_lookup22.aspx
Page 2) products_EMail.aspx

"Page 1" has a search then a gridview (Like a Summary) that list general information about a product as in:

(Summary)
             "Catalog"                   "Vendor"                    "Description"                 "Rec#"
details   77L8453001D           ADVANCE                 400 WHPS BLST             38
details   TQC1110WL             GE-ED&C                   BRKR CIRCUIT 1P10A     1424
details   ICQ693MDL330        GE-ED&C                    OUT MODULE 2A           1674
details   IC697PWR711          GE-FANUC                 9070 POW SUP              1682
(ETC...)


IF the user clicks on the link "details" we open a "DetailsView" just below the summary grid that provides specifics on just the single record (example: we click "details" for record 38).  We see...

(Details)
Vendor:            ADVANCE
CATALOG:       77L8453001D
DESCRIPTION:  400 WHPS BLST            
NAED V/I:         781087-11529
SOLD BY:        EA
IN STOCK:        6
LIST PRICE:      $133.66    

Now the problem is when I first bring up the first page (products_lookup22.aspx) it has a Search box that cannot be blank (using a validator)...so when the user enters any text/values it does the search BUT I (currently) provide a link to page 2 (products_EMail.aspx) that needs to pass the param RecordID2.  If they don't click on a specific detail in the Summary we have no param to pass and it blows up (obviously)!

I need to "Grey Out" the option "Request a Quote for this Item..." until they actually click on the detail link (as shown in products_lookup22.aspx).  Once they do it needs to 'enable' the link "Request a Quote for this Item...".

Any ideas would be appreciated.  Code Snippet attanched.

Thanks again...

dm
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
211:
212:
213:
214:
215:
216:
<%@ Page Language="VB" Debug="True" %>
 
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<script runat="server">
 
Protected Sub DetailsView1_PageIndexChanging(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DetailsViewPageEventArgs)
End Sub
 
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
End Sub
 
Protected Sub SqlDataSource2_Selecting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceSelectingEventArgs)
End Sub
    
Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridView1.SelectedIndexChanged
Me.HyperLink1.NavigateUrl = "~/products_EMail.aspx?RecordID2=" & GridView1.DataKeys(GridView1.SelectedIndex).Value.ToString
End Sub
    
</script>
 
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Product Inquiry</title>
</head>
<body>
<form id="form1" runat="server">
<div>
&nbsp;
 
<asp:Panel ID="Panel1" runat="server" Height="1px" Width="850px" style="left: 4px; position: absolute; top: 10px;">
 
<asp:Label ID="Label3" runat="server" Font-Bold="True" Font-Size="Small" Style="font-weight: bold;font-size: 12pt; color: darkblue; font-style: normal; font-family: verdana;" Text="Search for:" Width="104px"></asp:Label>
 
<asp:TextBox ID="TextBox2" runat="server" Width="316px"></asp:TextBox>
<asp:Button ID="Button2" runat="server"
Text="Go..." Width="84px" style="position: absolute; top: 1px" /><br />
 
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
 
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TextBox2"
ErrorMessage="(Search Box cannot be Blank...)" SetFocusOnError="True"></asp:RequiredFieldValidator>
            
<br />
<asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate>
<asp:Label ID="Label4" runat="server" Font-Bold="True" Font-Size="Small" Style="font-weight: bold;font-size: 10pt; color: darkblue; font-style: normal; font-family: verdana;" Text="Total Records found:" Width="176px"></asp:Label><br />
 
<br />
<asp:Image ID="Image2" runat="server" ImageUrl="~/images/summary-banner.jpg" /><br />
                    
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" CellPadding="2" DataSourceID="SqlDataSource2" ForeColor="#333333"GridLines="None" DataKeyNames="RecordID"OnSelectedIndexChanged="GridView1_SelectedIndexChanged">
 
<PagerSettings FirstPageImageUrl="~/images/first-record.bmp" FirstPageText="First Page..." LastPageImageUrl="~/images/last-record.bmp" LastPageText="Last Page..." Mode="NextPreviousFirstLast"
NextPageImageUrl="~/images/next-record.bmp" NextPageText="Next Page..." Position="Top" PreviousPageImageUrl="~/images/previous-record.bmp" PreviousPageText="Previous Page..." />
<FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
<RowStyle BackColor="#FFFBD6" ForeColor="#333333" /
<Columns><asp:CommandField SelectText="Details" ShowSelectButton="True">
<HeaderStyle BackColor="#C00000" Font-Bold="True" Font-Size="X-Small" HorizontalAlign="Left"Width="30px" Wrap="False" />
<ItemStyle Font-Bold="True" Font-Size="X-Small" HorizontalAlign="Left" Width="30px"Wrap="False" />
</asp:CommandField>
                    
<asp:BoundField DataField="CTCATALOG" HeaderText="Catalog" SortExpression="CTCATALOG">
<HeaderStyle BackColor="#C00000" Font-Bold="True" Font-Size="X-Small" HorizontalAlign="Left"
Width="200px" Wrap="False" />
<ItemStyle Font-Bold="True" Font-Size="X-Small" HorizontalAlign="Left" Width="200px"
Wrap="False" />
</asp:BoundField>
                    
<asp:BoundField DataField="CTMFGNAME" HeaderText="Vendor" SortExpression="CTMFGNAME">
<HeaderStyle BackColor="#C00000" Font-Size="X-Small" HorizontalAlign="Left" Width="150px" />
<ItemStyle Font-Bold="True" Font-Size="X-Small" HorizontalAlign="Left" Width="150px"
Wrap="False" />
</asp:BoundField>
 
<asp:BoundField DataField="CTDESCRIPTION" HeaderText="Description" SortExpression="CTDESCRIPTION">
<HeaderStyle Font-Size="X-Small" HorizontalAlign="Left" Width="200px" Wrap="False" BackColor="#C00000" />
<ItemStyle Font-Bold="True" Font-Size="X-Small" HorizontalAlign="Left" Width="200px"
Wrap="False" />
 
</asp:BoundField><asp:BoundField DataField="RecordID" HeaderText="Rec#" InsertVisible="False" SortExpression="RecordID">
<HeaderStyle BackColor="#C00000" Font-Bold="True" Font-Size="X-Small" HorizontalAlign="Right"
Width="32px" Wrap="False" />
<ItemStyle Font-Bold="True" Font-Size="X-Small" HorizontalAlign="Right" Width="32px"
Wrap="False" />
</asp:BoundField>
                
</Columns>
<PagerStyle BackColor="#C00000" ForeColor="#333333" HorizontalAlign="Left" />
<SelectedRowStyle BackColor="Navy" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#C00000" Font-Bold="True" ForeColor="White" Width="636px" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>
<asp:Image ID="Image1" runat="server" ImageUrl="~/images/details-banner.jpg" Width="632px" /><br />
<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" CellPadding="2"
DataSourceID="SqlDataSource3" ForeColor="#333333" GridLines="None" Height="50px"
                    OnPageIndexChanging="DetailsView1_PageIndexChanging" Width="632px">
<FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
<CommandRowStyle BackColor="#FFFFC0" Font-Bold="True" />
<RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
<FieldHeaderStyle BackColor="#FFFF99" Font-Bold="True" />
<PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
 
<Fields>
<asp:BoundField DataField="CTMFGNAME" HeaderText="Vendor:" SortExpression="CTMFGNAME">
<HeaderStyle BackColor="Navy" Font-Bold="True" Font-Size="Small" ForeColor="White"
HorizontalAlign="Right" Width="100px" Wrap="False" />
<ItemStyle Font-Bold="True" Font-Size="Small" />
</asp:BoundField>
                        
<asp:BoundField DataField="CTCATALOG" HeaderText="Catalog:" SortExpression="CTCATALOG">
<HeaderStyle BackColor="Navy" Font-Bold="True" Font-Size="Small" ForeColor="White"
HorizontalAlign="Right" Width="100px" Wrap="False" />
<ItemStyle Font-Bold="True" Font-Size="Small" />
</asp:BoundField>
                        
<asp:BoundField DataField="CTDESCRIPTION" HeaderText="Description:" SortExpression="CTDESCRIPTION">
<HeaderStyle BackColor="Navy" Font-Bold="True" Font-Size="Small" ForeColor="White"
HorizontalAlign="Right" Width="100px" />
<ItemStyle Font-Bold="True" Font-Size="Small" />
</asp:BoundField>
 
<asp:BoundField DataField="DISTSKU" HeaderText="NAED V/I:" SortExpression="DISTSKU">
<HeaderStyle BackColor="Navy" Font-Bold="True" Font-Size="Small" ForeColor="White"
HorizontalAlign="Right" Width="100px" Wrap="False" /
<ItemStyle Font-Bold="True" Font-Size="Small" />
</asp:BoundField>
                        
<asp:BoundField DataField="CTUM" HeaderText="Sold by:" SortExpression="CTUM">
<HeaderStyle BackColor="Navy" Font-Bold="True" Font-Size="Small" ForeColor="White"
HorizontalAlign="Right" Width="100px" Wrap="False" />
<ItemStyle Font-Bold="True" Font-Size="Small" />
</asp:BoundField>
                        
<asp:BoundField DataField="ShippedQtyPAM" HeaderText="In Stock:" SortExpression="ShippedQtyPAM">
<HeaderStyle BackColor="Navy" Font-Bold="True" Font-Size="Small" ForeColor="White"
HorizontalAlign="Right" Width="100px" Wrap="False" />
<ItemStyle Font-Bold="True" Font-Size="Small" />
</asp:BoundField>
 
<asp:BoundField DataField="CurrSellPricePAM" DataFormatString="{0:c} (Negotiated pricing, SPA and qty/breakpoint pricing available!)" HeaderText="List Price:"
HtmlEncode="False" SortExpression="CurrSellPricePAM">
<HeaderStyle BackColor="Navy" Font-Bold="True" Font-Size="Small" ForeColor="White"HorizontalAlign="Right" Width="100px" Wrap="False" />
<ItemStyle Font-Bold="True" Font-Size="Small" BackColor="Navy" ForeColor="Yellow" />
</asp:BoundField>
</Fields>
                    
<HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" />
</asp:DetailsView>
                    
&nbsp;&nbsp;<br />
&nbsp;&nbsp;
 
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/products_EMail.aspx?RecordID2=RecordID" Target="_self" Font-Bold="True" ForeColor="Navy" Enabled="False">Request a Quote for this Item...</asp:HyperLink></a>
</ContentTemplate>
            
</asp:UpdatePanel>
            
<br />
            
&nbsp;
        
<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" Font-Bold="True" Font-Names="Verdana" Font-Size="Small" ForeColor="Maroon" GridLines="None"
PageSize="1" ShowHeader="False" Style="position: absolute; left: 184px; top: 44px;"Width="88px">
 
<Columns>
<asp:BoundField DataField="norecs" NullDisplayText="Sorry...No records found matching the search string...)"
ReadOnly="True" ShowHeader="False" SortExpression="norecs">
<ItemStyle Font-Bold="True" Font-Size="Small" ForeColor="Maroon" />
</asp:BoundField>
</Columns>
</asp:GridView>
            
&nbsp;<br />
 
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:IDC_Receiving %>"
SelectCommand="SELECT CTMFGNAME, CTSTOCK, CTCATALOG, CTDESCRIPTION, DISTSKU, CTUM, COMMODITYNAME, RecordID FROM [Cooper-Master-Items-Table] WHERE (CTMFGNAME LIKE '%' + @CTCATALOG + '%') AND (IDCPROVIDERCODE = 'IDC001') OR (CTCATALOG LIKE '%' + @CTCATALOG + '%') AND (IDCPROVIDERCODE = 'IDC001') OR (CTDESCRIPTION LIKE '%' + @CTCATALOG + '%') AND (IDCPROVIDERCODE = 'IDC001') OR (DISTSKU LIKE '%' + @CTCATALOG + '%') AND (IDCPROVIDERCODE = 'IDC001') OR (COMMODITYNAME LIKE '%' + @CTCATALOG + '%') AND (IDCPROVIDERCODE = 'IDC001') ORDER BY RecordID" OnSelecting="SqlDataSource2_Selecting">
                
<SelectParameters>
<asp:ControlParameter ControlID="TextBox2" Name="CTCATALOG" PropertyName="Text" />
</SelectParameters>
</asp:SqlDataSource>
 
&nbsp;&nbsp;<br />
 
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:IDC_Receiving %>"
SelectCommand="SELECT COUNT('DISTINCT @CTCATALOG') AS norecs FROM [Cooper-Master-Items-Table] WHERE ((CTMFGNAME LIKE '%' + @CTCATALOG + '%') OR (CTCATALOG LIKE '%' + @CTCATALOG + '%') OR (CTDESCRIPTION LIKE '%' + @CTCATALOG + '%') OR (DISTSKU LIKE '%' + @CTCATALOG + '%') OR (COMMODITYNAME LIKE '%' + @CTCATALOG + '%')) AND (IDCPROVIDERCODE = 'IDC001')">
                
<SelectParameters>
<asp:ControlParameter ControlID="TextBox2" Name="CTCATALOG" PropertyName="Text" />
</SelectParameters>
            
</asp:SqlDataSource>
&nbsp;<br />
            
<asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:IDC_Receiving %>"
SelectCommand="SELECT [CTMFGNAME], [CTCATALOG], [CTDESCRIPTION], [DISTSKU], [CTUM], [ShippedQtyPAM], [CurrSellPricePAM] FROM [Cooper-Master-Items-Table] WHERE ([RecordID] = @RecordID)">
 
<SelectParameters>
<asp:ControlParameter ControlID="GridView1" Name="RecordID" PropertyName="SelectedValue"
Type="Int32" />
</SelectParameters>
 
</asp:SqlDataSource>
&nbsp;
</asp:Panel>
        
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div>
 
</form>
</body>
</html>
[+][-]03/31/08 08:32 PM, ID: 21251044Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: Programming for ASP.NET
Tags: Microsoft, VWD 2005, VB
Sign Up Now!
Solution Provided By: brwwiggins
Participating Experts: 1
Solution Grade: A
 
[+][-]04/03/08 12:01 PM, ID: 21275785Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-92 / EE_QW_2_20070628