tags:

views:

456

answers:

5

I currently have a button called Edit and a text box call blah on a ajax updatepanel. is it possible to set the asp.net's textbox Readonly via trigger?

+1  A: 

Yes it is possible.

Assuming the trigger is the edit button's onclick handler, put the code there...

Chris Lively
a quick example or a tutorial link if you can.
Jack
A: 

Sorry, let me clerafiy. On the page load the textbox blah ReadOnly is set to false. I want to trigger the Edit button and set the textbox blah ReadOnly to true.

Jack
A: 

As long as the button triggers the update panel all you should have to do is set the read only property to true in the button's click event handler.

A: 

If you double click your edit button in the design window, it will create a method like this:

protected void btnEdit_Click(object sender, EventArgs e)
    {

    }

Just add some code like this:

txtbox.ReadOnly = true;

To make your textbox readonly.

GregD
A: 

Never mind with the tutorial link or example. I got it. Thank you all very much.

Jack
Would you kindly mark one of these as the answer if they answered your question?
GregD