Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
Password Reminder
Register
Register | FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #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

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 05:57 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.