Click here to Skip to main content
13,409,394 members (38,379 online)
Click here to Skip to main content
Add your own
alternative version


3 bookmarked
Posted 20 Sep 2010

How to get Value from from usercontrol to aspx page using Javascript

, 30 Sep 2010
Rate this:
Please Sign up or sign in to vote.
Pass value between user control and aspx page
<html xmlns="" >
<head runat="server">
    <title>TanvTech Code</title>
     <script type="text/javascript">
 function GetDatafromControl()
    var val=document.forms[0]['MyAccessValueFromUserControl_AccessNameTextBox'];

    <form id="form1" runat="server">
    <td style="width: 210px">
        <uc1:AccessValueFromUserControl id="MyAccessValueFromUserControl" runat="server">
    <td style="width: 359px">
        <asp:TextBox ID="NameTextBox" runat="server" ></asp:TextBox>
        <asp:Button ID="GetButton" runat="server"  OnClientClick="GetDatafromControl();" Text="Get"  OnClick="GetButton_Click"/></td>


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Chief Technology Officer
United States United States
More than 15 years of experience in design, architecture and development of various commercial objects oriented application.Other Specialties

Data Migration:
• MS Access database to SQL 2005/2008
• MS Access database to Oracle
• MS Access database to My SQL
• FoxPro to SQL

Application Migration:
• Converted MS Access application to .net web application (
• Excel Application to .net 3.5 web application
• FoxPro application to .net 3.5
Reporting development and support
• MS access reports
• Crystal reports
• SQL Reports(SSRS)
• DevExpress reports
• Cognos reports
Application development and support
• .net Application web /Win forms
• SharePoint
• MS Access
• Website
• Ecommerce
• Web Services
3rd Party Control Support
• DevExpress
• .netForum
• Telerik
Version controls Support
• Team Foundation Server
• Source Safe

You may also be interested in...


Comments and Discussions

GeneralMy vote of 3 Pin
Dev Sils10-Mar-14 3:48
memberDev Sils10-Mar-14 3:48 
GeneralThis is not applicable when you are using Master pages. The ... Pin
Member 27925345-Oct-10 2:32
memberMember 27925345-Oct-10 2:32 
GeneralReason for my vote of 2 it can be easily find out on google Pin
S M P3-Oct-10 2:19
memberS M P3-Oct-10 2:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.180221.1 | Last Updated 30 Sep 2010
Article Copyright 2010 by T.Ashraf
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid