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

Home Posts Topics Members FAQ

Gridview, DataNavigateUrl FormatString and request.queryst ring

Thanks in advance for any help you can give me on this.

I am trying to include the value from a request.queryst ring in the
DataNavigateUrl FormatString

I am able to include one of the values which comes from the database
to make a link with the syntax

http://server/work_order.asp?WorkOrd...45678&Site=NYC but I cannot
get the NYC value to work from a request.queryst ring when submitted
from http://server/default.aspx?Site=NYC

<asp:GridView ID="GridView1" runat="server"
AutoGenerateCol umns="False"
DataSourceID="S qlDataSource1" CellPadding="4"
Font-Size="Small" ForeColor="#333 333" GridLines="None ">
<Columns>
<asp:HyperLinkF ield
DataNavigateUrl Fields="Work_Or der"

DataNavigateUrl FormatString="h ttp://server/work_order.asp? WorkOrder={0}&a mp;Site="
DataTextField=" Work_Order"
HeaderText="Lin kField"
Target="_blank" />

DataNavigateUrl FormatString="h ttp://server/work_order_prin t.asp?WorkOrder ={0}&amp;Site=< %=Site
%>"

Becomes

<a
href="http://server/work_order.asp? WorkOrder=12345 678&amp;Site=&l t;%=Site
%>

If I try

DataNavigateUrl FormatString="h ttp://server/work_order.asp? WorkOrder={0}&a mp;Site="
+ <%=Site %>
It errors with
DataNavigateUrl FormatString="h ttp://server/work_order.asp? WorkOrder={0}&a mp;Site="
+') is not allowed within a
'System.Web.UI. WebControls.Dat aControlFieldCo llection'.

Line 27:
DataNavigateUrl FormatString="h ttp://server/work_order.asp. asp?WorkOrder={ 0}&amp;Site="
+ <%=Site %>

Thanks again from a new asp.net user.
Jan 8 '07 #1
2 10615
On Jan 7, 10:13 pm, Ixnay <w...@where.com wrote:
Thanks in advance for any help you can give me on this.

I am trying to include the value from a request.queryst ring in the
DataNavigateUrl FormatString

I am able to include one of the values which comes from the database
to make a link with the syntax

http://server/work_order.asp?WorkOrd...78&Site=NYCbut I cannot
get the NYC value to work from a request.queryst ring when submitted
from http://server/default.aspx?Site=NYC

<asp:GridView ID="GridView1" runat="server"
AutoGenerateCol umns="False"
DataSourceID="S qlDataSource1" CellPadding="4"
Font-Size="Small" ForeColor="#333 333" GridLines="None ">
<Columns>
<asp:HyperLinkF ield
DataNavigateUrl Fields="Work_Or der"

DataNavigateUrl FormatString="h ttp://server/work_order.asp? WorkOrder={0}&a mp;Site="
DataTextField=" Work_Order"
HeaderText="Lin kField"
Target="_blank" />

DataNavigateUrl FormatString="h ttp://server/work_order_prin t.asp?WorkOrder ={0}&amp;Site=< %=Site
%>"

Becomes

<a
href="http://server/work_order.asp? WorkOrder=12345 678&Site=<%=Sit e
%>

If I try

DataNavigateUrl FormatString="h ttp://server/work_order.asp? WorkOrder={0}&a mp;Site="
+ <%=Site %>
It errors with
DataNavigateUrl FormatString="h ttp://server/work_order.asp? WorkOrder={0}&a mp;Site="
+') is not allowed within a
'System.Web.UI. WebControls.Dat aControlFieldCo llection'.

Line 27:
DataNavigateUrl FormatString="h ttp://server/work_order.asp. asp?WorkOrder={ 0}&amp;Site="
+ <%=Site %>

Thanks again from a newasp.netuser.
Was wondering if you ever found a solution - I am trying to do the
exact same thing and having no luck.

Jan 31 '07 #2
bpd
On Jan 31, 2:33 pm, "Keith" <kst...@nycap.r r.comwrote:
On Jan 7, 10:13 pm, Ixnay <w...@where.com wrote:


