2

I am creating a user control where in i have different HTML text boxes and for items like name profession contact etc. i have a edit and save button for each item. so when i click on the save button i want the value of that text box and update the same in the database . So for this i want to send that value to the ASPX page. but i don't know how to send that value to the ASPX.Also if there is another way to achieve this them please suggest.I am using the three tier architecture.

Thankx

1
  • do you have asp.net textbox or html textbox? Commented Jan 3, 2012 at 7:25

2 Answers 2

1

If text box is asp text box or html runat="server" st than you need to expose textbox value as property

public string textData
{
 get { return mytextbox.Text; }
 set { mytextbox.Text = value; }
}

OR

If you text box is html than make use of Request.QueryString["textboxnameorid"] will provide you data on postback.

Sign up to request clarification or add additional context in comments.

2 Comments

Thankx But I am using HTML text "<input type="text" name="username" id="username" class="user_name" style="display:none;" value = "Santosh"/>"
@Santosh Sahu - make use of request.querystring collection to get the value.............but not sure because your style is dispaly non
0

if you are using asp.net textbox, you can create public properties in you usercontrol like this

public string Name
        {
            get { return tbName.Text; }
            set { tbName.Text = value; }
        }

and this public property can be get set in asp.net page easily..

Regards.

1 Comment

you will have to place runat="server" or use asp.net textbox if you want to access them on aspx codebehind

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.