Hi
I developed a usercontrol with a textbox and an htmlInputHidden
When I add my usercontrol in a webform, it works properly
If I add my control in a template column of a datagrid i have some problems
When I load the webform, the usercontrol has a UniqueID like this: "LookUp1:txtRis ultato", then I value the text of this textbox with a client-side script. If i post the page, the value saved in the textbox.text is null, but i see that the UniqueID is changed, and now is "DataGrid1:Look Up1:txtRisultat o"
How can i refer to my usercontrol with an ID which doesn't changes
Why the UniqueID changes
P.S. I noticed that if I value the textbox sending the right ID (DataGrid1:Look Up1:txtRisultat o) the post is made properl
Thank yo
Alessandro Rossi 3 1368
Hi, Alessandro Rossi,
The UniqueID in this case receives its actual (and final) value after the
binding of the DataGrid. I suppose that you are reading it at some point
before that. That is why it has different value.
Hope this helps
Martin
"Alessandro Rossi" <Al************ **@areait.net> wrote in message
news:F3******** *************** ***********@mic rosoft.com... Hi, I developed a usercontrol with a textbox and an htmlInputHidden . When I add my usercontrol in a webform, it works properly. If I add my control in a template column of a datagrid i have some
problems: When I load the webform, the usercontrol has a UniqueID like this:
"LookUp1:txtRis ultato", then I value the text of this textbox with a
client-side script. If i post the page, the value saved in the textbox.text
is null, but i see that the UniqueID is changed, and now is
"DataGrid1:Look Up1:txtRisultat o". How can i refer to my usercontrol with an ID which doesn't changes? Why the UniqueID changes?
P.S. I noticed that if I value the textbox sending the right ID
(DataGrid1:Look Up1:txtRisultat o) the post is made properly Thank you Alessandro Rossi
No, I found the problem
I built the client-side script when the UniqueID wasn't complete (in the set method of a property). Now I moved the code in a Control PreRender event handler procedure's, and now all works properly
Thank you for the interest
Alessandro Rossi
----- Martin Dechev wrote: ----
Hi, Alessandro Rossi
The UniqueID in this case receives its actual (and final) value after th
binding of the DataGrid. I suppose that you are reading it at some poin
before that. That is why it has different value
Hope this help
Marti
"Alessandro Rossi" <Al************ **@areait.net> wrote in messag
news:F3******** *************** ***********@mic rosoft.com.. Hi I developed a usercontrol with a textbox and an htmlInputHidden When I add my usercontrol in a webform, it works properly If I add my control in a template column of a datagrid i have som
problems When I load the webform, the usercontrol has a UniqueID like this
"LookUp1:txtRis ultato", then I value the text of this textbox with
client-side script. If i post the page, the value saved in the textbox.tex
is null, but i see that the UniqueID is changed, and now i
"DataGrid1:Look Up1:txtRisultat o" How can i refer to my usercontrol with an ID which doesn't changes Why the UniqueID changes P.S. I noticed that if I value the textbox sending the right I
(DataGrid1:Look Up1:txtRisultat o) the post is made properl Thank yo Alessandro Ross
Hi, Alessandro Rossi,
The code in the PreRender method is executed *after* the binding of the
DataGrid. I was supposing (correctly) that you were reading the UniqueID
*before* the binding.
Anyway, it's good that you have resolved your problem.
Greetings
Martin
"Alessandro Rossi" <al************ **@areait.net> wrote in message
news:9B******** *************** ***********@mic rosoft.com... No, I found the problem. I built the client-side script when the UniqueID wasn't complete (in the
set method of a property). Now I moved the code in a Control PreRender event
handler procedure's, and now all works properly. Thank you for the interest. Alessandro Rossi.
----- Martin Dechev wrote: -----
Hi, Alessandro Rossi,
The UniqueID in this case receives its actual (and final) value after
the binding of the DataGrid. I suppose that you are reading it at some
point before that. That is why it has different value.
Hope this helps Martin "Alessandro Rossi" <Al************ **@areait.net> wrote in message news:F3******** *************** ***********@mic rosoft.com... > Hi, > I developed a usercontrol with a textbox and an htmlInputHidden . > When I add my usercontrol in a webform, it works properly. > If I add my control in a template column of a datagrid i have some problems: > When I load the webform, the usercontrol has a UniqueID like this: "LookUp1:txtRis ultato", then I value the text of this textbox with a client-side script. If i post the page, the value saved in the
textbox.text is null, but i see that the UniqueID is changed, and now is "DataGrid1:Look Up1:txtRisultat o". > How can i refer to my usercontrol with an ID which doesn't changes? > Why the UniqueID changes? >> P.S. I noticed that if I value the textbox sending the right ID (DataGrid1:Look Up1:txtRisultat o) the post is made properly >> Thank you > Alessandro Rossi This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: |
last post by:
Hi, All,
I'm having problems getting OnInit to fire in my
UserControl, when I use a custom template to render the
control. The control will render to the browser and it
wasn't until I needed to perform some initialization in
the OnInit event did I realize that this event was never
firing.
Two Question:
|
by: Vlady |
last post by:
Hello. I recently built an ASP.NET "financial" application. I got to the
point where I have a HTML template (a contract) which needs to be filled with
various data from the database. I put a "generate contract" button on my ASPX
page, but I totally lack ideas of how to put the data in the correct places
in the html file. I was recommended (actually "do like this" from my boss) to
enclose the variable name like this {variable_name} in the...
|
by: vbMental |
last post by:
I created a user control that, had a datalist with checkboxes inside of the
item template. These checkboxes would not retain state. For instance, if I
set them to checked inside of the load event of the UserControl, they would
appear false(the default value) when inside the top level datagrid.
Here's the walkthrough (tried to make it as quick as possible):
Start a new ASP.NET Web Application project.
1. Create a usercontrol....
|
by: Tim_Mac |
last post by:
hi,
i have an aspx page which dynamically loads a user control and adds it
to a placeholder. the control is recreated and added to the
placeholder for postbacks as well.
the user control contains a datagrid and some buttons and textboxes.
the button events fire correctly and execute their code. however, the
datagrid events fire a postback, and execute Page_load in the
usercontrol, but the Item_Command code is not executed. the code to...
|
by: Michael Maes |
last post by:
Hi,
I have a UserControl containing some controls of which one is a ComboBox.
All the InternalControls are Private and some are allowed to be accessed through Public Methods.
One of the things I would like to do (of course) is set the DataBindings.
Something clearly is wrong with the approach I use, because I can't set the Properties in the Designer, the DataSource-Property appears like 'ReadOnly', there is no "dropdown" with the list from...
| |
by: Captain Sensible |
last post by:
Hello!
I created a master page and load usercontrols dynmamically during runtime.
So far so good. But for getting a unique frame with functionality buttons
like Add, save etc. I created a usercontrol "TemplateUserControl" with a
table, within this table a placeholder, where I wanna put in another user
control. So I get a unique look for all plus the benefit , that I can check
the permissions for the content in the Template control ( in...
|
by: James |
last post by:
CWinFormsDialog in .net 2.0 lets you host a .Net UserControl as a dialog in a
managed C++ MDI application.
I.e. in the sample:
-----------------------------------------------
#include <afxwinforms.h>
#using <WinFormUserControl1.dll>
using namespace WinFormUserControl1;
|
by: Andrew Robinson |
last post by:
Is it possible to have a RequiredFieldValidator that targets a UserControl?
<asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server"
ControlToValidate="PhoneUserControlHome" Display="dynamic"
Text=" (Required Field)" />
This code generates a run time exception of "Control 'PhoneUserControlHome'
referenced by the ControlToValidate property of 'RequiredFieldValidator6'
cannot be validated. "
|
by: Rolf Welskes |
last post by:
Hello,
I want to partial cache by using a UserControl.
Now I have a file dependency.
In msdn I see it is not possible to do it the same way as in a page.
The only information is to create a file dependency and assign it to
Dependency property.
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
| |
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |