Ask a Question related to ASP.NET Building Controls, Design and Development.
-
eRic #1
Multiple Parameters With Hyperlink in DataGrid
I have a datagrid with a hyperlinkcontrol column. And it will only take one
parameter. So I created a template column, with a hyperlink based on an
example I saw. (now working directly in the aspx page as opposed to the code
behind) It uses the NavigateURL and then useses
Container.DataItem("itemName") to set the item values inline (so
'someUrl.com?item=.' + Container.DataItem("itemName") ) First off I'm doing
this in C# so I changed the call to Container.DataItem["itemName"]. Now it
throwsa HTML excepetion because the "object" cannot be index. any
suggestions on how to do this. I have tried casting the container but to no
avail.
My overall goal is to pass 2 parameters in a query string of a hyperlink
that is embeded in a datagrid. :)
THANKS!!
eRic
eRic Guest
-
Multiple (Duplicate) Hyperlink Issue
Did you ever solve the problem? I have several sources that I want to link to the same (URL) destination. It seems that each one has to have its... -
ASP - Multiple URL Parameters ?? Howto
Using DWMX and ASP, how can I take advantage of multiple URL parameters? For example, I'd like to pass both the month and day as:... -
DataGrid HyperLink Column - How can I put multiple fields in the URL field
Hi everyone, How can I put multiple fields in the Datagrid Hyperlink Colume - URL FIELD ? I need to buidl an URL like: ... -
pass 2 parameters using HyperLink column?
is it possible? thanks TIA. -
Passing multiple values accross a hyperlink ?
Hi, I have a link as follows: <A HREF=""Tracker.asp?MovementID=" & RS("MovementID") & " PONumber=" & RS("PONumber") & """>" & RS("MovementID")... -
Victor Garcia Aprea [MVP] #2
Re: Multiple Parameters With Hyperlink in DataGrid
Hi Eric,
Could you post a code snippet along with the exact text for the error?
--
Victor Garcia Aprea
Microsoft MVP | ASP.NET
Looking for insights on ASP.NET? Read my blog:
[url]http://obies.com/vga/blog.aspx[/url]
To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
and not by private mail.
"eRic" <ezadler@hotmail.com> wrote in message
news:eZqQzunRDHA.2008@TK2MSFTNGP11.phx.gbl...one> I have a datagrid with a hyperlinkcontrol column. And it will only takecode> parameter. So I created a template column, with a hyperlink based on an
> example I saw. (now working directly in the aspx page as opposed to thedoing> behind) It uses the NavigateURL and then useses
> Container.DataItem("itemName") to set the item values inline (so
> 'someUrl.com?item=.' + Container.DataItem("itemName") ) First off I'mit> this in C# so I changed the call to Container.DataItem["itemName"]. Nowno> throwsa HTML excepetion because the "object" cannot be index. any
> suggestions on how to do this. I have tried casting the container but to> avail.
>
> My overall goal is to pass 2 parameters in a query string of a hyperlink
> that is embeded in a datagrid. :)
>
> THANKS!!
> eRic
>
>
Victor Garcia Aprea [MVP] Guest
-
David Rothgery #3
Re: Multiple Parameters With Hyperlink in DataGrid
"Victor Garcia Aprea [MVP]" <vga@NOobiesSPAM.com> wrote in message
news:OYBZrXASDHA.2460@TK2MSFTNGP10.phx.gbl...
[borrowing Victor's post because I lost the original on my newsspool]
to> "eRic" <ezadler@hotmail.com> wrote in message
> news:eZqQzunRDHA.2008@TK2MSFTNGP11.phx.gbl...> one> > I have a datagrid with a hyperlinkcontrol column. And it will only take> code> > parameter. So I created a template column, with a hyperlink based on an
> > example I saw. (now working directly in the aspx page as opposed to the> doing> > behind) It uses the NavigateURL and then useses
> > Container.DataItem("itemName") to set the item values inline (so
> > 'someUrl.com?item=.' + Container.DataItem("itemName") ) First off I'm> it> > this in C# so I changed the call to Container.DataItem["itemName"]. Now> > throwsa HTML excepetion because the "object" cannot be index. any
> > suggestions on how to do this. I have tried casting the container butJust as a note...> no> > avail.
> >
> > My overall goal is to pass 2 parameters in a query string of a hyperlink
> > that is embeded in a datagrid. :)
It might be a little bit cheesy, but why not build the query string for each
row in SQL (something like like SELECT 'item1=' + item1 + '&item2=' + item2
AS QueryString) and then use that in your datagrid?
--
Dave Rothgery
[email]drothgery@alum.wpi.edu[/email]
David Rothgery Guest
-
Joe Glover #4
Re: Multiple Parameters With Hyperlink in DataGrid
Hi eRic
Forgetting about template columns for the time being, I think the following
should work for you:
<asp:HyperLinkColumn DataNavigateUrlField="itemName"
DataNavigateUrlFormatString="someUrl.com?item={0}"
DataTextField="itemName"></asp:HyperLinkColumn>
HTH
Joe
"eRic" <ezadler@hotmail.com> wrote in message
news:eZqQzunRDHA.2008@TK2MSFTNGP11.phx.gbl...one> I have a datagrid with a hyperlinkcontrol column. And it will only takecode> parameter. So I created a template column, with a hyperlink based on an
> example I saw. (now working directly in the aspx page as opposed to thedoing> behind) It uses the NavigateURL and then useses
> Container.DataItem("itemName") to set the item values inline (so
> 'someUrl.com?item=.' + Container.DataItem("itemName") ) First off I'mit> this in C# so I changed the call to Container.DataItem["itemName"]. Nowno> throwsa HTML excepetion because the "object" cannot be index. any
> suggestions on how to do this. I have tried casting the container but to> avail.
>
> My overall goal is to pass 2 parameters in a query string of a hyperlink
> that is embeded in a datagrid. :)
>
> THANKS!!
> eRic
>
>
Joe Glover Guest
-
Eric Adler #5
Re: Multiple Parameters With Hyperlink in DataGrid
Yeah, adding 1 parameter to the query string is straight forward,
unfortuately I was trying to add at least 2 parameters. That's why I
needed the template column and the hyperlink control
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Eric Adler Guest
-
Eric Adler #6
Re: Multiple Parameters With Hyperlink in DataGrid
Shoot I wish I had captured the error better. I had a tight deadline so
I need came up with a different solution. One where I only needed the
one, easy, query string value. So, in your opinion, was I on the right
track?
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Eric Adler Guest



Reply With Quote

