Solved

LinkButton to set url parameter

Posted on 2009-07-13
2
611 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

863 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

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now