Hi all
I have a combobox as follows:
Also I have the vb code:
The problem is on lines (8 & 9), I am trying to go to another page to display some information about the error, but an exception thrown:
Server.Transfer cannot be called in a page callback
or
Response.Redirect cannot be called in a Page callback
I tired to register some client script like window.location but it does not work.
Please can you give me some help???
I have a combobox as follows:
<telerik:RadComboBox ID="cmbobox" runat="server" AutoPostBack="true" EnableLoadOnDemand="true"></telerik:RadComboBox> |
Also I have the vb code:
Protected Sub cmbobox_ItemsRequested(ByVal o As Object, ByVal e As Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs) Handles cmbobox.ItemsRequested | |
Dim objDataBaseClass As New DataBaseClass() | |
Dim dtDatabase As DataTable = objDataBaseClass.GetSomedataById(e.Text) | |
If dtDatabase Is Nothing Then 'or any other condition that checks for errors | |
'Here I need to go to error page: | |
'Response.Redirect("~/ErrorPage.aspx") | |
'Server.Transfer("~/ErrorPage.aspx") | |
End If | |
cmbobox.Items.Add(New RadComboBoxItem("", "")) | |
For i As Integer = 0 To dtDatabase .Rows.Count - 1 | |
cmbobox.Items.Add(New RadComboBoxItem(dtDatabase .Rows(i)("ID").ToString() & " - " & dtDatabase .Rows(i)("NAME").ToString(), dtDatabase.Rows(i)("ID").ToString())) | |
Next | |
End Sub |
The problem is on lines (8 & 9), I am trying to go to another page to display some information about the error, but an exception thrown:
Server.Transfer cannot be called in a page callback
or
Response.Redirect cannot be called in a Page callback
I tired to register some client script like window.location but it does not work.
Please can you give me some help???