473,471 Members | 1,874 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

<FilterParameters>, please.... I'm stuck on this one !

Hi. On the first page of my website the user selects one document
which can be in either English or French. I store that choice in a
class, and I can extract it with:
CType(Session("UsersSessionClass"), UserSessionClass).SelLanguage

Later in my 'wizard' I have a page which contains this html:
__________________________________________________ ________________
<form id="frmStep4ConfigureDoYous" runat="server">

<%-- Store the language somewhere - it will be used for filtering the
SqlDataSource below --%>
<% Dim strScLang As String%>
<% strScLang = CType(Session("UsersSessionClass"),
UserSessionClass).SelLanguage%>
<% HyperLinkScorecardLanguage.Text = strScLang%>
<asp:HyperLink ID="HyperLinkScorecardLanguage" runat="server"></
asp:HyperLink>
<div>
__________________________________________________ ________________
(For some reason I could not assign the language directly to the text
property of the HyperLink).
I can see the language 'FR' or 'EN', depending on the choice on the
first page. So far so good.

In the same page, below, I have the HTML:
__________________________________________________ ________________
<asp:DropDownList ID="cboDoYou"
AppendDataBoundItems="True"
DataSourceID="DoYousSqlDataSource"
DataTextField="DoYou"
DataValueField="DoYou"
runat="server">
</asp:DropDownList>
<asp:SqlDataSource
ID="DoYousSqlDataSource"

SelectCommand="SELECT DISTINCT
Principles.[Principle ID] as PrincipleID,
DoYous.[DoYou Description] as DoYou,
DoYous.[DoYou Language] as ScorecardLanguage
FROM DoYous_BY_Principle_BY_ScType
INNER JOIN Principles
ON DoYous_BY_Principle_BY_ScType.[Principle ID] = Principles.
[Principle ID]
INNER JOIN DoYous
ON DoYous_BY_Principle_BY_ScType.[DoYou ID] = DoYous.[DoYou ID]"

EnableCaching="True"
CacheDuration="60"
FilterExpression="PrincipleID = {0} AND ScorecardLanguage = '{1}'"
ConnectionString="Data Source='...."
RunAt="server">

<FilterParameters>
<asp:ControlParameter ControlID="HyperLinkPrincipleID"
PropertyName="Text" />
<asp:ControlParameter ControlID="HyperLinkScorecardLanguage"
PropertyName="Text" />
</FilterParameters>
</asp:SqlDataSource>
__________________________________________________ ________________
Question 1. Although I can clearly see the language in the control
'HyperLinkScorecardLanguage' at the beginning of the page, I can't
reference it in my FilterParameters, meaning that it does not throw an
error, but it doesn't filter properly either - it populates cboDoYou
with the values from the 'DoYou' column of table DoYous, for the
correct PrincipleID (the one on the current row in the repeater), but
for BOTH EN and FR....

However, if I hardcode the FilterExpression to
FilterExpression="PrincipleID = {0} AND ScorecardLanguage = 'EN'"
or
FilterExpression="PrincipleID = {0} AND ScorecardLanguage = 'FR'"
it all works great !
If in break mode in the code-behind page I interrogate
HyperLinkScorecardLanguage.text, it returns an empty string (although
I can see 'EN' in the HyperLinkScorecardLanguage control !), so
therefore I guess I'm not referencing the HyperLinkScorecardLanguage
control properly in my line
<asp:ControlParameter ControlID="HyperLinkScorecardLanguage"
PropertyName="Text" />

What is the correct syntax, please ? Where is my problem ?

Question 2. Instead of hardcoding
ConnectionString="Data Source='blah-blah-blah...."
I would like to use the setting from WebConfig
<appSettings>
<add key="ConnectionString" value="Data Source=..."/>
by using
System.Configuration.ConfigurationManager.AppSetti ngs("ConnectionString")
as in:
ConnectionString='<%=
System.Configuration.ConfigurationManager.AppSetti ngs("ConnectionString")
%>'
but this does not work ! How can I specify the connection string in
this case ?

Thanks a lot !
Alex.

Feb 22 '07 #1
0 1036

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Peter Jenkins | last post by:
http://www.safenz.org.nz/New/index.htm Only link working off this currently is the sitemap. I have all the access keys going except the skip navigation Please advise if any accessibility issues...
3
by: chris kramer | last post by:
i have an application that allows you to Select some text in a window, but no option to Copy it to the clipboard (nor does Ctrl-C or Shift-insert work, or right click etc..) i want to get these...
5
by: Erwin Kloibhofer | last post by:
what if i have a webpage that displays the text "please wait, this may take a few seconds..." and it now waits until some event on the server happens. whatever this is, this can be quick, but it...
1
by: James C. Li | last post by:
Hi, I've a windows' form application written in C#. I want to drag a url's link from a website application onto my windows' form TreeView control. I've been able to achieve the following 1.)...
4
by: Karunakararao | last post by:
Hi all Please Convert the VB.Net to C# .NET Sub CustomPager(ByVal STCPagerGrid As Object) Dim intCtr As Integer Static intLastItem As Integer Static intCount As Integer Static intTotalPage,...
0
by: Ravi.Gooty | last post by:
Testing Please ignore this message
3
by: phanimadhav | last post by:
Hi friends this is my select statement SELECT user_accountID,Expensive = case quotaAmount when quotaNo = 'quota1' then sum(quotaAmount) else 0 end FROM user_accounts Msg 102, Level 15, State...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.