Click here to Skip to main content
15,888,286 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

I have an update panel inside my aspx file. This panel contains textbox A and button A.
On click button A, show ascx modal popup. Ascx modal popup also contains textbox B and Button B.
Once Button B is clicked, whatever is inputted in textBox B will be set in Textbox A.

How will i do this?

need help. thanks :)
Posted
Comments
vinay.tatipamula 30-Jul-13 23:53pm    
Keep the updatepanel in your aspx page, where your ascx controls is also included. You can access the textbox control inside an ascx from your aspx page as UC1.TexBoxB.Text.

use javascript will be easier

HTML
<button id="buttonb"  önclientclick="return getbuttonbclick()" />


JavaScript
function getbuttonbclick()
{
      document.getelementbyid(textboxa).value=document.getelementbyid(textboxb).value

}


onrowdatabound of gridview

C#
buttonb.attributes.add("onclick","document.getelementbyid(clientid of buttona).value=document.getelementbyid(clientid of button b).value")

inside update panel it will work fine :)
 
Share this answer
 
v2
Comments
dinahgee1419 31-Jul-13 1:14am    
@dholakiya ankit and vinayT.Orbees -- thanks for your response
i forgot to mention that ButtonB is inside a gridview
Dholakiya Ankit 31-Jul-13 1:20am    
ok then you have to see my imporoved solution
dinahgee1419 31-Jul-13 1:28am    
thanks so much.. i'll try the solution u have given
Dholakiya Ankit 31-Jul-13 1:39am    
welcome
dinahgee1419 31-Jul-13 7:21am    
it prompts this error "An extender can't be in a different UpdatePanel than the control it extends."
in ascx, set value of textboxA then call updating of panel in aspx file.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900