473,796 Members | 2,476 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to Access LinkButton.Text

I need to know when a link buttons value is zero so I don't try to run a
query to find none.

When I was using ViewState(ds_La st), which I can't do because certain phones
are choking on the data, I have on avg about 12 rows of data.

Apparently that's way too much data for some phones, nearing 30k.

So I've abondoned ViewState and I'm trying to get the value from the
datagrid, I see that it can be done but I may be missing something that will
make it all work.

'This works well... (except for ViewState overhead)
Dim myRow as DataRow = CType(ViewState ("ds_Last"),
DataSet).Tables (0).Rows(e.Item .ItemIndex)
Case Right(sCoMander ,1) = "S"
.... intEventCount = myRow.Item("Sal es")....
If intEventCount >= 1 Then... do stuff load next datagrid of "Sales"

'populate my datagrid
dgFutureSM.Data Source = dsF.Tables(0)
dgFutureSM.Data Bind()

'renders a datagrid similar to.....
|Future Data
SalesPerson, Calls, Apts, Sales, Totals
-------------------------------------
Gilia Swifting 12 7 6 25
Steve Colbert 32 9 8 49
Rusty Nail 6 1 0 7

<asp:Datagrid ... DataKey="UserID "....
<asp:TemplateCo lumn HeaderText="Sal es"....
<asp:LinkButt on id="btnSelectSM FS" CommandName=="S electSalesSMFS" ....

Selecting Rusty Nail's Sales link button value zero, or any link button
renders an empty string

Pvt Sub dgSM_ItemCmd(by Val Src as obj, byVal e as
Sys.Web.UI.WebC trls.DgCmdEvent Args) handles dgHistorySM.Ite mCmd,
dgFuture.ItemCm d

'get current dg name
Dim dg as DataGrid = e.Items.NamingC ontainer

'get index UserID for nxt sProc
Dim UserID as String = dg.DataKeys(e.I tem.ItemIndex)

'get nxt step, FS, load future sales for respective UserID
Dim sCoMander as String = Right(e.Command Name,2)

'here's where I'm failing, I know which cell it is, I've verified the ID,
however I've stepped thru all of my linkbuttons and their text value = ""
Dim lnkBtnText as String = Ctype(e.Item.Ce lls(1).Controls (1),
LinkButton).Tex t

If I check column(4) which is an <asp:BoundColum n of totals, I do see the
value "7" but not in any of my linkbuttons for columns Calls, Apts and
Sales.

TIA

JeffP....
If you think this is crossposted that's only because there wasn't any
action....
Sep 13 '06 #1
1 3709
My error, <asp:TemplateCo lumns with a linkButton: although intellisense
doesn't offer a Text= adding it as Text='<% # DataBinder.Eval (Container,
"DataItem.Field Name") %>... JeffP....

"JeffP@Work " <jpgmt_at_sbcgl obal_dot_netwro te in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
>I need to know when a link buttons value is zero so I don't try to run a
query to find none.

When I was using ViewState(ds_La st), which I can't do because certain
phones are choking on the data, I have on avg about 12 rows of data.

Apparently that's way too much data for some phones, nearing 30k.

So I've abondoned ViewState and I'm trying to get the value from the
datagrid, I see that it can be done but I may be missing something that
will make it all work.

'This works well... (except for ViewState overhead)
Dim myRow as DataRow = CType(ViewState ("ds_Last"),
DataSet).Tables (0).Rows(e.Item .ItemIndex)
Case Right(sCoMander ,1) = "S"
... intEventCount = myRow.Item("Sal es")....
If intEventCount >= 1 Then... do stuff load next datagrid of "Sales"

'populate my datagrid
dgFutureSM.Data Source = dsF.Tables(0)
dgFutureSM.Data Bind()

'renders a datagrid similar to.....
|Future Data
SalesPerson, Calls, Apts, Sales, Totals
-------------------------------------
Gilia Swifting 12 7 6 25
Steve Colbert 32 9 8 49
Rusty Nail 6 1 0 7

<asp:Datagrid ... DataKey="UserID "....
<asp:TemplateCo lumn HeaderText="Sal es"....
<asp:LinkButt on id="btnSelectSM FS" CommandName=="S electSalesSMFS" ....

Selecting Rusty Nail's Sales link button value zero, or any link button
renders an empty string