Thanks in advance for any help you can give me on this.
I am trying to include the value from a request.queryst ring in the
DataNavigateUrl FormatString
I am able to include one of the values which comes from the database
to make a link with the syntax
http://server/work_order.asp?WorkOrd...8&Site=NYCbutI cannot
get the NYC value to work from a request.queryst ring when submitted
from http://server/default.aspx?Site=NYC
<asp:GridView ID="GridView1" runat="server"
AutoGenerateCol umns="False"
DataSourceID="S qlDataSource1" CellPadding="4"
Font-Size="Small" ForeColor="#333 333" GridLines="None ">
<Columns>
<asp:HyperLinkF ield
DataNavigateUrl Fields="Work_Or der"
DataNavigateUrl FormatString="h ttp://server/work_order.asp? WorkOrder={0}&a mp;Site="
DataTextField=" Work_Order"
HeaderText="Lin kField"
Target="_blank" />
DataNavigateUrl FormatString="h ttp://server/work_order_prin t.asp?WorkOrder ={0}&amp;Site=< %=Site
%>"
Becomes
<a
href="http://server/work_order.asp? WorkOrder=12345 678&Site=<%=Sit e
%>
If I try
DataNavigateUrl FormatString="h ttp://server/work_order.asp? WorkOrder={0}&a mp;Site="
+ <%=Site %>
It errors with
DataNavigateUrl FormatString="h ttp://server/work_order.asp? WorkOrder={0}&a mp;Site="
+') is not allowed within a
'System.Web.UI. WebControls.Dat aControlFieldCo llection'.
Line 27:
DataNavigateUrl FormatString="h ttp://server/work_order.asp. asp?WorkOrder={ 0}&amp;Site="
+ <%=Site %>
Thanks again from a newasp.netuser.

Was wondering if you ever found a solution - I am trying to do the
exact same thing and having no luck.- Hide quoted text -

- Show quoted text -
I haven't used DataNavigateUrl Fields (yet), but have you tried:
DataNavigateUrl Fields="Work_Or der",
Request.Queryst ring["site"].ToString().Tri m()
DataNavigateUrl FormatString="h ttp://server/work_order_prin t.asp?
WorkOrder={0}&a mp;Site={1}"
Jan 31 '07 #3

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

Similar topics

1
282
by: MC | last post by:
Hi all, Quick question for you. I need to include a parameter into this asp:HyperLinkField of SchoolID. I tried adding Request.QueryString("SchoolID") but it didnt work. <asp:HyperLinkField DataNavigateUrlFields="ActionID" DataNavigateUrlFormatString="AddSchool5.aspx?ActionID={0}" DataTextField="Action" />
1
5114
by: MasterChief | last post by:
Is it possible to select an item on a gridview by clicking on it and then being able to click a link for example that says EditOrder in a treeview and have the EditOrder page open up viewing what you selected in the gridview? My EditOrder link is in a sitemap so I don't know if it is possible becuase you would almost have to pass a variable to the sitemap. What would be the easiest way to accomplish it?
1
1638
by: Vear | last post by:
I have a gridview inside a content placeholder that has the first column as a hyperlink. I changed it from a Hyperlinkfield to a Template field so I could name the hyperlink control. I can't figure out how to reference it so I can change the URL depending on which Stored procedure I bind to it during form load. Is there a way to change it URL via VB. This is in a content form within a master page if that makes any difference. Thank...
1
1828
by: barkster | last post by:
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:HyperLinkField DataNavigateUrlFields="WONo"...
1
269
by: =?Utf-8?B?Ym9iYnk=?= | last post by:
I have the following hyperlink in my GridView. I want two values to be passed on to another aspx page when I click on hyperlink. <asp:HyperLinkField DataTextField="proxy" HeaderText="Proxy" NavigateUrl="~/Proxy.aspx" DataNavigateUrlFormatString="Proxy.aspx?FirstName={0},LastName={1}" DataNavigateUrlFields="FirstName,LastName" /> In My proxy.aspx page I did the following to get the values. But it giving me
0
2466
by: dakota64 | last post by:
Greetings all, I have a gridview that I need to pass the primary key from a selected row to a new page. I have it working with a querystring, but I would like to do it without using the querystring. <asp:HyperLinkField Text="Edit" DataNavigateUrlFields="Pkey" DataNavigateUrlFormatString="MultilineEdit.aspx?Pkey={0}" /> I have been trying to use session and context, but I have not been able to get anything to work. The code below is...
2
4996
by: Tor Inge Rislaa | last post by:
When I insert the complete querystring into the NavigateUrl tag this hyperlink works fine within the GridView. <asp:HyperLinkField HeaderText=" Details" NavigateUrl="~/Admindetail.aspx?ku_id=1" Text="Details"
3
1560
by: Zaur Bahramov | last post by:
Hi! I'm developing a web application where the first page shows table from SQL Server and has some hyperlinks in one collumn. The collumn has productID so when clicked the page is passed as defpost.aspx?id={0} When user clicks on a hyperlink it is redirected to defpost.aspx page where basing on the value of ID the data grid needs to display another table after querying a SQL Server passing the parameter (which is equal to "id").
1
1489
by: murugavelmsc | last post by:
hi, i am using two pages, the first page contains the gridview control which i select one record means that job id of particular record move to second page through querystring. But in second page i have a design like form of textboxes and dropdownboxes.This control are filled depend on the job id which i select from first page. i try the below mentioned code, it throw an error like "Invalid attempt to read when no data is present." ...
0
9716
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
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
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...
0
9177
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
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
2
3837
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
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.