I need to set the value of a search button and thought about using a dictionary item, but as the button is defined with the following code, I don't know how to place it:
You could always defind a script block at the top of your template with the runat="server" attribute set and create a Page_Load method to set the text?
An alternative to postbackurl could also be to use a command instead of a click handler, and just programitically set the commandargument to be the value you want to pass on the querystring?
Dictionary items in asp:buttons
I need to set the value of a search button and thought about using a dictionary item, but as the button is defined with the following code, I don't know how to place it:
The button is declared directly in the template (no user control or similar).
Also the search should redirect to different sites, so any way to insert a dictionary item in server side code (also in template?
So basically I want to insert a dictionary item in the text value of the button as well as in the redirect address value.
You could always defind a script block at the top of your template with the runat="server" attribute set and create a Page_Load method to set the text?
An alternative to postbackurl could also be to use a command instead of a click handler, and just programitically set the commandargument to be the value you want to pass on the querystring?
Seems like using a hammer to crack a nut, unless there is other functionality not mentioned above? A simple
might work here?
Dan
Fair point,
I had assumed he was using asp.net controls for a reason, but at least he has a couple of options now.
Matt
is working on a reply...