473,796 Members | 2,570 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 10611
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
5113
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
1636
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
1827
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
4994
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
1558
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
9684
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
9530
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
10236
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
10182
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
10017
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
7552
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
6793
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4120
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
3734
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.