RE: Passing parameter from textbox

Discussion in 'ASP .Net' started by Cemal Karademir, Jul 23, 2004.

  1. I think this is what i'm looking for, but how dows this work in an datagrid
    (see examples below). I forgot to say that I don't have much experience with
    ASP.NET.

    By the way, what are client and server side controls and what are the
    differences/when do I use them?

    Thanx, Cemal


    >Van:Jared ()
    >Onderwerp:Re: Passing parameter from textbox



    View this article only
    >Discussies:microsoft.public.dotnet.framework.aspnet
    >Datum:2004-07-21 03:14:09 PST
    >I don't know if I understand what you're asking, but, you are trying to
    >include the value of textbox1.text in a client side control, right? Why
    >don't you try to use a server side control, and redirect the page in the
    >OnClick event.
    >
    ><asp:linkbutton id=LinkButton1 onclick='<%#
    >NavToURL(DataBinder.Eval(Container.DataItem, "PLU"),
    >DataBinder.Eval(Container.DataItem, "Description"))%>'
    >runat="server">LinkButton</asp:linkbutton>


    >Protected Sub NavToURL(ByVal PLU As String, ByVal Description As String)
    > Dim URL As String = "ArticleDetail.aspx?debtroid=" _
    > & Server.UrlEncode(Me.TextBox1.Text) _
    > & "&plu=" & Server.UrlEncode(PLU) & "&description=" &
    >Server.UrlEncode(Description)
    > Response.Redirect(URL)
    >End Sub
    >
    >>"Cemal Karademir" <> wrote in message
    >>news:...
    >> Hello,
    >>
    >> Please forgive my simple question, but i don't know the correct synatx.
    >>
    >> From the masterpage i want to put a text in an textbox and then select an
    >> item in the datagrid. I do know how to pass the items in the

    datagrid(e.g.
    >> PLU, description, etc.) to an other (detail)page, but i don't know the
    >> correct syntax of how to pass the textbox value to the detailpage.
    >>
    >> I have the following code:
    >>
    >> <asp:DataGrid id="dgrArticle" runat="server" autoGenerateColumns="False">
    >> <Columns>
    >> <asp:TemplateColumn>
    >> <ItemTemplate>
    >> <a href='ArticleDetail.aspx?debtorid=<%#textbox1.text%>&
    >> plu=<%#DataBinder.Eval(Container.DataItem,
    >> "PLU")%>&
    >>
    >> description=<%#DataBinder.Eval(Container.DataItem,"DESCRIPTION")%
    >> </a>
    >> </ItemTemplate>
    >> </asp:TemplateColumn
    >> </Columns>
    >> </asp:DataGrid>
    >>
    >> The result is now:
    >>

    http://localhost:8081/ArticleDetail.aspx?debtorid=&plu=2&description=SOME_DE
    >> SCRIPTION
    >>
    >> But must be (if textbox1.text="12345") :
    >>

    http://localhost:8081/ArticleDetail.aspx?debtorid=12345&plu=2&description=SO
    >> ME_DESCRIPTION
    >>
    >> Thanx, Cemal
    >>
    >>
    Cemal Karademir, Jul 23, 2004
    #1
    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. Cemal Karademir

    Passing parameter from textbox

    Cemal Karademir, Jul 20, 2004, in forum: ASP .Net
    Replies:
    7
    Views:
    594
    Jared
    Jul 24, 2004
  2. Replies:
    4
    Views:
    517
    Matteo
    Mar 29, 2007
  3. Stuart Redmann
    Replies:
    5
    Views:
    476
    Stuart Redmann
    Dec 14, 2007
  4. Replies:
    5
    Views:
    630
  5. Mister B
    Replies:
    8
    Views:
    541
    Nick Keighley
    Aug 26, 2010
Loading...

Share This Page