<asp:Button runat="server" ID="SubmitButton" Text="Submit For Approval" CausesValidation="true" OnClick="SubmitButton_Click" OnClientClick="javascript:window.scrollTo(0,0);" />
Protected Sub SubmitButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles SubmitButton.ClickThe data saves correctly but hangs on the Response.Redirect at the bottom of the method. I have checked the Page Load in the called page and the code runs through as expected. I did check to see if it was a problem with the target page by changing the redirect to www.google.com and experienced the same behaviour.
CreateNewArticle()
End Sub
Private Sub CreateNewArticle()
Dim newArtID As Int32 = 0
Dim body As String = String.Empty
Dim art As Article = Nothing
Dim artBody As ArticleDetail = Nothing
Try
'create the new article
art = Article.CreateArticle(-1,
articletitle.Text,
articlesummary.Text,
False,
Date.Now,
System.Web.HttpContext.Current.User.Identity.Name.Remove(0, InStr(System.Web.HttpContext.Current.User.Identity.Name, "\")).Replace(".", " ").ToUpper,
GetVisibiliy)
art.UpdatedDate = Date.Now
If articlebody.Content.Contains("<img") Then
art.ThumbnailImage = Mid(articlebody.Content, InStr(articlebody.Content, "src=") + 5, InStr(InStr(articlebody.Content, "src=") + 5, articlebody.Content, "/>") - (InStr(articlebody.Content, "src=") + 5)).Replace(Chr(34), "").TrimEnd
Else
art.ThumbnailImage = "~/Content/Images/JCBLogo.png"
End If
'create the article detail
artBody = ArticleDetail.CreateArticleDetail(-1, -1, articlebody.Content.Replace(" ", " "))
'save to the db
Using insertContext As New JCB_IntranetEntities
insertContext.AddToArticles(art)
insertContext.AddToArticleDetails(artBody)
insertContext.SaveChanges()
End Using
newArtID = art.ArticleID
Catch ex As Exception
ErrorLogging.AddNewErrorLogEvent(ex)
Throw
Finally
If articlebody.Content IsNot Nothing Then
articlebody.Content = Nothing
articlebody.Dispose()
End If
If artBody IsNot Nothing Then artBody = Nothing
If art IsNot Nothing Then art = Nothing
End Try
'If the save worked then redirect to the article
If newArtID > 0 Then
Response.Redirect(String.Format("~/Articles/Article.aspx?ArticleID={0}", newArtID))
End If
End Sub

<telerik:GridBoundColumn DataField="ID" HeaderText="ID" ReadOnly="True" UniqueName="column1"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Seller" HeaderText="Seller" ReadOnly="True" UniqueName="column2"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Amount" HeaderText="Amount" UniqueName="column3"> </telerik:GridBoundColumn>protected void grdSellers_ItemCommand(object source, GridCommandEventArgs e) { switch (e.CommandName) { case "Update": GridEditableItem editedItem = e.Item as GridEditableItem; TableCell cell = editedItem["column3"]; string itemValue = (cell.Controls[0] as TextBox).Text; //Get Id of editable item ?? } }I have quite a complex set of classes which parses an XML file or RSS feeds.
I know that radgrid can bind to an arraylist, so I have this code:
protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
ArrayList arraylist = new ArrayList();
if (dict != null)
{
foreach (var v in dict)
{
arraylist.Add(new RSSFeedItem(v.Date, v.Description, v.Title, v.Title));
RadGrid1.DataSource = arraylist;
}
}
}
"dict" is a collection of articles in an RSS feed. So for every article inside, I add that article's date, link, description, etc to the array list, and then set the datasource to that arraylist.
On the last line of the code, I check the grid's state and it is containing the items (e.g. first pass in the loop, there is a count of 1, etc). Datasource has a count of 25 which contains the articles.
Also, how can I get the row count programatically?
Thanks
