473,804 Members | 2,085 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

GridView Hyperlink Field Append URL?

I'm trying to create a link in my gridview that will include the
existing url parameters plus the ID of the field. I've tried
everything I can think of to get it to work but this was my latest
attempt below. I'm new to using asp.net and I'm just used to
building my own url's in php and this is just so different the way
they go about it. I've tried about 5 different processes.
<asp:HyperLinkF ield DataNavigateUrl Fields="WONo"
DataNavigateUrl FormatString="D etail.aspx?Star tDate=<%#
Request.QuerySt ring("StartDate ")
%>&amp;EndDate= <%#
Request.QuerySt ring("EndDate")
%>&amp;WO={0}"D ataTextField="W ONo"
/>
----------------------------------
http://community.ihostasp.net
ASP.NET Developer Community
Oct 11 '06 #1
1 1828
You can try TemplateField instead:

....
<Columns>
<asp:TemplateFi eld>
<ItemTemplate >
<a href='<%# "default.aspx?S tartDate=" +
Request.QuerySt ring["StartDate"] + "&EndDate=" +
Request.QuerySt ring["EndDate"] + "&wo=" +
DataBinder.Eval (Container.Data Item, "WONo") %>'>
<%# DataBinder.Eval (Container.Data Item, "WONo") %>
</a>
</ItemTemplate>
</asp:TemplateFie ld>
....
</Columns>

"barkster" <ba*****@fusion xstudio-dot-com.no-spam.invalidwro te in message
news:xu******** *************** *******@giganew s.com...
I'm trying to create a link in my gridview that will include the
existing url parameters plus the ID of the field. I've tried
everything I can think of to get it to work but this was my latest
attempt below. I'm new to using asp.net and I'm just used to
building my own url's in php and this is just so different the way
they go about it. I've tried about 5 different processes.
<asp:HyperLinkF ield DataNavigateUrl Fields="WONo"
DataNavigateUrl FormatString="D etail.aspx?Star tDate=<%#
Request.QuerySt ring("StartDate ")
%>&amp;EndDate= <%#
Request.QuerySt ring("EndDate")
%>&amp;WO={0}"D ataTextField="W ONo"
/>
----------------------------------
http://community.ihostasp.net
ASP.NET Developer Community

Oct 12 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2214
by: hammad.awan_nospam | last post by:
Hello, I am using ASP.NET 2.0. What I have done is nested a gridview inside another column of a gridview using a template data field column declaritively in my web form. Inside this child gridview I have set an ItemStyle property of width 20% for the first templated field which contains a hyperlink control, and an ItemStyle of width 80% for the second templated field which contains a label. Both of these controls are databound to...
4
8617
by: Greg Strong | last post by:
Hello All, Ok I've read it is not necessarily a good ideal to create a hyperlink field in a database, but I've tried. I've also read that a hyperlink field is a memo field with attributes of dbHyperlinkField + dbVariableField. So I tried using the code below, and received the error below. Any ideals? Thanks! ,----- | Run-time error '3010':
1
2102
by: Carlos | last post by:
Hi all, I need a field that it is both databound, and hyperlink in a gridview. That is, the value is obtained from a query, and at the same time needs to point to a new page where will be used to make another query. How can this be possible in asp .net? Thanks in advance, Carlos.
4
11901
by: Jeff | last post by:
Hi, I have a ASP.NET 2.0 Web Application. Many of the pages use the ASP.NET GridView with paging and sorting. One of the columns of this Gridview is a template column (LinkButton). The data being retrieved and showed in this GridView produce more than one page of data. A given user clicks on the first row hyper link on the Grid on the first page, then the first row hyper link color changes to look as "visited". Then the user navigates to...
1
3061
by: Author | last post by:
I got into trouble with this problem. The data I am presenting in a GridView control has a column called "Website". That data comes from a stored procedure in SQL Server 2000. Most of them have valid http urls. But some of them say "None" or "Not available". In the GridView, I would like create a hyperlink for those valid http urls only, and simply plain-output those which say "None" or "Not available".
0
9595
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10354
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10359
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10101
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7643
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5536
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5675
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4314
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3005
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.