0

I have the following code:

[<asp:GridView ID="GridView1" runat="server" HorizontalAlign="Center" 
            AutoGenerateColumns="False" DataSourceID="SqlDataSource1">
            <Columns>
                <asp:BoundField DataField="SchedName" HeaderText="SchedName" 
                    SortExpression="SchedName" />
                <asp:BoundField DataField="ActivityDate" HeaderText="ActivityDate" 
                    ReadOnly="True" SortExpression="ActivityDate" />
                <asp:BoundField DataField="By" HeaderText="By" SortExpression="By" />
                <asp:BoundField DataField="Activity" HeaderText="Activity" ReadOnly="True" 
                    SortExpression="Activity" />
                <asp:BoundField DataField="FirstListing" HeaderText="FirstListing" 
                    SortExpression="FirstListing" />
            <asp:HyperLinkField DataTextField="OnCallStart" HeaderText="OncallStart" DataNavigateUrlFields="SchedName,OncallStart"    
                    DataNavigateUrlFormatString="\website1\Default2.aspx?date={0:d}&amp;schedule={1}" 
                    SortExpression="OnCallStart" NavigateUrl="\website1\default2.aspx"  /> 
                <asp:BoundField DataField="OnCallEnd" HeaderText="OnCallEnd" ReadOnly="True" 
                    SortExpression="OnCallEnd" />
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:MDRConnectionString %>" 
            SelectCommand="sp_getoncallresults2" SelectCommandType="StoredProcedure">
            <SelectParameters>
                <asp:ControlParameter ControlID="sincedateTextBox" DbType="DateTime" 
                    Name="sincedate" PropertyName="Text" />
                <asp:ControlParameter ControlID="schednameTextBox" Name="schedname" 
                    PropertyName="Text" Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>

and what I'm trying to do is to pass the values of the hyperlink field to default2.aspx, which will then sends the variable of "date" and "schedname" to a stored SQL procedure. The problem is that the link for the hyperlink field doesn't show up in the field so users can't click on it to take them to the second page and my the stored procedure isn't firing on the second page. I don't know what I'm missing in the above code that's not allowing this to work. Can someone please assist?

Thank you

Doug

4
Contributors
5
Replies
6
Views
6 Years
Discussion Span
Last Post by crishjeny
0

I know that I can use Request, Session or Cookie and according to the code I gave above, what I'm attempting to do is to pass it in the URL and then a request.query when I configure the datasource that will fill my datagrid view for my second page. The problem is at this point 2 things:
1. The URL link in the table isn't showing up (on default.aspx ... the field of OncallCall Start is supposed to be the link)
2. When it was showing up and I clicked on the link, the values are being passed (I could see them in the URL) but the datatable wasnt being filled.

0

Hi adata post can he use Hiden Fileds also?

No! Hidden field is used to write value within the page. (Page scope). Session is the best option for me.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.