Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
| Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old December 20th, 2006, 05:54 AM
Registered User
 
Join Date: Nov 2006
Location: , , .
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default binding textboxes to selected radio button

hi...
im new to asp.net and trying to build a website...
i have got a database in ms-access and developing my application in asp.net in vb

i want to create radiobuttons for each record in my table and bind it to datagrid.
also when the user clicks the radiobutton placed before the specified record,some of the datafields(name,email etc) shld be binded to some of the textboxes that are placed on the same form...
but nt getting an idea to place my self out of this trap...
here's the code that i have used for it...



<body MS_POSITIONING="GridLayout">
        <form id="Form1" method="post" runat="server">
            &nbsp;
            <asp:datagrid id="DataGrid1" runat="server" AutoGenerateColumns="False">
                <Columns>
                    <asp:TemplateColumn HeaderText="FirstName">
                        <ItemTemplate>
                            <input type="radio" name="optSelectedName" value='<%#DataBinder.Eval(Container.DataItem, "email") %> '

                                onclick="javascript:Textbox1.value = this.value;">'<%#DataBinder.Eval(Container.DataIte m, "email") %>'
                            <br>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                </Columns>
            </asp:datagrid>
            <div style="VISIBILITY: hidden"><asp:textbox id="TextBox1" style="Z-INDEX: 102; LEFT: 216px; POSITION: absolute; TOP: 264px"
                    runat="server"></asp:textbox></div>
            <asp:button id="Button1" style="Z-INDEX: 103; LEFT: 152px; POSITION: absolute; TOP: 320px" runat="server"
                Text="Button"></asp:button></form>
    </body>


and

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
                Response.Write("You have selected :" & TextBox1.Text)

    End Sub

any help would be gr8..
thnx



Similar Threads
Thread Thread Starter Forum Replies Last Post
Binding Textboxes RubyRue ASP.NET 1.0 and 1.1 Basics 1 February 18th, 2008 11:13 AM
radio-button grstad HTML Code Clinic 3 February 28th, 2006 08:32 AM
Page display based on radio button selected Mekala HTML Code Clinic 3 July 10th, 2004 06:12 AM
Button acts depending on radio button values janise Access 4 March 10th, 2004 12:53 AM
display value of selected radio in the textbox hosefo81 Javascript How-To 1 February 1st, 2004 07:57 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.