Hi, I'm working in C# .net 2005 with Ajax.
I have a page that loads dynamic user controls depending on the
scenario. In those user controls, I create dynamic linkbuttons. The user
controls are loaded on the .aspx PageLoad and the linkbuttons are
created on the .ascx PageLoad. The problem I have is that those
linkbuttons don't work on the first click. I have to make 2 clicks to
have their event fired. What can I do for that ?
Thanks. 5 1803
Hi
Do you remove any dynamically created controls from the page or ASCX in response
to any server event?
Do you assign IDs to the dynamically created link buttons?
It is possible that IDs of dynamically created controls change and server
even is not fired in response to click if you re-create link buttons with
different ID. It is possible if you change structure of the page.
-yuriy
Hi, I'm working in C# .net 2005 with Ajax.
I have a page that loads dynamic user controls depending on the
scenario. In those user controls, I create dynamic linkbuttons. The
user controls are loaded on the .aspx PageLoad and the linkbuttons are
created on the .ascx PageLoad. The problem I have is that those
linkbuttons don't work on the first click. I have to make 2 clicks to
have their event fired. What can I do for that ?
Thanks.
Well, I my buttons have an ID, but I've just found that their ID change
after the first click. When they load the first time, I have something
like id="ctl05_btnGroup1", "ctl05_btnGroup2", etc. After the first
click, they change to id="ctl04_btnGroup1", "ctl04_btnGroup2", etc.
I've compared the complete source code between "Before" and "After"
first click and there are some differences in the ViewState and
everywhere I have ctl05 in the first source, it became ctl04 in the
second. Do you have any idea why it changes like that ?
Right now, I don't think I remove dynamically created controls. I'll
look again.
thanks
Hi
Do you remove any dynamically created controls from the page or ASCX in
response to any server event? Do you assign IDs to the dynamically
created link buttons?
It is possible that IDs of dynamically created controls change and
server even is not fired in response to click if you re-create link
buttons with different ID. It is possible if you change structure of
the page.
-yuriy
>Hi, I'm working in C# .net 2005 with Ajax.
I have a page that loads dynamic user controls depending on the scenario. In those user controls, I create dynamic linkbuttons. The user controls are loaded on the .aspx PageLoad and the linkbuttons are created on the .ascx PageLoad. The problem I have is that those linkbuttons don't work on the first click. I have to make 2 clicks to have their event fired. What can I do for that ?
Thanks.
How can I make sure that the ID's will not change since the "ctl05" part
is generated by aspnet ? I tried creating them on Page_Init instead of
Page_Load but no success... I have like 5 placeholder that load user
controls dynamically, but I never have 2 user controls loaded at the
same time... I don't understand why the IDs are changing by themselves...
If you can assign the same ID to your controls you will solve your
problem. events are not fired due to changes in IDs.
>Well, I my buttons have an ID, but I've just found that their ID change after the first click. When they load the first time, I have something like id="ctl05_btnGroup1", "ctl05_btnGroup2", etc. After the first click, they change to id="ctl04_btnGroup1", "ctl04_btnGroup2", etc.
I've compared the complete source code between "Before" and "After" first click and there are some differences in the ViewState and everywhere I have ctl05 in the first source, it became ctl04 in the second. Do you have any idea why it changes like that ?
Right now, I don't think I remove dynamically created controls. I'll look again.
thanks
>>Hi
Do you remove any dynamically created controls from the page or ASCX in response to any server event? Do you assign IDs to the dynamically created link buttons? It is possible that IDs of dynamically created controls change and server even is not fired in response to click if you re-create link buttons with different ID. It is possible if you change structure of the page. -yuriy Hi, I'm working in C# .net 2005 with Ajax.
I have a page that loads dynamic user controls depending on the scenario. In those user controls, I create dynamic linkbuttons. The user controls are loaded on the .aspx PageLoad and the linkbuttons are created on the .ascx PageLoad. The problem I have is that those linkbuttons don't work on the first click. I have to make 2 clicks to have their event fired. What can I do for that ?
Thanks.
What control do 'ctl04' and 'ctl05' prefixes come from? Is it a repeater
or something else?
It looks like before the first click you page contained some other control
before. After the first click this control was not longer created. I beleive
that this is due to change in your scenario. If you can assign unique IDs
to these controls (Naming containers for your buttons) it should solve your
problem.
-yuriy
How can I make sure that the ID's will not change since the "ctl05"
part is generated by aspnet ? I tried creating them on Page_Init
instead of Page_Load but no success... I have like 5 placeholder that
load user controls dynamically, but I never have 2 user controls
loaded at the same time... I don't understand why the IDs are changing
by themselves...
>If you can assign the same ID to your controls you will solve your problem. events are not fired due to changes in IDs.
>>Well, I my buttons have an ID, but I've just found that their ID change after the first click. When they load the first time, I have something like id="ctl05_btnGroup1", "ctl05_btnGroup2", etc. After the first click, they change to id="ctl04_btnGroup1", "ctl04_btnGroup2", etc.
I've compared the complete source code between "Before" and "After" first click and there are some differences in the ViewState and everywhere I have ctl05 in the first source, it became ctl04 in the second. Do you have any idea why it changes like that ?
Right now, I don't think I remove dynamically created controls. I'll look again.
thanks
Hi
Do you remove any dynamically created controls from the page or ASCX in response to any server event? Do you assign IDs to the dynamically created link buttons? It is possible that IDs of dynamically created controls change and server even is not fired in response to click if you re-create link buttons with different ID. It is possible if you change structure of the page. -yuriy Hi, I'm working in C# .net 2005 with Ajax. > I have a page that loads dynamic user controls depending on the scenario. In those user controls, I create dynamic linkbuttons. The user controls are loaded on the .aspx PageLoad and the linkbuttons are created on the .ascx PageLoad. The problem I have is that those linkbuttons don't work on the first click. I have to make 2 clicks to have their event fired. What can I do for that ? > Thanks. >
Ok, I think I've found out the problem. Those "ctl05" came from the
PlaceHolder. The problem I got was because I was loading the user
control two times in a row the first time I loaded it. So after the
first "two loading", when I clicked on a link button, it loaded the page
only once and after that it was working. I found out a way to prevent
this and it seems to work correctly now !
Thanks a lot.
What control do 'ctl04' and 'ctl05' prefixes come from? Is it a
repeater or something else? It looks like before the first click you
page contained some other control before. After the first click this
control was not longer created. I beleive that this is due to change in
your scenario. If you can assign unique IDs to these controls (Naming
containers for your buttons) it should solve your problem.
-yuriy
>How can I make sure that the ID's will not change since the "ctl05" part is generated by aspnet ? I tried creating them on Page_Init instead of Page_Load but no success... I have like 5 placeholder that load user controls dynamically, but I never have 2 user controls loaded at the same time... I don't understand why the IDs are changing by themselves...
>>If you can assign the same ID to your controls you will solve your problem. events are not fired due to changes in IDs.
Well, I my buttons have an ID, but I've just found that their ID change after the first click. When they load the first time, I have something like id="ctl05_btnGroup1", "ctl05_btnGroup2", etc. After the first click, they change to id="ctl04_btnGroup1", "ctl04_btnGroup2", etc.
I've compared the complete source code between "Before" and "After" first click and there are some differences in the ViewState and everywhere I have ctl05 in the first source, it became ctl04 in the second. Do you have any idea why it changes like that ?
Right now, I don't think I remove dynamically created controls. I'll look again.
thanks
Hi > Do you remove any dynamically created controls from the page or ASCX in response to any server event? Do you assign IDs to the dynamically created link buttons? It is possible that IDs of dynamically created controls change and server even is not fired in response to click if you re-create link buttons with different ID. It is possible if you change structure of the page. -yuriy >Hi, I'm working in C# .net 2005 with Ajax. >> >I have a page that loads dynamic user controls depending on the >scenario. In those user controls, I create dynamic linkbuttons. >The user controls are loaded on the .aspx PageLoad and the >linkbuttons are created on the .ascx PageLoad. The problem I have >is that those linkbuttons don't work on the first click. I have to >make 2 clicks to have their event fired. What can I do for that ? >> >Thanks. >>
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Lloyd Sheen |
last post by:
Ok I have created a small testbed site for testing and I am have a problem
with the terms Usercontrol, Webcontrol, etc.
What I need to do in the long run is have a page using AJAX and having...
|
by: Kursat |
last post by:
Hi,
I want to add new collapsable panel items using java script at client side.
Is this possible to create Ajax components like collapsable panel without
server round trip?
Thanks in advance.
|
by: Gui |
last post by:
Hi, I'm working in C# .net 2005 with Ajax.
I have a page that loads dynamic user controls depending on the
scenario. In those user controls, I create dynamic linkbuttons. The user
controls are...
|
by: pbd22 |
last post by:
Hi.
This is just a disaster management question.
I am using XMLHTTP for the dynamic loading of content in a very
crucial area of my web site. Same as an IFrame, but using XMLHTTP and
a DIV. I...
|
by: oaksong |
last post by:
I have an embedded user control based on TreeView that I would like to
refresh dynamically.
The control is in a <div that's hidden until a specific selection
has been made. Unfortunately the...
|
by: David |
last post by:
Hi,
Further to my earlier post about using dynamic usercontrols (which I have
still yet to solve), I have another problem.
I am creating the UC in the page by LoadControl. The page itself...
|
by: John Straumann |
last post by:
Hello all:
I am a CRM Solution Architect so not a .NET expert by any means. I am
working with a customer who needs to modify the Advanced find in CRM which
works as shown here:
...
|
by: Hans Kesting |
last post by:
Hi,
Is there good information about the asp.net page lifecycle in
combination with dynamically loaded controls? Or on "how to build
dynamic controls"? I keep hitting problems where values are...
|
by: ive1122 |
last post by:
Hi guys,
I am looking into create a dynamic survey as posted in Get User Input From Dynamic Controls but with some different environment
Below is what i am trying to do:
First when the user...
|
by: Rina0 |
last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
|
by: erikbower65 |
last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps:
1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal.
2. Connect to...
|
by: linyimin |
last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
|
by: erikbower65 |
last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA:
1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
|
by: Taofi |
last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same
This are my field names
ID, Budgeted, Actual, Status and Differences
...
|
by: DJRhino1175 |
last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this -
If...
|
by: Rina0 |
last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
|
by: lllomh |
last post by:
Define the method first
this.state = {
buttonBackgroundColor: 'green',
isBlinking: false, // A new status is added to identify whether the button is blinking or not
}
autoStart=()=>{
|
by: lllomh |
last post by:
How does React native implement an English player?
| |