Solved

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

Posted on 2007-03-19
4
331 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
asp.net mvc5 6 29
ASP.Net MVC Login functions with my own Database and User Tables 2 35
vb.net convert long time to mm:ss 23 20
ASP.NET - Why is accordion not working? 3 46
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

763 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