Solved

LinkButton to set url parameter

Posted on 2009-07-13
2
601 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
Comment Utility
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
Comment Utility
That worked perfect. Thanks.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

771 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

10 Experts available now in Live!

Get 1:1 Help Now