468,544 Members | 1,735 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,544 developers. It's quick & easy.

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 7686
jhardman
3,405 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,405 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,405 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

Post your reply

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

Similar topics

reply views Thread by Solomon Shaffer | last post: by
1 post views Thread by Bazza Formez | last post: by
2 posts views Thread by WolfyUK | last post: by
13 posts views Thread by rn5a | last post: by
1 post views Thread by rn5a | last post: by
5 posts views Thread by =?Utf-8?B?TWFyYyBXb29sZnNvbg==?= | last post: by
1 post views Thread by Jack | last post: by
reply views Thread by NPC403 | last post: by
1 post views Thread by UniDue | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.