Re: Datagrid and hyper link question?

Discussion in 'ASP .Net' started by k-re, Jun 24, 2003.

  1. k-re

    k-re Guest

    Thank you Tim S. It was a help however i still couldn't figure out how to
    fix it? thanx
    "Tim S." <> wrote in message
    news:017701c339ad$4d605470$...
    > I understand you need something like:
    > <a>href="[myPage]?IN=[in_value]&PON=[pon_Value]>[text]</a>
    >
    > where the [ ] are variables.
    >
    > Some ideas:
    > 1). In the code behind, you could create a new column and
    > programmtically concatenate the values to form that Html
    > hyperlink. Then Bind this column to your datagrid.
    >
    > 2). You could use a template column, and concatenate the
    > variables.
    >
    > 3). If the calculatations get very heavy, You could add a
    > linkButton column that calls a function which takes the
    > In,Pon, and other vars as inputs and redirects to a
    > calculated url.
    >
    > Tim S.
    >
    > >-----Original Message-----
    > >Hi, I have a xml which is ..
    > ><Root>
    > ><ProdIDQual>
    > > <ON>111111</ON>
    > > <PON>121212</PON>
    > > <IN>1x1x1x</IN>
    > ></ProdIDQual>
    > ><ProdIDQual>
    > > <ON>222222</ON>
    > > <PON>131313</PON>
    > > <IN>1z1z1z</IN>
    > ></ProdIDQual>
    > ></Root>
    > >
    > >---- I have displayed it on Datagrid with readxml method

    > and works fine. I
    > >am trying to make a hyperlink in datagrid for another

    > page where I need to
    > >pass PON and IN from the upper XML. I user

    > onItemdatabound event to catch IN
    > >but couldn't get the other variable PON.. Is there a way

    > to make a link from
    > >about XML to pass IN and PON? something like <a
    > >href="index.asp?IN=11111&PON=22222222>View</a>
    > >
    > >Thanks...
    > >
    > >KB
    > >
    > >
    > >.
    > >
     
    k-re, Jun 24, 2003
    #1
    1. Advertising

  2. k-re

    Tim S. Guest

    Hello,
    Probably the simplest way is #2:
    >> 2). You could use a template column, and concatenate the
    >> variables.

    The steps to do this:
    1 - add a template column to your datagrid (if you haven't
    used template columns before, just check the MSDN help,
    they're really straight forward).
    2 - the template column lets you create custom HTML for
    each cell, so you could do something like:
    <a>href="<%....%>?IN=<%....%>&PON=<%....%>><%....%></a>

    3 - I replaced each [var] with a databind expression,
    something like <% ....%> where "..." is the syntax to
    databind (look at databinding to a repeater or datagrid in
    MSDN for the exact syntax, I don't remember it off the top
    of my head).

    That should do it.

    Tim


    >-----Original Message-----
    >Thank you Tim S. It was a help however i still couldn't

    figure out how to
    >fix it? thanx
    >"Tim S." <> wrote in message
    >news:017701c339ad$4d605470$...
    >> I understand you need something like:
    >> <a>href="[myPage]?IN=[in_value]&PON=[pon_Value]>[text]

    </a>
    >>
    >> where the [ ] are variables.
    >>
    >> Some ideas:
    >> 1). In the code behind, you could create a new column

    and
    >> programmtically concatenate the values to form that Html
    >> hyperlink. Then Bind this column to your datagrid.
    >>
    >> 2). You could use a template column, and concatenate the
    >> variables.
    >>
    >> 3). If the calculatations get very heavy, You could add

    a
    >> linkButton column that calls a function which takes the
    >> In,Pon, and other vars as inputs and redirects to a
    >> calculated url.
    >>
    >> Tim S.
    >>
    >> >-----Original Message-----
    >> >Hi, I have a xml which is ..
    >> ><Root>
    >> ><ProdIDQual>
    >> > <ON>111111</ON>
    >> > <PON>121212</PON>
    >> > <IN>1x1x1x</IN>
    >> ></ProdIDQual>
    >> ><ProdIDQual>
    >> > <ON>222222</ON>
    >> > <PON>131313</PON>
    >> > <IN>1z1z1z</IN>
    >> ></ProdIDQual>
    >> ></Root>
    >> >
    >> >---- I have displayed it on Datagrid with readxml

    method
    >> and works fine. I
    >> >am trying to make a hyperlink in datagrid for another

    >> page where I need to
    >> >pass PON and IN from the upper XML. I user

    >> onItemdatabound event to catch IN
    >> >but couldn't get the other variable PON.. Is there a

    way
    >> to make a link from
    >> >about XML to pass IN and PON? something like <a
    >> >href="index.asp?IN=11111&PON=22222222>View</a>
    >> >
    >> >Thanks...
    >> >
    >> >KB
    >> >
    >> >
    >> >.
    >> >

    >
    >
    >.
    >
     
    Tim S., Jun 25, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Meheraj shaik via .NET 247

    Hyper link in Datagrid

    Meheraj shaik via .NET 247, May 28, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    2,538
  2. Hyper Link in DataGrid

    , Mar 3, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    507
    Patrick.O.Ige
    Mar 3, 2006
  3. Yann.K
    Replies:
    9
    Views:
    349
    Nemesis
    Sep 8, 2004
  4. Jonathan  Ellis

    Re: open default MUA with a hyper link

    Jonathan Ellis, Sep 3, 2004, in forum: Python
    Replies:
    2
    Views:
    318
    Thierry S.
    Sep 6, 2004
  5. Alexander Kaplunov

    hyper link in DataGrid

    Alexander Kaplunov, Dec 17, 2003, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    201
    Alexander Kaplunov
    Dec 18, 2003
Loading...

Share This Page