Pvt Sub dgSM_ItemCmd(by Val Src as obj, byVal e as
Sys.Web.UI.WebC trls.DgCmdEvent Args) handles dgHistorySM.Ite mCmd,
dgFuture.ItemCm d

'get current dg name
Dim dg as DataGrid = e.Items.NamingC ontainer

'get index UserID for nxt sProc
Dim UserID as String = dg.DataKeys(e.I tem.ItemIndex)

'get nxt step, FS, load future sales for respective UserID
Dim sCoMander as String = Right(e.Command Name,2)

'here's where I'm failing, I know which cell it is, I've verified the ID,
however I've stepped thru all of my linkbuttons and their text value = ""
Dim lnkBtnText as String = Ctype(e.Item.Ce lls(1).Controls (1),
LinkButton).Tex t

If I check column(4) which is an <asp:BoundColum n of totals, I do see the
value "7" but not in any of my linkbuttons for columns Calls, Apts and
Sales.

TIA

JeffP....
If you think this is crossposted that's only because there wasn't any
action....

Sep 13 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
3751
by: Fresh Air Rider | last post by:
Hello Could anyone please explain how I can pass more than one arguement/parameter value to a function using <asp:linkbutton> or is this a major shortfall of the language ? Consider the following code fragments in which I want to list through all files on a directory with a link to download each file by passing a filename and whether or not to force the download dialog box to appear.
1
3537
by: Rodusa | last post by:
I keep getting this error when trying to modify the text property of a linkbutton inside a datagrid template column. Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.NullReferenceException: Object reference not...
1
3785
by: Harry Devine | last post by:
I have a DataGrid that is configured to use the Edit/Update/Cancel concept correctly. My grid shows values from 5 database fields. I only need to update that last 4 fields. The last field is a Yes/No value in Access. Using the OleDbCommand, if I do not consider the Yes/No field, the ExecuteNonQuery command, using my UPDATE SQL statement, updates the record correctly. However, if I put the Yes/No field into the mix, ExecuteNonQuery...
10
2856
by: Bharat | last post by:
Hi Folks, Suppose I have two link button on a page (say lnkBtn1 and lnkBtn2). On the click event of the lnkbtn1 I have to add a dynamically created control. And On the click event of the lnkBtn2 I have to add a datalist control. Using this datalist control I should be able to add edit, modify and cancel the items listed in this control. Here is how I designed. I used placeholder to add the controls dynamically to the page on the click...
0
1140
by: Joey | last post by:
Hello, I need to be able to access the linkbuttons that are used for paging inside a datagrid so I can set the style for what eventually becomes the client-side html anchor tags. I have read several posts about using the datagrid's PagerStyle property, but this solution is simply inadequate. This is because I need to be able to apply a CssStyle so that I can get at a:hover and other CSS properties. PagerStyle only applies the selected...
7
4038
by: Ibrahim. | last post by:
Hello, How can I access a Shared Folder of the Server by using the following control. 1. I need to download files from c:\resumes folde by using the following; <asp:HyperLink NavigateUrl='<%#DataBinder.Eval(Container.DataItem,"FilePath") %>' a. FilePath is a database field holding the value "c:\resumes\myresume.doc"
0
1809
by: comp974 | last post by:
ok, here is the situation, I am trying to construct a table with several ASP.net 2.0 controls in it during execution time in an VB.net enviroment. For starters, I have a textbox and a linkbutton per row of the table. I have easily constructed the table, but on the postback, I am unable to access the controls... Here is an example of the code: ''' <summary>Page Load</summary> ''' <remarks> ''' <para>Ensure that the querystring has a...
3
2218
by: rn5a | last post by:
Consider the following code which creates LinkButtons dynamically: For i = 1 to 5 lnkBut = New LinkButton lnkBut.ID = "lnkBut" & i lnkBut.Text = i.ToString & " " lnkBut.CommandName = i pnlLinks.Controls.Add(lnkBut) Next
5
3128
by: Nathan Sokalski | last post by:
I have a FormView control in which I use a PagerTemplate. I am having trouble accessing the controls in the PagerTemplate. How do I access them, and in what event should I put the could that accesses them? My current code is as follows: Partial Public Class indextest : Inherits System.Web.UI.Page Private rowcount As Integer = 0 Protected Sub Page_Load(ByVal sender As Object, ByVal e As
0
9683
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10457
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10231
jinu1996
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10176
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,...
0
6792
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();...
0
5443
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...
1
4119
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
2
3733
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2927
bsmnconsultancy
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.