Click here to Skip to main content
15,879,474 members
Please Sign up or sign in to vote.
3.50/5 (2 votes)
See more:
Hi friends,

I have created a ActiveX control that contains one textbox and one button. Added that ActiveX control on by .aspx page using <object... tag="" and="" the="" control="" is="" functioning="" as="" per="" my="" mode="hold" />
Now the only thing pending is to read/ get value of the textbox which is inside that ActiveX control.

I have created following property in the control
C#
private String mStr_CardNumber;
public String CardNumber
{
    get { return mStr_CardNumber; }
    set { mStr_CardNumber = value; }
}

but it returns "" (blank) even if textbox has got some value.

I am in real trouble now...Can anyone help me...Please…

Thanks in advance.
Amol Borkar
Sr. Software Engineer
Posted
Updated 8-Jun-11 22:07pm
v2
Comments
Sergey Alexandrovich Kryukov 9-Jun-11 4:02am    
ASP.NET? C#? Java?
--SA

Look properly! You did not create any relationship with your TextBox.

C#
class MyControl {
    Button Button = new Button();
    TextBox TextBox = new TextBox();
    public string CardNumber {
        get { return this.TextBox.Text; }
        set { this.TextBox.Text = value; }
    }
    //...
}


It can be more complex, but you should get the idea.

—SA
 
Share this answer
 
Comments
Amol_27101982, India 9-Jun-11 6:19am    
Thanks for reply...

Tried the suggested code, but no luck.

text in the ActiveX control is getting set properly, but not able to read it (javascript or server side anything will work for me).
Sergey Alexandrovich Kryukov 9-Jun-11 10:01am    
Can you run under debugger, after all? Do you read or write this property at all?
Yes, you type in the edir box. What triggers reading ins value? You need to have something (button) which triggers getting edit box data (which is a HTML textarea). What triggers postback?
--SA
Amol_27101982, India 10-Jun-11 2:15am    
On button click that is present on the form, I want to read textbox value (textbox which is inside the activex control).
Sergey Alexandrovich Kryukov 12-Jun-11 18:32pm    
So, did you run it under debugger and see what is called and what is not?
Looks so simple....
--SA
[no name] 12-Jun-11 18:45pm    
maybe just a liar ;P
I did following workaround to handle above sinerio

- From my ActiveX control created a .txt file on some predefined location as c:\SomeFolder\FileName.txt and writing CardNumber which I am reading from the client smart card reader.

- And added an extra button (which I really don't want to) which will read my textfile using javascript and will have communication with server.


I just made it working by some way, but I didn't liked it at all. So if anyone gets any solution on above issue, you are most welcome.

Still waiting for correct solution

-Amol
 
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