I'm using a GridView to list data from a table in my database. On of the
fields is a URL and when I click a row in the GridView I want the page to
automaticly open that link. How do I write code to an event i the GridView
so that when I click a row the page opens up the new link in another window?
Lars
RE: GridView
am 30.01.2008 15:11:01 von rodoopus
You are going to need a little Javascript
You wire it something like this
--
aaa
"rosoft" wrote:
> Hi
>
> I'm using a GridView to list data from a table in my database. On of the
> fields is a URL and when I click a row in the GridView I want the page to
> automaticly open that link. How do I write code to an event i the GridView
> so that when I click a row the page opens up the new link in another window?
>
> Lars
>
>
>
Re: GridView
am 30.01.2008 16:29:23 von rosoft
Hi
>
But I donät want a button I want the table (GridView) to display a html
link. I tried to enter html text into the database table but that only
showed the source code for the html link in the Grid View such as
When I work with PHP I read data from a table and then create a table.
Couldn't I some how make a C# class that handled this. Read data from a
database into some sort of view and then read the view and create html code
that I then write to the page. Having to do all this in a Java Script? Then
I'm better of with a PHP page. I was told that C# can fix these things
easaly.
Is there any C# classes I can use to create backend modules for my homepage
on the server. Some class where I send for example
runat="server">....... And then pass Table1 as a parameter to an
object where the object fills the Table with data?
I just don't want to show the informatin in the database as it is since I
use it to build links depending on who's logged into the page.
Lars
"Angel" skrev i meddelandet
news:740E2606-0B7A-42EA-A059-C7B788AE36CB@microsoft.com...
> You are going to need a little Javascript
>
>
>
>
> You wire it something like this
>
>
>
> --
> aaa
>
>
> "rosoft" wrote:
>
>> Hi
>>
>> I'm using a GridView to list data from a table in my database. On of the
>> fields is a URL and when I click a row in the GridView I want the page to
>> automaticly open that link. How do I write code to an event i the
>> GridView
>> so that when I click a row the page opens up the new link in another
>> window?
>>
>> Lars
>>
>>
>>
Re: GridView
am 30.01.2008 16:35:31 von gnewsgroup
On Jan 30, 8:28=A0am, "rosoft" wrote:
> Hi
>
> I'm using a GridView to list data from a table in my database. On of the
> fields is a URL and when I click a row in the GridView I want the page to
> automaticly open that link. How do I write code to an event i the GridView=
> so that when I click a row the page opens up the new link in another windo=
w?
>
> Lars
The GridView control has a HyperLink field, which might be what you
are looking for. Just google GridView HyperLink.
Re: GridView
am 30.01.2008 16:45:19 von David Wier
As an added note, the HyperlinkField has a Target property (relates to the
HTML hyperlink target attribute), so you can easily get it to open in
another window
David Wier
http://aspnet101.com
http://iWritePro.com - One click PDF, convert .doc/.rtf/.txt to HTML with no
bloated markup
"gnewsgroup" wrote in message
news:b10351b8-5ebc-4729-8888-dc9cc08d6f54@i29g2000prf.google groups.com...
On Jan 30, 8:28 am, "rosoft" wrote:
> Hi
>
> I'm using a GridView to list data from a table in my database. On of the
> fields is a URL and when I click a row in the GridView I want the page to
> automaticly open that link. How do I write code to an event i the GridView
> so that when I click a row the page opens up the new link in another
> window?
>
> Lars
The GridView control has a HyperLink field, which might be what you
are looking for. Just google GridView HyperLink.
Re: GridView
am 30.01.2008 17:10:03 von rodoopus
So you're saying the javascript I wrote becomes unnecessary?
--
aaa
"David Wier" wrote:
> As an added note, the HyperlinkField has a Target property (relates to the
> HTML hyperlink target attribute), so you can easily get it to open in
> another window
>
>
> David Wier
> http://aspnet101.com
> http://iWritePro.com - One click PDF, convert .doc/.rtf/.txt to HTML with no
> bloated markup
>
>
> "gnewsgroup" wrote in message
> news:b10351b8-5ebc-4729-8888-dc9cc08d6f54@i29g2000prf.google groups.com...
> On Jan 30, 8:28 am, "rosoft" wrote:
> > Hi
> >
> > I'm using a GridView to list data from a table in my database. On of the
> > fields is a URL and when I click a row in the GridView I want the page to
> > automaticly open that link. How do I write code to an event i the GridView
> > so that when I click a row the page opens up the new link in another
> > window?
> >
> > Lars
>
> The GridView control has a HyperLink field, which might be what you
> are looking for. Just google GridView HyperLink.
>
>
>
Re: GridView
am 30.01.2008 17:14:06 von rodoopus
You can do this
Dim cmd As New CommandField
cmd.EditText = "Select"
cmd.ButtonType = ButtonType.Link
cmd.ShowSelectButton = True
grid.Columns.Add(cmd)
or you can do it declaritive
or you can use the wizard
Lot's of choices
But I never link this command button to pop-up window as David is suggesting
--
aaa
"rosoft" wrote:
> Hi
>
> >
>
> But I donät want a button I want the table (GridView) to display a html
> link. I tried to enter html text into the database table but that only
> showed the source code for the html link in the Grid View such as
>
>
>
> When I work with PHP I read data from a table and then create a table.
> Couldn't I some how make a C# class that handled this. Read data from a
> database into some sort of view and then read the view and create html code
> that I then write to the page. Having to do all this in a Java Script? Then
> I'm better of with a PHP page. I was told that C# can fix these things
> easaly.
>
> Is there any C# classes I can use to create backend modules for my homepage
> on the server. Some class where I send for example
> runat="server">....... And then pass Table1 as a parameter to an
> object where the object fills the Table with data?
>
> I just don't want to show the informatin in the database as it is since I
> use it to build links depending on who's logged into the page.
>
> Lars
>
>
> "Angel" skrev i meddelandet
> news:740E2606-0B7A-42EA-A059-C7B788AE36CB@microsoft.com...
> > You are going to need a little Javascript
> >
> >
> >
> >
> > You wire it something like this
> >
> >
> >
> > --
> > aaa
> >
> >
> > "rosoft" wrote:
> >
> >> Hi
> >>
> >> I'm using a GridView to list data from a table in my database. On of the
> >> fields is a URL and when I click a row in the GridView I want the page to
> >> automaticly open that link. How do I write code to an event i the
> >> GridView
> >> so that when I click a row the page opens up the new link in another
> >> window?
> >>
> >> Lars
> >>
> >>
> >>
>
>
>
Re: GridView
am 30.01.2008 17:29:03 von rodoopus
David,
I went and did a little checking and could not find the Target property or
its use. Could you point us to an example or a link that talks about this
--
aaa
"David Wier" wrote:
> As an added note, the HyperlinkField has a Target property (relates to the
> HTML hyperlink target attribute), so you can easily get it to open in
> another window
>
>
> David Wier
> http://aspnet101.com
> http://iWritePro.com - One click PDF, convert .doc/.rtf/.txt to HTML with no
> bloated markup
>
>
> "gnewsgroup" wrote in message
> news:b10351b8-5ebc-4729-8888-dc9cc08d6f54@i29g2000prf.google groups.com...
> On Jan 30, 8:28 am, "rosoft" wrote:
> > Hi
> >
> > I'm using a GridView to list data from a table in my database. On of the
> > fields is a URL and when I click a row in the GridView I want the page to
> > automaticly open that link. How do I write code to an event i the GridView
> > so that when I click a row the page opens up the new link in another
> > window?
> >
> > Lars
>
> The GridView control has a HyperLink field, which might be what you
> are looking for. Just google GridView HyperLink.
>
>
>
Re: GridView
am 30.01.2008 17:32:54 von gnewsgroup
On Jan 30, 11:29=A0am, Angel wrote:
> David,
>
> I went and did a little checking and could not find the Target property or=
> its use. =A0Could you point us to an example or a link that talks about th=
is
> --
> aaa
>
I found it here http://msdn2.microsoft.com/en-us/library/system.web.ui.webco =
ntrols.hyperlinkfield.target.aspx
Re: GridView
am 30.01.2008 17:42:06 von gnewsgroup
On Jan 30, 11:10=A0am, Angel wrote:
> So you're saying the javascript I wrote becomes unnecessary? =A0
> --
> aaa
>
That's likely the case.
Re: GridView
am 30.01.2008 18:10:01 von rodoopus
Thanks, you know I seen that page before and never understood it until now
when you brought it up.
That's a simple solution.
Thanks again!
aaa
"gnewsgroup" wrote:
> On Jan 30, 11:29 am, Angel wrote:
> > David,
> >
> > I went and did a little checking and could not find the Target property or
> > its use. Could you point us to an example or a link that talks about this
> > --
> > aaa
> >
>
> I found it here http://msdn2.microsoft.com/en-us/library/system.web.ui.webco ntrols.hyperlinkfield.target.aspx
>
Re: GridView
am 30.01.2008 22:01:04 von rosoft
Coul dyou give me a code example
My GridView is called gvTracks. My DataSourse is called sdsMP3Tracks.
Can you use only these two objects to open the mp3 file?
Lars
"gnewsgroup" skrev i meddelandet
news:b10351b8-5ebc-4729-8888-dc9cc08d6f54@i29g2000prf.google groups.com...
On Jan 30, 8:28 am, "rosoft" wrote:
> Hi
>
> I'm using a GridView to list data from a table in my database. On of the
> fields is a URL and when I click a row in the GridView I want the page to
> automaticly open that link. How do I write code to an event i the GridView
> so that when I click a row the page opens up the new link in another
> window?
>
> Lars
The GridView control has a HyperLink field, which might be what you
are looking for. Just google GridView HyperLink.
Re: GridView
am 30.01.2008 22:09:13 von rosoft
Well that's the static way. I need to do it dynamicly. The view inlcudes
several URLs and I wan tto seleft ont view on the GrodView (GV) and then
goto that url.
Imagine a table with lots of hyper links. You click one of them and the url
in the hyper link opens. That's what I want to do. As an example goto the
page at http://www.rosoft.se/. It includes lots of Hyperlinks that I would
like to store in a database. Fields stored would be ShowText and URL. Using
a GV just shows the data in the table as strings. How do I transform the
text in the GV to hyperliks as in the example on my homepage.
Lars
"Angel" skrev i meddelandet
news:1FA7ED1E-E4EB-4991-82A0-D4AE61679153@microsoft.com...
> Thanks, you know I seen that page before and never understood it until now
> when you brought it up.
>
> That's a simple solution.
>
> Thanks again!
> aaa
>
>
> "gnewsgroup" wrote:
>
>> On Jan 30, 11:29 am, Angel wrote:
>> > David,
>> >
>> > I went and did a little checking and could not find the Target property
>> > or
>> > its use. Could you point us to an example or a link that talks about
>> > this
>> > --
>> > aaa
>> >
>>
>> I found it here
>> http://msdn2.microsoft.com/en-us/library/system.web.ui.webco ntrols.hyperlinkfield.target.aspx
>>