Re: Dynamic QueryString!
- From: "Patrick.O.Ige" <naijacoder@xxxxxxxxxxx>
- Date: Tue, 2 Aug 2005 11:09:32 +1000
Adam
Ken's solution would be handy and its more flexible but
Patrice's solution too would work since embedding such an expression
inside a literal string won't work
Make sure the NaviageURL looks like this = '<% %>'
with single quotes
Hope that helps
Patrick
"Ken Dopierala Jr." <kdopierala2@xxxxxxxxx> wrote in message
news:%23Qr0dOykFHA.1372@xxxxxxxxxxxxxxxxxxxxxxx
> Hi Adam,
>
> I don't have the code I used to use in front of me. I think I put a
> "Public" function in my code behind. Then here:
>
> NavigateUrl="index.aspx?aid=<%#
Container.DataItem("bsc_assmnt_area_id")%>"
>
> I did this:
>
> NavigateUrl="<%#
> MyPublicFunction(Container.DataItem("bsc_assmnt_area_id"))%>"
>
> Then I would have MyPublicFunction return the whole URL
"index.aspx?aid=10".
> The function would be of type string and receive the dataitem as a string
or
> integer. You may have to do a CStr or CInt around the Container.DataItem
> function. Another thing this allowed me to do at the time was switch that
> URL on the fly which I needed to do depending on the user's security
level.
> Good luck! Ken.
>
> --
> Ken Dopierala Jr.
> For great ASP.Net web hosting try:
> http://www.webhost4life.com/default.asp?refid=Spinlight
> If you sign up under me and need help, email me.
>
>
> "Adam Knight" <dev@xxxxxxxxxxxxxxxxx> wrote in message
> news:e6CpGjwkFHA.2920@xxxxxxxxxxxxxxxxxxxxxxx
> > Hi all,
> >
> > I am wanting to url the HyperLink server control in a datagrid.
> > I am trying to append the id field of the datagrid to the end of the
> > navigate url.
> > The code below is causing a problem.
> >
> > <asp:HyperLink ID="lnkArea" NavigateUrl="index.aspx?aid=<%#
> > Container.DataItem("bsc_assmnt_area_id")%>" Runat="server"><%#
> > Container.DataItem("name")%></asp:HyperLink>
> >
> > Can anyone enlighten me and let me know how to fix this?
> >
> > Cheers,
> > Adam
> >
> >
> >
>
>
.
- Prev by Date: Re: DropDownList selecteditem, then make some changes in textbox.
- Next by Date: Re: How prevent users from using BACK button in ASP.net?
- Previous by thread: Re: DropDownList selecteditem, then make some changes in textbox.
- Next by thread: Re: How prevent users from using BACK button in ASP.net?
- Index(es):