I have a gridview on a page with the select button generated:
I'm using this to get to the other page:
Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object,
ByVal e As System.EventArgs) Handles GridView1.SelectedIndexChanged
Response.Redirect("details1.aspx?Titleid=" &
GridView1.SelectedValue)
End Sub
This only gives me the TitleId. When I tried then wrote this but
getting incorrect string format:
Response.Redirect("details1.aspx?TitleID = " & Title & "&description=
" & GridView1.SelectedValue)
I have three text boxes on the other page to grab what's coming over
in a QueryString but I'm only getting the titleid.
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:TrainUserConnectionString %>"
SelectCommand="SELECT TitleID, Title, Descriptions FROM
dbo.Titles WHERE (TitleID = @TitleID) AND (Title = @title)">
<SelectParameters>
<asp:QueryStringParameter DefaultValue=""
Name="TitleID" QueryStringField="TitleID"
Type="Int32" />
<asp:QueryStringParameter Name="title"
QueryStringField="Title" />
</SelectParameters>
</asp:SqlDataSource>
How do I get the titleand description to appear in the text boxes on
the details1.aspx page?
Med - 11 Dec 2007 16:47 GMT
Try to remove spaces in the query string. I can see a space after TitleID
try:
Response.Redirect("details1.aspx?TitleID=" & Title & "&description=" &
GridView1.SelectedValue)
Regards
Med
>I have a gridview on a page with the select button generated:
>
[quoted text clipped - 31 lines]
> How do I get the titleand description to appear in the text boxes on
> the details1.aspx page?
Peter Bromberg [C# MVP] - 11 Dec 2007 18:08 GMT
Selected value returns the Datakey field values. Are you sure this is what
you want
http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.sele
ctedvalue.aspx
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
MetaFinder: http://www.blogmetafinder.com
> I have a gridview on a page with the select button generated:
>
[quoted text clipped - 31 lines]
> How do I get the titleand description to appear in the text boxes on
> the details1.aspx page?
JJ297 - 11 Dec 2007 19:35 GMT
On Dec 11, 1:08 pm, Peter Bromberg [C# MVP]
<pbromb...@yahoo.NoSpamMaam.com> wrote:
> Selected value returns the Datakey field values. Are you sure this is what
> you want?http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.gr...
[quoted text clipped - 40 lines]
>
> - Show quoted text -
I want to get the TitleID and other info associated with that
TitleID. In my stored procedure I'm asking for * back. I hope this
makes sense.