Solved

LinkButton to set url parameter

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

ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

Question has a verified solution.

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

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
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.…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

832 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