Solved

need to get URL parameter in a template column of a Gridview

Posted on 2007-03-19
4
329 Views
Last Modified: 2012-06-27
I want to append the URL parameter in the following gridview:

            <ItemTemplate>
                <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# "Update.aspx?RequestId="+DataBinder.Eval(Container.DataItem,"RequestId")+"&m=" %>'
                    Text='<%# Bind("RequestId") %>'></asp:HyperLink>
            </ItemTemplate>

basically, I was the value of "m" to be the value of the URL parameter, call it "m" too.

please help.
0
Comment
Question by:IUAATech
4 Comments
 
LVL 37

Expert Comment

by:samtran0331
ID: 18750468
have you tried adding the request.querystring in there?

<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# "Update.aspx?RequestId="+DataBinder.Eval(Container.DataItem,"RequestId")+"&m="+Request.Querystring("m") %>'
                    Text='<%# Bind("RequestId") %>'></asp:HyperLink>
0
 
LVL 14

Accepted Solution

by:
dfu23 earned 250 total points
ID: 18750484
Request.QueryString

<ItemTemplate>
  <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# "Update.aspx?RequestId="+DataBinder.Eval(Container.DataItem,"RequestId")+"&m="+Request.QueryString["m"] %>'Text='<%# Bind("RequestId") %>'></asp:HyperLink>
</ItemTemplate>
0
 
LVL 11

Expert Comment

by:DotNetThinker
ID: 18750503
NavigateUrl='<%# "Update.aspx?RequestId=" + DataBinder.Eval(Container.DataItem, "RequestId") + "&m=" + DataBinder.Eval(Container.DataItem, "m") %>'
0
 

Author Comment

by:IUAATech
ID: 18750529
didn't realize it was that easy :-)

Thanks.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Any Third party toll for Integrating chat system on ASP.NET ? 2 42
Remove greater than sign 3 69
Code works but it's slow 28 70
Need help with building query string 2 19
Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question