Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.1
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 20th, 2004, 07:10 AM
Authorized User
 
Join Date: Jun 2004
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to gadhiav Send a message via Yahoo to gadhiav
Default Passing 2 values thru Hyperlink of DataGrid

Hi Frnds,
I haven't posted for a long time cos was getting a good hang of ASP.NET and from the topics posted on the forums. I have got some problem in my ASP.NET page.
I have a data grid as follows

Sr No. | Name |Address | RequestId(Hi dden) | Stauts

Now what i am doing is, my Sr no is a hyperlink coloumn, and on clik of it, i am passing the requestid id, i.e one parameter thru the querystring, which i am able to do so sucessfully. But I want to pass more than one value to the quesysting to the next page. Say in my DataBinder.Eval(Container.DataItem,"intRequestId", "ViewRequest.aspx?intRequestId={0}")).
I want to also send vcrStauts={1} with the string. How do i Do it???

Here in my project i want to pass RequestId as well as Status. The hyperlink look somewhat like this after clicking on Sr No.-:
http://localhost/Request/ViewRequest...ntRequestId=70

I hope you all would understand my problem and give me some hints to achieve what i want.
If you ppl want to know in more detail pl get back so that we can find a solution to this.
Any help would be great.
Looking for speedy replies.
Cheers
Vishal

Life is not the Triumph but the Struggle
__________________
Life is not the Triumph but the Struggle
 
Old December 23rd, 2004, 01:21 AM
Friend of Wrox
 
Join Date: Dec 2004
Posts: 307
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Vadivel Send a message via Yahoo to Vadivel
Default

Gadhiav,

The hyperlink columns DataNavigateUrlFormatString only supports one parameter. If you want more than one parameter in a hyperlink .. then make use of TemplateColumn with an <asp:Hyperlink>.

For example:

<asp:DataGrid id="DGProducts" runat="server" AutoGenerateColumns="False">
<Columns>
<asp:TemplateColumn HeaderText="Test Column">
   <ItemTemplate>
      <asp:Hyperlink runat="server" Text='<%#Container.DataItem("TextVal")%>' NavigateUrl='<%#"default.aspx?id=" & Server.UrlEncode(Container.DataItem("id")) & "fname=" & Server.UrlEncode(Container.DataItem("fname"))%>'/>
   </ItemTemplate>
</asp:TemplateColumn>

Best Regards
Vadivel

MVP ASP/ASP.NET
http://vadivel.thinkingms.com
 
Old December 28th, 2004, 03:38 AM
Authorized User
 
Join Date: Jun 2004
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to gadhiav Send a message via Yahoo to gadhiav
Default

Thanks for help Vadivel.
Will try out your suggestion, but was trying to avoid use of Template Column.
Thanks once agin.

Season's Greetings,
Vishal Gadhia

Life is not the Triumph but the Struggle
 
Old January 6th, 2005, 06:51 AM
Registered User
 
Join Date: Jan 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

but what if i what to write c# code behind?
how do i do it?
thanks






Similar Threads
Thread Thread Starter Forum Replies Last Post
hyperlink in a datagrid? bhavna General .NET 1 January 25th, 2007 12:37 PM
Passing values in DataGrid jezywrap ASP.NET 2.0 Professional 0 July 24th, 2006 10:20 AM
Creating a hyperlink with multiple values rayncarnation ASP.NET 1.0 and 1.1 Basics 0 October 13th, 2005 01:09 PM
Passing values to new row in a datagrid wolf27ea Pro VB.NET 2002/2003 2 March 23rd, 2004 09:58 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.