This is a migrated thread and some comments may be shown as answers.

PostBackUrl with parameters

3 Answers 203 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
cp
Top achievements
Rank 1
cp asked on 11 Apr 2012, 05:14 AM
How do I go about passing a parameter into the PostBackUrl property?

I would be interested in being able to do something like this:

<telerik:RadComboBox ID="combobox" runat="server" AutoPostBack="true" DataTextField="Text"
DataValueField="Value" PostBackUrl="somepage.aspx?somevalue={0}" Width="200px">
</telerik:RadComboBox>

Where {0} would be a property on the model I'm binding to the ComboBox.

Thanks,

3 Answers, 1 is accepted

Sort by
0
Dimitar Terziev
Telerik team
answered on 12 Apr 2012, 02:35 PM
Hi,

You could achieve the desired functionality, but you should set this property from code behind once the controls is being bound.

Greetings,
Dimitar Terziev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
cp
Top achievements
Rank 1
answered on 12 Apr 2012, 03:17 PM
Got an example on how to accomplish this? What event handler would I be setting this property inside?

Thanks
0
Peter
Telerik team
answered on 16 Apr 2012, 01:26 PM
Hi,

Have you tried using the DataBound event of RadCombobox"
void RadComboBox1_DataBound(object sender, EventArgs e)
   {
       RadComboBox myCombobox = (RadComboBox)sender;
       myCombobox.PostBackUrl = "custom url string";
      
   }

Do you experience any problems this way?


All the best, Peter
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
ComboBox
Asked by
cp
Top achievements
Rank 1
Answers by
Dimitar Terziev
Telerik team
cp
Top achievements
Rank 1
Peter
Telerik team
Share this question
or