| |

VerySource

 Forgot password?
 Register
Search
View: 1443|Reply: 17

There is another problem with dynamically adding user controls

[Copy link]

1

Threads

8

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 United States

Post time: 2020-9-29 16:00:04
| Show all posts |Read mode
There is another problem with dynamically adding user controls just now.
Because my control contains FreeTextBox control,
After adding this kind of control all can't be used
Clicking does not respond
Reply

Use magic Report

1

Threads

8

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 Great Britain

 Author| Post time: 2020-9-29 16:15:01
| Show all posts
freetextbox.dll version 1.63
Reply

Use magic Report

0

Threads

322

Posts

115.00

Credits

Newbie

Rank: 1

Credits
115.00

 China

Post time: 2020-9-29 16:30:01
| Show all posts
Control can't be used?
I haven't used FreeTextBox yet.
Reply

Use magic Report

0

Threads

322

Posts

115.00

Credits

Newbie

Rank: 1

Credits
115.00

 China

Post time: 2020-9-29 16:45:01
| Show all posts
Nothing happens when I click the button?
Reply

Use magic Report

0

Threads

12

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

Post time: 2020-9-29 17:00:01
| Show all posts
I often use FTB and also use dynamic loading of third-party controls
Reply

Use magic Report

0

Threads

322

Posts

115.00

Credits

Newbie

Rank: 1

Credits
115.00

 China

Post time: 2020-9-29 17:15:01
| Show all posts
Next, I often hear that FreeTextBox is an html online editor.
Take a look first.
Reply

Use magic Report

1

Threads

8

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

 Author| Post time: 2020-9-29 17:30:01
| Show all posts
I am dynamically adding user controls to the page
Such as: there is a freetextbox control in uc.ascx
Then click the button in index.aspx to dynamically add uc.ascx control to index.aspx
When adding a uc, that is, when the page has only one uc.ascx, the freetextbox control can be used normally
But when the number of added uc>1, the freetextbox control is invalid. Clicking on it does not respond, and the webpage prompts: There is an error on the webpage
But when I delete the dynamically added uc, the freetextbox is normal again.

Thank you
Reply

Use magic Report

1

Threads

8

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

 Author| Post time: 2020-9-29 17:45:01
| Show all posts
I feel that when I load one more freetextbox, it also loads the js of this control one more time.
Or two controls have the same ID
Reply

Use magic Report

0

Threads

322

Posts

115.00

Credits

Newbie

Rank: 1

Credits
115.00

 China

Post time: 2020-9-29 18:00:01
| Show all posts
Take a look at his client code.

It is a script generated based on the id of the control, not a script generated based on the client id of the control.

So if you add two fbs to the same interface, there is no problem, because their ids cannot be the same.

But the id of the TextBox in the two user controls is FreeTextBox1, so the error occurs.

It should be possible to change the server source code of FreeTextBox
Reply

Use magic Report

1

Threads

8

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

 Author| Post time: 2020-9-29 18:15:01
| Show all posts
But the two freetextboxes are in the same user control and how to change them is the same.
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list