Solved

LinkButton to set url parameter

Posted on 2009-07-13
2
641 Views
Last Modified: 2012-05-07
I have a form with two panels. The first has a set of five link buttons. Each when clicked needs to set a URL parameter that can be read by the second panel when clicked. This will be a parameter value in the object data source for a data grid on the second panel. This is probably very easy but it is eluding me at this time. Thanks for your help
0
Comment
Question by:woodje
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 28

Accepted Solution

by:
strickdd earned 500 total points
ID: 24842271
I think this should get you started. Simply let the OnClick event set a hidden field that is used as a parameter in the ObjectDataSource.
<asp:LinkButton id="Link1" runat="server" OnClick="Link1_Click" Text="My Link 1"/>
<asp:HiddenField id="ParameterVal1" runat="server" visible="false" /> <!-- visible="false" will only show this field in the encrypted viewstate and will help prevent hack attempts -->
 
 
protected void Link1_Click()
{
     ParameterVal1.Value = "SomeValue";
}

Open in new window

0
 

Author Closing Comment

by:woodje
ID: 31602894
That worked perfect. Thanks.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question