misnstt
asked on
Displaying Search Results in Other page
I have a ASP.Net Page which includes a DropDown and the Selected item is displayed in a label:
Private Shared Sub DisplaySelection(dropdownl ist As Telerik.Web.UI.RadDropDown List, label As Label)
If dropdownlist.SelectedText <> [String].Empty Then
label.Text = dropdownlist.SelectedText
Else
label.Text = "RadDropDownList is empty"
End If
End Sub
Protected Sub RadDropDownList2_SelectedI ndexChange d(sender As Object, e As DropDownListEventArgs) Handles RadDropDownList2.SelectedI ndexChange d
DisplaySelection(RadDropDo wnList2, Label2)
End Sub
************************** ********** ********** ********** *****
I need to show the resulting record in a seperate page. The query I have in the Submit button is as follows:
Response.Redirect("SearchB yCity.aspx ?City=" & Convert.ToString(Me.Label2 .Text))
************************** ********** ********** ********** ********** *****
This is way wrong and im not sure how is should be.
The result page "SearchByCity.aspx" contains the following SQL DataSource:
<asp:SqlDataSource ID="SqlDataSource3" runat="server"
ConnectionString="<%$ ConnectionStrings:dbMyCMSC onnectionS tring %>"
SelectCommand="SELECT
UserProfiles.UserId
, UserProfiles.City
, Locations.city
, Locations.UserId
, Locations.id
FROM UserProfiles
INNER JOIN Locations
ON Locations.UserID = UserProfiles.UserID
AND (Locations.City = @City
OR UserProfiles.City = @City)">
<SelectParameters>
<asp:Parameter Name="City" />
</SelectParameters>
</asp:SqlDataSource>
Private Shared Sub DisplaySelection(dropdownl
If dropdownlist.SelectedText <> [String].Empty Then
label.Text = dropdownlist.SelectedText
Else
label.Text = "RadDropDownList is empty"
End If
End Sub
Protected Sub RadDropDownList2_SelectedI
DisplaySelection(RadDropDo
End Sub
**************************
I need to show the resulting record in a seperate page. The query I have in the Submit button is as follows:
Response.Redirect("SearchB
**************************
This is way wrong and im not sure how is should be.
The result page "SearchByCity.aspx" contains the following SQL DataSource:
<asp:SqlDataSource ID="SqlDataSource3" runat="server"
ConnectionString="<%$ ConnectionStrings:dbMyCMSC
SelectCommand="SELECT
UserProfiles.UserId
, UserProfiles.City
, Locations.city
, Locations.UserId
, Locations.id
FROM UserProfiles
INNER JOIN Locations
ON Locations.UserID = UserProfiles.UserID
AND (Locations.City = @City
OR UserProfiles.City = @City)">
<SelectParameters>
<asp:Parameter Name="City" />
</SelectParameters>
</asp:SqlDataSource>
ASKER
Hello thanks for this information however I need first to know how to query the SQL datasource on ny SearchByCity.aspx page. My current query on the submit button is :
Response.Redirect("SearchB yCity.aspx ?City=" & Convert.ToString(Me.Label2 .Text))
And this is not correct. Im not sure what needs to be changed to make it work.
Thanks
Response.Redirect("SearchB
And this is not correct. Im not sure what needs to be changed to make it work.
Thanks
What do you mean by it being not correct?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Overview:
http://msdn.microsoft.com/en-us/library/ms227551(v=vs.85).aspx
Look at disadvantages:
http://msdn.microsoft.com/en-us/library/z1hkazw7(v=vs.85).aspx