473,486 Members | 2,353 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

naviagte url in Gridview

NH
I am trying to open a new window from a hyperlink control in a gridview
(vb.net).

I have this..
<asp:TemplateField HeaderText="Project" SortExpression="Project">
<ItemTemplate>
<asp:HyperLink ID="HyperLink1" Text='<%# Bind("Project") %>'
runat="server"
NavigateUrl='<%# String.Format("java
script:openWindow('/SomePage.aspx?SomeID={0}','SomeDescription','scrol lbars=yes,width=442,height=500');",
((System.Data.DataRowView)Container.DataItem)["SomeField"] as string)
%>'></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>

The navigateURl property is displaying an error "a call to bind mucst be
assigned to a property of a control inside a template".

What am I doing wrong?
Feb 23 '06 #1
3 6520

Here is my Code.
maybe it can help.

<asp:HyperLinkField DataNavigateUrlFields="MYID" HeaderText =
"My Link To MyID"

DataNavigateUrlFormatString="http://www.mysite.com/myfile.asp?id={0}"
Target="_NEW"
DataTextField="MYID" SortExpression="MYID" />
this is inside my
<asp:gridview> and then <Columns> tag.

...


"NH" <NH@discussions.microsoft.com> wrote in message
news:A3**********************************@microsof t.com...
I am trying to open a new window from a hyperlink control in a gridview
(vb.net).

I have this..
<asp:TemplateField HeaderText="Project" SortExpression="Project">
<ItemTemplate>
<asp:HyperLink ID="HyperLink1" Text='<%# Bind("Project") %>' runat="server"
NavigateUrl='<%# String.Format("java
script:openWindow('/SomePage.aspx?SomeID={0}','SomeDescription','scrol lbars=
yes,width=442,height=500');", ((System.Data.DataRowView)Container.DataItem)["SomeField"] as string)
%>'></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>

The navigateURl property is displaying an error "a call to bind mucst be
assigned to a property of a control inside a template".

What am I doing wrong?

Feb 23 '06 #2
NH
is the asp:HyperLinkField field only availabnle in c# or something? I cant
see it in vb.net?

"NH" wrote:
I am trying to open a new window from a hyperlink control in a gridview
(vb.net).

I have this..
<asp:TemplateField HeaderText="Project" SortExpression="Project">
<ItemTemplate>
<asp:HyperLink ID="HyperLink1" Text='<%# Bind("Project") %>'
runat="server"
NavigateUrl='<%# String.Format("java
script:openWindow('/SomePage.aspx?SomeID={0}','SomeDescription','scrol lbars=yes,width=442,height=500');",
((System.Data.DataRowView)Container.DataItem)["SomeField"] as string)
%>'></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>

The navigateURl property is displaying an error "a call to bind mucst be
assigned to a property of a control inside a template".

What am I doing wrong?

Feb 24 '06 #3
The bind seems ok but the NavigateUrl seems not(!)
Maybe to clear this a little you might want to point to a function in this
case.
Also try to use Eval(), useful on some occasions.

"NH" <NH@discussions.microsoft.com> schreef in bericht
news:4B**********************************@microsof t.com...
is the asp:HyperLinkField field only availabnle in c# or something? I cant
see it in vb.net?

"NH" wrote:
I am trying to open a new window from a hyperlink control in a gridview
(vb.net).

I have this..
<asp:TemplateField HeaderText="Project" SortExpression="Project">
<ItemTemplate>
<asp:HyperLink ID="HyperLink1" Text='<%# Bind("Project")
%>'
runat="server"
NavigateUrl='<%# String.Format("java
script:openWindow('/SomePage.aspx?SomeID={0}','SomeDescription','scrol lbars=yes,width=442,height=500');",
((System.Data.DataRowView)Container.DataItem)["SomeField"] as string)
%>'></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>

The navigateURl property is displaying an error "a call to bind mucst be
assigned to a property of a control inside a template".

What am I doing wrong?

Feb 24 '06 #4

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

Similar topics

3
5654
by: theKirk | last post by:
using Visual Studio 2005 C# ASP.NET I know there has to be a simple way to do this....I want to use C# in a code behind for aspx. Populate a GridView from an xml file Add Fields to the...
6
3019
by: Nalaka | last post by:
Hi, I have a gridView (grid1), which as a templateColumn. In the template column, I have put in a gridView (grid2) and a ObjectDataSource (objectDataSource2). Question is... How to I pass the...
3
13723
by: NateDawg | last post by:
I'm reposting this. I'm kinda in a bind untill i get this figured out, so if anyone has some input it would sure help me out. Ok, I’ve noticed a few gridview problems floating around the forum....
7
14784
by: | last post by:
Hello, Does anyone have an idea on how I can filter the data in the gridview control that was returned by an sql query? I have a gridview that works fine when I populate it with data. Now I...
5
4823
by: Dick | last post by:
I have a GridView bound to an ObjectDataSource. I have a Button that calls GridView.DataBind. I want the row that is selected before the DataBind to still be selected afterwards. This happens...
5
6406
by: sutphinwb | last post by:
Hi - This could be a simple question. When I relate two tables in a datasetet, how do I get that relation to show up in a GridView? The only way I've done it, is to create a separate table in the...
2
13157
by: antonyliu2002 | last post by:
I've been googling for some time, and could not find the solution to this problem. I am testing the paging feature of gridview. I have a very simple web form on which the user can select a few...
6
5728
by: RobertTheProgrammer | last post by:
Hi folks, Here's a weird problem... I have a nested GridView setup (i.e. a GridView within a GridView), and within the nested GridView I have a DropDownList item which has the...
3
5218
by: Peter | last post by:
I have a GridView which is populated by List<ofObjects> Does anyone have example of how to sort the columns of this GridView? I have found examples without DataSourceControl but these use...
0
7105
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,...
0
6967
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...
0
7132
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7180
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...
1
6846
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...
0
5439
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,...
1
4870
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...
0
3076
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...
1
600
muto222
php
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.