473,396 Members | 1,865 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

how to use linkbutton commandargument to pass integer variable

I have a Sub that handles the linkbutton Command
I would like to do Session("intSomething")=e.CommandArgument

where I have previously set the linkbutton commandargument

CommandArgument="<%= Purchaser1PersonKey %>"
Nothing seems to work
Not sure of syntax. Thanks
Apr 13 '10 #1
5 8114
jhardman
3,406 Expert 2GB
well the syntax is definitely wrong, but I can't tell what you are trying to do so I can't tell you how to fix it. Tell me what a linkButton is, I'm not sure I've ever heard that terminology.

Jared
Apr 16 '10 #2
http://msdn.microsoft.com/en-us/libr...inkbutton.aspx

Use the LinkButton control to create a hyperlink-style button on the Web page. The LinkButton control has the same appearance as a HyperLink control, but has the same functionality as a Button control. If you want to link to another Web page when the control is clicked, consider using the HyperLink control.
Apr 16 '10 #3
jhardman
3,406 Expert 2GB
That explains it then. You are mixing ASP classic (.asp file extension, VBScript language, <% %> tags) with ASP.NET (.aspx file extension, VB, or C# languages among others, and <asp: > tags). The two are incompatible.
Apr 16 '10 #4
I only tried that as a last resort. I am trying to pass the linkbutton command argument to the handling subroutine so I can create a session variable. I have been unable to access the value of the command argument in the subroutint.
Apr 16 '10 #5
jhardman
3,406 Expert 2GB
@steveg48
yeah, it's still incompatible. none of what you are saying (except the session variable) makes sense in ASP classic. You can't have a linkbutton in ASP classic, let alone a command argument, so what you are trying to do is absolutely impossible. unless you are trying something in ASP.NET and mistakenly posted it in the ASP classic forum, and mistakenly posted code with ASP tags...

Are you trying to have the user click a button and have a value sent to a subroutine? If so, that is impossible in both ASP classic and ASP.NET. Consider that the subroutine containing the code is handled on the server BEFORE it is sent to the browser (and it doesn't exist on the browser), and the button is clicked AFTER it is sent to the browser. Does that make sense?

So first decide if you are using ASP classic (which doesn't recognize linkbuttons period, but you posted in the ASP classic forum) or if you are using ASP.NET (which still can't handle button clicks directly) and I will try to point you to a way through your issue.

Jared
Apr 17 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

17
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...
5
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...
2
by: News | last post by:
Hi, I need help with datalist and linkbutton. I need a LinkButton to display in datalist if datafield "is_measure_customchecklist" in a db table set to true. Here is the code (in parts): ...
0
by: Solomon Shaffer | last post by:
This is very interesting - and odd. I have a number of LinkButtons that are created in a custom data grid that I created. The purpose of the LinkButtons is to provide alphabetical filtering...
1
by: Bazza Formez | last post by:
Hi, The intended functionality is as follows : I want the user to be able to click on the LinkButton for an individual row in a datagrid, server side sub grabs id for item selected, stores in...
2
by: WolfyUK | last post by:
Hello, I have a standard asp:DataGrid called CasesGrid that I wish to write my own paging controls for. The aim is to get something like the following rendered to screen: << First < Previous...
13
by: rn5a | last post by:
In a shopping cart app, suppose a user has placed 5 orders, I want to show him 5 LinkButtons (one for each order) so that when he clicks the first LinkButton, he would be shown the details of his...
1
by: rn5a | last post by:
This is how I am populating a Panel with dynamic LinkButtons (the no. of LinkButtons that will be created will depend upon the no. of orders a user has placed): Sub Page_Init(obj As Object, ea...
5
by: =?Utf-8?B?TWFyYyBXb29sZnNvbg==?= | last post by:
Hi, I have a strange issue occurring with LinkButtons that are dynamically added to each (data) row of my DataGrid on that grid's ItemDataBound event. Each LinkButton is assigned its own event...
1
by: Jack | last post by:
Hi, I am new to .NET and need help with adding click event on LinkButton programatically. Please see the code below. I would like to add a click event on LinkButton returned from "Function...
0
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
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...
0
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
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...
0
tracyyun
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...
0
agi2029
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,...

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.