Hi Folks - I'm having a problem with code working in VS2012, but not when I deploy to Azure, so I'm hoping someone can point me in the right direction. I've also tried Amazon as well, with the same results.
What I'm trying to do is have a gridbutton column in a grid that when pressed, calls another page with a parameter. I've stripped down the code to that listed below, and changed the redirect link to CNN to see if that makes a difference. The grid populates, but also paging behavior isn't normal. When the gridbutton is pressed, nothing seems to happen.
I also saw the threads regarding server time, so I've made sure I waited 24 hours after deployment before testing, with the same results, so I'm at a loss. Any help is appreciated.
Here's the sample aspx file (public URL is http://iceasppricecompare.azurewebsites.net )
What I'm trying to do is have a gridbutton column in a grid that when pressed, calls another page with a parameter. I've stripped down the code to that listed below, and changed the redirect link to CNN to see if that makes a difference. The grid populates, but also paging behavior isn't normal. When the gridbutton is pressed, nothing seems to happen.
I also saw the threads regarding server time, so I've made sure I waited 24 hours after deployment before testing, with the same results, so I'm at a loss. Any help is appreciated.
Here's the sample aspx file (public URL is http://iceasppricecompare.azurewebsites.net )
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="ICEAspPriceCompare.Default" %><!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title></title></head><body> <form id="form1" runat="server"> <telerik:RadScriptManager ID="RadScriptManagerMain" Runat="server"> </telerik:RadScriptManager> <asp:SqlDataSource ID="SqlDataSourceCatalog" runat="server" ConnectionString="<%$ ConnectionStrings:icelocalmerchandiseConnectionString %>" SelectCommand="SELECT * FROM [Catalogs]"></asp:SqlDataSource> <telerik:RadGrid ID="RadGridMain" runat="server" AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" AutoGenerateDeleteColumn="True" AutoGenerateEditColumn="True" CellSpacing="0" DataSourceID="SqlDataSourceCatalog" GridLines="None" Skin="Metro" OnItemCommand="RadGridMain_ItemCommand"><MasterTableView datakeynames="Id" datasourceid="SqlDataSourceCatalog"><CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings><RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column"><HeaderStyle Width="20px"></HeaderStyle></RowIndicatorColumn><ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column"><HeaderStyle Width="20px"></HeaderStyle></ExpandCollapseColumn> <Columns> <telerik:GridBoundColumn DataField="Id" DataType="System.Int32" FilterControlAltText="Filter Id column" HeaderText="Id" ReadOnly="True" SortExpression="Id" UniqueName="Id"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="MaritzCatalogId" FilterControlAltText="Filter MaritzCatalogId column" HeaderText="MaritzCatalogId" SortExpression="MaritzCatalogId" UniqueName="MaritzCatalogId"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Title" FilterControlAltText="Filter Title column" HeaderText="Title" SortExpression="Title" UniqueName="Title"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Description" FilterControlAltText="Filter Description column" HeaderText="Description" SortExpression="Description" UniqueName="Description"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="UPC" FilterControlAltText="Filter UPC column" HeaderText="UPC" SortExpression="UPC" UniqueName="UPC"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Cost" DataType="System.Decimal" FilterControlAltText="Filter Cost column" HeaderText="Cost" SortExpression="Cost" UniqueName="Cost"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="MSRP" FilterControlAltText="Filter MSRP column" HeaderText="MSRP" SortExpression="MSRP" UniqueName="MSRP"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="MktAverage" DataType="System.Decimal" FilterControlAltText="Filter MktAverage column" HeaderText="MktAverage" SortExpression="MktAverage" UniqueName="MktAverage"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="MktHigh" DataType="System.Decimal" FilterControlAltText="Filter MktHigh column" HeaderText="MktHigh" SortExpression="MktHigh" UniqueName="MktHigh"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="MktLow" FilterControlAltText="Filter MktLow column" HeaderText="MktLow" SortExpression="MktLow" UniqueName="MktLow"> </telerik:GridBoundColumn> <telerik:GridImageColumn DataImageUrlFields="ImageLink" FilterControlAltText="Filter column1 column" ImageHeight="" ImageWidth="75px" UniqueName="column1"> </telerik:GridImageColumn> <telerik:GridButtonColumn CommandName="UPC" FilterControlAltText="Filter column column" Text="Market Price" UniqueName="column"> </telerik:GridButtonColumn> </Columns><EditFormSettings><EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn></EditFormSettings></MasterTableView><FilterMenu EnableImageSprites="False"></FilterMenu> </telerik:RadGrid> </form></body></html>
and here's the codebehind file
using System;using Telerik.Web.UI;namespace ICEAspPriceCompare{ public partial class Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void RadGridMain_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e) { if (e.CommandName.Equals("UPC")) { var item = (GridDataItem)e.Item; string id = item.OwnerTableView.DataKeyValues[item.ItemIndex]["Id"].ToString(); Response.Redirect("http://www.cnn.com", true); //Response.Redirect("GoogleSimpleLookup.aspx?Id=" + id, true); } } }}