Hi, All:
I have a datagrid with TemplateColumn as following:
<asp:TemplateColumn Visible="False" >
<ItemStyle Width="0px"></ItemStyle>
<ItemTemplate>
<asp:Label id="lblMin_Value" Visible=False runat="server" Text='<%#
DataBinder.Eval(Container, "DataItem.min_value") %>'>
</asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
I set Visible = false for this column because I do not want end user
see this column. But
If I check the html source, I did not see any HTML code for this label.
If the Visble is true, on the source code of HTML, I will see <Span id
= blahblah....>. I have a client side javascript to using this label's
value (actually the span's innerText), but the HTML does not have this
<Span object, so I could get the value of this min_value.
I also tried to set Visible =FAlse for <ASP:Label , it is the same.
I tried using <ASP:textbox > it is the same, not HTML object generated.
Does anybody have experience on this before? How should I Invisible an
Label/Textbox in datagrid but generate HTML Object so that JavaScript
can access?
Thanks a lot
-Rockdale 3 2870
Add a hidden object.
what you see is what is supposed to be doing.
<input id="hidUserUUID" type="hidden" name="hidUserUUID" runat="server">
something like that.
"rockdale" <ro************@gmail.com> wrote in message
news:11********************@j55g2000cwa.googlegrou ps.com... Hi, All:
I have a datagrid with TemplateColumn as following:
<asp:TemplateColumn Visible="False" > <ItemStyle Width="0px"></ItemStyle> <ItemTemplate> <asp:Label id="lblMin_Value" Visible=False runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.min_value") %>'> </asp:Label> </ItemTemplate> </asp:TemplateColumn>
I set Visible = false for this column because I do not want end user see this column. But If I check the html source, I did not see any HTML code for this label. If the Visble is true, on the source code of HTML, I will see <Span id = blahblah....>. I have a client side javascript to using this label's value (actually the span's innerText), but the HTML does not have this <Span object, so I could get the value of this min_value.
I also tried to set Visible =FAlse for <ASP:Label , it is the same. I tried using <ASP:textbox > it is the same, not HTML object generated.
Does anybody have experience on this before? How should I Invisible an Label/Textbox in datagrid but generate HTML Object so that JavaScript can access?
Thanks a lot -Rockdale
rockdale wrote: Hi, All:
I have a datagrid with TemplateColumn as following:
<asp:TemplateColumn Visible="False" > <ItemStyle Width="0px"></ItemStyle> <ItemTemplate> <asp:Label id="lblMin_Value" Visible=False runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.min_value") %>'> </asp:Label> </ItemTemplate> </asp:TemplateColumn>
I set Visible = false for this column because I do not want end user see this column. But If I check the html source, I did not see any HTML code for this label. If the Visble is true, on the source code of HTML, I will see <Span id = blahblah....>. I have a client side javascript to using this label's value (actually the span's innerText), but the HTML does not have this <Span object, so I could get the value of this min_value.
I also tried to set Visible =FAlse for <ASP:Label , it is the same. I tried using <ASP:textbox > it is the same, not HTML object generated.
Does anybody have experience on this before? How should I Invisible an Label/Textbox in datagrid but generate HTML Object so that JavaScript can access?
The effect of setting any server control's Visible property to False is
to prevent that control from being rendered on the client.
You will need to use a client-side solution for this, perhaps a css
class:
<style>
.invisible {display:none}
</style>
....
asp:Label id="lblMin_Value" CssClass="invisible" runat="server" Text=
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Brilliant.
I came with
<asp:TemplateColumn ItemStyle-CssClass="invisible"
FooterStyle-CssClass="invisible" HeaderStyle-CssClass="invisible"
ItemStyle-Width=0>
and it works perfect
Thank you very much
-rockdale
Bob Barrows [MVP] wrote: rockdale wrote: Hi, All:
I have a datagrid with TemplateColumn as following:
<asp:TemplateColumn Visible="False" > <ItemStyle Width="0px"></ItemStyle> <ItemTemplate> <asp:Label id="lblMin_Value" Visible=False runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.min_value") %>'> </asp:Label> </ItemTemplate> </asp:TemplateColumn>
I set Visible = false for this column because I do not want end user see this column. But If I check the html source, I did not see any HTML code for this label. If the Visble is true, on the source code of HTML, I will see <Span id = blahblah....>. I have a client side javascript to using this label's value (actually the span's innerText), but the HTML does not have this <Span object, so I could get the value of this min_value.
I also tried to set Visible =FAlse for <ASP:Label , it is the same. I tried using <ASP:textbox > it is the same, not HTML object generated.
Does anybody have experience on this before? How should I Invisible an Label/Textbox in datagrid but generate HTML Object so that JavaScript can access? The effect of setting any server control's Visible property to False is to prevent that control from being rendered on the client.
You will need to use a client-side solution for this, perhaps a css class:
<style> .invisible {display:none} </style> ... asp:Label id="lblMin_Value" CssClass="invisible" runat="server" Text=
-- Microsoft MVP -- ASP/ASP.NET Please reply to the newsgroup. The email account listed in my From header is my spam trap, so I don't check it very often. You will get a quicker response by posting to the newsgroup. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: lu |
last post by:
I have a page with datagrid (for viewing,
delete,edit,update) and text fields with button to add
info to database.
When user comes to page the datagrid selects info from
database, binds in...
|
by: Derek |
last post by:
I have an aspx page where I use a reversebind and
templates to edit the entire datagrid at one time. I
added a textbox and button to change the parameter
criteria and then rerun the databind2...
|
by: James Norton-Jones |
last post by:
Hi,
Am I trying to hold the data of a DataGrid in a label so that when the form
is reposted the DataGrid can be repopulated. The problem I am having is that
I don't understand how to get the...
|
by: tshad |
last post by:
I can't seem to get insert into a DataGrid to work.
I am using an example from the net and made changes to work on my computer.
The grid comes up fine. The edit boxes in the footer are there. ...
|
by: bill yeager |
last post by:
I'm doing an inline edit of an Admin table using the
Datagrid. There are three columns in my Admin table. I
want to dynamically disable the corresponding "CareType"
field (see below) in the grid...
|
by: jason |
last post by:
The guts of the below asp.net vb code was pieced together from another
thread - all due credit to it's original author. Thank you!
I've modified it to maintain a small local Microsoft 2000...
|
by: Wyatt70 |
last post by:
I'm attempting to implement a javascript popup calendar in a DataGrid.
The calendar will be used to insert a date into a textbox. I keep
getting a "System.NullReferenceException: Object reference...
|
by: Peter |
last post by:
ASP.NET 2003
In the DataGrid how do I select current cell value in the dropdown box when
I click on the edit link, currently when I click on the edit link in the
DataGrid the dropdown box...
|
by: slinky |
last post by:
I found the following code to transfer datagrid data to an Excel file.
Is this written in C#?... I'm a vb.netter. I'm just not sure where to
place the code to experiment on it. Should I place it in...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
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...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
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...
|
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...
| |