| <div> |
| <asp:scriptmanager ID="Scriptmanager1" runat="server"></asp:scriptmanager> |
| <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> |
| </telerik:RadAjaxManager> |
| <div id="s" runat="server"> |
| <telerik:RadComboBox ID="RadComboBox4" EnableViewState="false" EnableItemCaching="true" |
| EnableLoadOnDemand="true" runat="server" |
| onitemsrequested="RadComboBox4_ItemsRequested"> |
| </telerik:RadComboBox> |
| </div> |
| <asp:Button ID="Button1" runat="server" Text="Ajax" onclick="Button1_Click" /> |
| <asp:SqlDataSource ID="SqlDataSource1" |
| ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>" |
| ProviderName="System.Data.SqlClient" |
| SelectCommand="SELECT * FROM Customers" runat="server"></asp:SqlDataSource> |
| </div> |
| protected void Page_Load(object sender, EventArgs e) |
| { |
| RadAjaxManager1.AjaxSettings.AddAjaxSetting(Button1, s, null); |
| } |
| protected void RadComboBox4_ItemsRequested(object o, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e) |
| { |
| RadComboBox4.DataSourceID = "SqlDataSource1"; |
| string selectCommand = "SELECT * FROM CUSTOMERS WHERE CompanyName LIKE '" + |
| e.Text + "%'"; |
| SqlDataSource1.SelectCommand = selectCommand; |
| RadComboBox4.DataTextField = "CompanyName"; |
| RadComboBox4.DataValueField="CustomerID"; |
| RadComboBox4.DataBind(); |
| } |
| protected void Button1_Click(object sender, EventArgs e) |
| { |
| RadComboBox4.Text = RadComboBox4.EmptyMessage; |
| } |


| private void GenerarGrilla() |
| { |
| List<string> dataKeyNamesList = new List<string>(); |
| radgridResultados.AutoGenerateColumns = false; |
| radgridResultados.Visible = true; |
| foreach (ConfiguracionUI.Campo campo in form.Grilla.Campos) |
| { |
| GridBoundColumn boundColumn; |
| boundColumn = new GridBoundColumn(); |
| boundColumn.DataField = campo.Key; |
| boundColumn.HeaderText = campo.Name; |
| boundColumn.Visible = campo.Visible; |
| radgridResultados.MasterTableView.Columns.Add(boundColumn); |
| if (campo.IsdataKey == true) |
| dataKeyNamesList.Add(campo.Key); |
| } |
| string[] dataKeyNames = new string[dataKeyNamesList.Count]; |
| dataKeyNamesList.CopyTo(dataKeyNames); |
| radgridResultados.MasterTableView.DataKeyNames = dataKeyNames; |
| radgridResultados.AllowSorting = false; |
| radgridResultados.AutoGenerateColumns = false; |
| } |
| private void GenerarDetalle(GridTableView tableViewOrders) |
| { |
| radgridResultados.MasterTableView.DetailTables.Add(tableViewOrders); |
| foreach (ConfiguracionUI.Campo campoDetalle in form.Grilla.Detalle) |
| { |
| GridBoundColumn boundColumn; |
| GridHyperLinkColumn linkImagen; |
| if (campoDetalle.ColumnType != null) |
| { |
| linkImagen = new GridHyperLinkColumn(); |
| //linkImagen.DataNavigateUrlFields = campoDetalle.Key; |
| linkImagen.HeaderText = campoDetalle.Name; |
| linkImagen.Text = "Ver Imagen"; |
| linkImagen.NavigateUrl = "javascript:ShowMessage('imagen.aspx?&C={0}&R={1}&P={2}&I=True')"; |
| tableViewOrders.Columns.Add(linkImagen); |
| } |
| else |
| { |
| boundColumn = new GridBoundColumn(); |
| boundColumn.DataField = campoDetalle.Key; |
| boundColumn.HeaderText = campoDetalle.Name; |
| tableViewOrders.Columns.Add(boundColumn); |
| } |
| } |
| } |

protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
RadProgressArea.Localization.UploadedFiles = "Directories Processed: ";
RadProgressArea.Localization.CurrentFileName = "Current Directory: ";
RadProgressArea.Localization.TotalFiles = "Directories Found: ";
RadProgressArea.Localization.TransferSpeed = "Files Processes: ";
if (Request["websiteMasterID"] == string.Empty)
Response.Redirect("~/SessionTimeOut.aspx", true);
else
{
try
{
_websiteMasterID = int.Parse(Request["websiteMasterID"]);
CrawlWebsite(_websiteMasterID);
}
catch (Exception _ex)
{
Response.Redirect("~/SessionTimeOut.aspx", true);
}
}
}
}
private void CrawlWebsite(int _websiteMasterID)
{
//stuff
}
Basically, when the page is called it grabs the webisite ID from the query string and then processes the files for that website. While this is going on, I would like the progress information to be displayed.
I have this working if I click on a link on the page, and it does the post back. Then I can see the progress information, so the progress bar is working.
However, when i try to do it on the page_load, then the previous screen stayes in the browser; You see that the page is doing something because of the disc activity; then it loads the rest of the page information. It doesn't show the progress.
Any suggestions?