Showing posts with label datagrid. Show all posts
Showing posts with label datagrid. Show all posts

Wednesday, March 28, 2012

Third-party Grid recommendation?

Hello,
I've been using the datagrid, but now I need to sort
on the columns, and I really want to do this on the client
to save performance time.
I had a third-party grid I used in ASP that worked great, but it was
difficult to work with.
So my list of requirements are simply:
-- Sort by column (which implies that it'll be scrollable)
-- Ease of use.
-- Don't mind if it's reasonably priced, but I probably
don't want a ton of features if that's going to complicate things.
-- agreeable to my hosting company.
Anybody want to offer some experiences?
Thanks,
Jim
*** Sent via Developersdex http://www.examnotes.net ***
Don't just participate in USENET...get rewarded for it!Check out the Infragistics controls. Your host won't mind because they are
native .NET objects. A little pricey, but you get a lot of controls.
Charlie
"Jim Corey" <jcorey@.nospamcharter.net> wrote in message
news:evy2sawIEHA.940@.tk2msftngp13.phx.gbl...
> Hello,
> I've been using the datagrid, but now I need to sort
> on the columns, and I really want to do this on the client
> to save performance time.
> I had a third-party grid I used in ASP that worked great, but it was
> difficult to work with.
> So my list of requirements are simply:
> -- Sort by column (which implies that it'll be scrollable)
> -- Ease of use.
> -- Don't mind if it's reasonably priced, but I probably
> don't want a ton of features if that's going to complicate things.
> -- agreeable to my hosting company.
> Anybody want to offer some experiences?
> Thanks,
> Jim
>
>
> *** Sent via Developersdex http://www.examnotes.net ***
> Don't just participate in USENET...get rewarded for it!
I use the datagrid that comes with web matrix. It has some built in
features that would be a lot more work using the standard datagrid.
All it requires is for the dll from web matrix to be in the bin
directory.
Leslie
On Fri, 16 Apr 2004 10:36:31 -0700, "Charlie@.CBFC"
<charle1@.comcast.net> wrote:

>Check out the Infragistics controls. Your host won't mind because they are
>native .NET objects. A little pricey, but you get a lot of controls.
>Charlie
>"Jim Corey" <jcorey@.nospamcharter.net> wrote in message
>news:evy2sawIEHA.940@.tk2msftngp13.phx.gbl...
>

Third-party Grid recommendation?

Hello,

I've been using the datagrid, but now I need to sort
on the columns, and I really want to do this on the client
to save performance time.
I had a third-party grid I used in ASP that worked great, but it was
difficult to work with.

So my list of requirements are simply:
-- Sort by column (which implies that it'll be scrollable)
-- Ease of use.
-- Don't mind if it's reasonably priced, but I probably
don't want a ton of features if that's going to complicate things.
-- agreeable to my hosting company.

Anybody want to offer some experiences?

Thanks,
Jim

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!Check out the Infragistics controls. Your host won't mind because they are
native .NET objects. A little pricey, but you get a lot of cool controls.

Charlie
"Jim Corey" <jcorey@.nospamcharter.net> wrote in message
news:evy2sawIEHA.940@.tk2msftngp13.phx.gbl...
> Hello,
> I've been using the datagrid, but now I need to sort
> on the columns, and I really want to do this on the client
> to save performance time.
> I had a third-party grid I used in ASP that worked great, but it was
> difficult to work with.
> So my list of requirements are simply:
> -- Sort by column (which implies that it'll be scrollable)
> -- Ease of use.
> -- Don't mind if it's reasonably priced, but I probably
> don't want a ton of features if that's going to complicate things.
> -- agreeable to my hosting company.
> Anybody want to offer some experiences?
> Thanks,
> Jim
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!
I use the datagrid that comes with web matrix. It has some built in
features that would be a lot more work using the standard datagrid.
All it requires is for the dll from web matrix to be in the bin
directory.

Leslie

On Fri, 16 Apr 2004 10:36:31 -0700, "Charlie@.CBFC"
<charle1@.comcast.net> wrote:

>Check out the Infragistics controls. Your host won't mind because they are
>native .NET objects. A little pricey, but you get a lot of cool controls.
>Charlie
>"Jim Corey" <jcorey@.nospamcharter.net> wrote in message
>news:evy2sawIEHA.940@.tk2msftngp13.phx.gbl...
>>
>> Hello,
>>
>> I've been using the datagrid, but now I need to sort
>> on the columns, and I really want to do this on the client
>> to save performance time.
>> I had a third-party grid I used in ASP that worked great, but it was
>> difficult to work with.
>>
>> So my list of requirements are simply:
>> -- Sort by column (which implies that it'll be scrollable)
>> -- Ease of use.
>> -- Don't mind if it's reasonably priced, but I probably
>> don't want a ton of features if that's going to complicate things.
>> -- agreeable to my hosting company.
>>
>> Anybody want to offer some experiences?
>>
>> Thanks,
>> Jim
>>
>>
>>
>>
>>
>> *** Sent via Developersdex http://www.developersdex.com ***
>> Don't just participate in USENET...get rewarded for it!

Third-party Grid recommendation?

Hello,

I've been using the datagrid, but now I need to sort
on the columns, and I really want to do this on the client
to save performance time.
I had a third-party grid I used in ASP that worked great, but it was
difficult to work with.

So my list of requirements are simply:
-- Sort by column (which implies that it'll be scrollable)
-- Ease of use.
-- Don't mind if it's reasonably priced, but I probably
don't want a ton of features if that's going to complicate things.
-- agreeable to my hosting company.

Anybody want to offer some experiences?

Thanks,
Jim

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!Check out the Infragistics controls. Your host won't mind because they are
native .NET objects. A little pricey, but you get a lot of cool controls.

Charlie
"Jim Corey" <jcorey@.nospamcharter.net> wrote in message
news:evy2sawIEHA.940@.tk2msftngp13.phx.gbl...
> Hello,
> I've been using the datagrid, but now I need to sort
> on the columns, and I really want to do this on the client
> to save performance time.
> I had a third-party grid I used in ASP that worked great, but it was
> difficult to work with.
> So my list of requirements are simply:
> -- Sort by column (which implies that it'll be scrollable)
> -- Ease of use.
> -- Don't mind if it's reasonably priced, but I probably
> don't want a ton of features if that's going to complicate things.
> -- agreeable to my hosting company.
> Anybody want to offer some experiences?
> Thanks,
> Jim
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!
I use the datagrid that comes with web matrix. It has some built in
features that would be a lot more work using the standard datagrid.
All it requires is for the dll from web matrix to be in the bin
directory.

Leslie

On Fri, 16 Apr 2004 10:36:31 -0700, "Charlie@.CBFC"
<charle1@.comcast.net> wrote:

>Check out the Infragistics controls. Your host won't mind because they are
>native .NET objects. A little pricey, but you get a lot of cool controls.
>Charlie
>"Jim Corey" <jcorey@.nospamcharter.net> wrote in message
>news:evy2sawIEHA.940@.tk2msftngp13.phx.gbl...
>>
>> Hello,
>>
>> I've been using the datagrid, but now I need to sort
>> on the columns, and I really want to do this on the client
>> to save performance time.
>> I had a third-party grid I used in ASP that worked great, but it was
>> difficult to work with.
>>
>> So my list of requirements are simply:
>> -- Sort by column (which implies that it'll be scrollable)
>> -- Ease of use.
>> -- Don't mind if it's reasonably priced, but I probably
>> don't want a ton of features if that's going to complicate things.
>> -- agreeable to my hosting company.
>>
>> Anybody want to offer some experiences?
>>
>> Thanks,
>> Jim
>>
>>
>>
>>
>>
>> *** Sent via Developersdex http://www.developersdex.com ***
>> Don't just participate in USENET...get rewarded for it!

Monday, March 26, 2012

This is an ASP.NET complite program and it works fine. An error is genereded if

Hi,

Following is an ASP.NET complite program and it works fine. An error is genereded if there is one record at the last page of the DataGrid.
Here is the error generated by the system System.Web.HttpException: Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount.
is there any way to fix this problem?

Here's the Code:
<%@dotnet.itags.org. Import Namespace="System.Data" %>
<%@dotnet.itags.org. Import Namespace="System.Data.SQLClient" %>
<html>
<head>
<meta name="GENERATOR" Content="ASP Express 2.1">
<title>Deleting from DataBase using a DataGrid</title>
<script language="VB" runat="server">

Sub MyDataGrid_DeleteCommand(s As Object, e As DataGridCommandEventArgs )
Dim strConn as String = "server=YourServer;uid=YourUID;pwd=YourPWD;database=YourDB"
Dim DeleteCmd As String = "DELETE from safetable Where id = @dotnet.itags.org.Id"
Dim MyConn as New SQLConnection(strConn)
Dim Cmd as New SqlCommand(DeleteCmd, MyConn)
Cmd.Parameters.Add(New SqlParameter("@dotnet.itags.org.ID", MyDataGrid.DataKeys(CInt(e.Item.ItemIndex))))
MyConn.Open()
Cmd.ExecuteNonQuery()
MyConn.Close()
BindData
End Sub

Sub Page_Change(sender As Object, e As DataGridPageChangedEventArgs)
MyDataGrid.CurrentPageIndex = e.NewPageIndex
BindData
End Sub

Sub Page_Load(Source As Object, E As EventArgs)
If Not Page.IsPostBack Then
BindData()
End If
End Sub

Sub BindData()
Dim strConn as String = "server=YourServer;uid=YourUID;pwd=YourPWD;database=YourDB"
Dim MySQL as string = "Select * from safetable Order by id desc"
Dim MyConn as New SQLConnection(strConn)
Dim ds as DataSet=New DataSet()
Dim Cmd as New SQLDataAdapter(MySQL,MyConn)
Cmd.Fill(ds,"safetable")
MyDataGrid.Datasource=ds.Tables("safetable").DefaultView
MyDataGrid.DataBind()
End Sub
</script>
</head>
<body>
<form runat="server" method="post">
<asp:Datagrid runat="server"
Id="MyDataGrid"
GridLines="Both"
cellpadding="0"
cellspacing="0"
Headerstyle-BackColor="#8080C0"
Headerstyle-Font-Name="Arial"
Headerstyle-Font-Bold="True"
Headerstyle-Font-Size="14"
BackColor="#8080FF"
Font-Name="Arial"
Font-Size="11"
AlternatingItemStyle-BackColor="#C0C0C0"
AlternatingItemStyle-Font-Name="Arial"
AlternatingItemStyle-Font-Size="11"
BorderColor="Black"
AllowPaging = "True"
PageSize = "8"
PagerStyle-Mode = "NumericPages"
PagerStyle-HorizontalAlign="Center"
PagerStyle-PageButtonCount = "10"
OnPageIndexChanged = "Page_Change"
AutogenerateColumns="False"
OnDeleteCommand="MyDataGrid_DeleteCommand"
DataKeyField="id"
Width="50%">
<Columns>
<asp:ButtonColumn Text="Delete" HeaderText="Delete" CommandName="Delete"></asp:ButtonColumn>
<asp:BoundColumn DataField="fname" HeaderText="fname"></asp:BoundColumn>
<asp:BoundColumn DataField="lname" HeaderText="lname"></asp:BoundColumn>
</Columns>
</asp:DataGrid>
</form>Here is the table structure for SQL

CREATE TABLE [safetable] (
[id] [int] IDENTITY (1, 1) NOT NULL ,
[fname] [char] (10) NULL ,
[lname] [char] (10) NULL
) ON [PRIMARY]
GO
Sub Page_Change(sender As Object, e As DataGridPageChangedEventArgs)
Dim pageIndex As Integer
If e.NewPageIndex >= 0 And e.NewPageIndex < MyDataGrid.PageCount
' Valid page index.
pageIndex = e.NewPageIndex
Else If e.NamePageIndex < 0
' Move to the first page.
pageIndex = 0
Else
' Move to the last page.
pageIndex = MyDataGrid.PageCount
End If

MyDataGrid.CurrentPageIndex = pageIndex
BindData
End Sub
Thanks for your support but I am getting same error. When I am at the last page on the datagrid, there is only one record is shown. I delete that record and it is deleted successfully. Since there is no data to show on the last page of the datagird, system cannot bind it. Thats why I am getting this error. After deleting the last record on the last page of the datagrid, it should display previous page.
Same solution... :)
Move the code in the Page_Change event into a separate function, and use that function only to DataBind(), then add calls to that function in both Page_Change and MyDataGrid_DeleteCommand events.
Your solution is not clear to me! Is there any way that you can create a sample?

Thanks
It's untested, but should work.

Sub MyDataGrid_DeleteCommand(s As Object, e As DataGridCommandEventArgs )
Dim strConn as String = "server=YourServer;uid=YourUID;pwd=YourPWD;database=YourDB"
Dim DeleteCmd As String = "DELETE from safetable Where id = @.Id"
Dim MyConn as New SQLConnection(strConn)
Dim Cmd as New SqlCommand(DeleteCmd, MyConn)
Cmd.Parameters.Add(New SqlParameter("@.ID", MyDataGrid.DataKeys(CInt(e.Item.ItemIndex))))
MyConn.Open()
Cmd.ExecuteNonQuery()
MyConn.Close()
BindData
End Sub

Sub Page_Change(sender As Object, e As DataGridPageChangedEventArgs)
MyDataGrid.CurrentPageIndex = GetValidPageIndex(e.NewPageIndex)
BindData
End Sub

Sub Page_Load(Source As Object, E As EventArgs)
If Not Page.IsPostBack Then
BindData()
End If
End Sub

Sub BindData()
Dim strConn as String = "server=YourServer;uid=YourUID;pwd=YourPWD;database=YourDB"
Dim MySQL as string = "Select * from safetable Order by id desc"
Dim MyConn as New SQLConnection(strConn)
Dim ds as DataSet=New DataSet()
Dim Cmd as New SQLDataAdapter(MySQL,MyConn)

Cmd.Fill(ds, "safetable")
With MyDataGrid
.Datasource = ds.Tables("safetable").DefaultView
.CurrentPageIndex = GetValidPageIndex(.CurrentPageIndex)
.DataBind()
End With
End Sub

Function GetValidPageIndex(ByVal intCurrentIndex As Integer) As Integer
Dim pageIndex As Integer
If e.NewPageIndex >= 0 And e.NewPageIndex < MyDataGrid.PageCount
' Valid page index.
pageIndex = e.NewPageIndex
Else If e.NamePageIndex < 0
' Move to the first page.
pageIndex = 0
Else
' Move to the last page.
pageIndex = MyDataGrid.PageCount
End If
End Function
Hi,

Is it posible that you can take a look at the your function GetValidPageIndex?. I had a error with it.
I made some modification to your function GetValidPageIndex and I still get error. Here is the code that I made modification.

Function GetValidPageIndex(ByVal intCurrentIndex As Integer) As Integer
Dim pageIndex As Integer
If intCurrentIndex >= 0 And intCurrentIndex < MyDataGrid.PageCount
' Valid page index.
GetValidPageIndex = intCurrentIndex
Else If intCurrentIndex < 0
' Move to the first page.
GetValidPageIndex = 0
Else
' Move to the last page.
GetValidPageIndex = MyDataGrid.PageCount
End If
End Function
I add following code and It worked fine.

Dim Result As Integer = MyDataGrid.Items.Count Mod MyDataGrid.PageSize

If Result = 1 Then
MyDataGrid.CurrentPageIndex = ( MyDataGrid.PageCount - 2)
End If

Thursday, March 22, 2012

Thread aborted when doing HttpContext.Current.Response.End

Hi,
I have written a function to export the datagrid data to excel. In that
function I was calling HttpContext.Current.Response.End() at the end. If I a
m
doing this, I am getting an exception message "Thread was being aborted". If
I don't do this then it is exporting the whole data instead of just the
datagrid. I am not knowing what might be the problem. Please let me know if
you have any idea
Thnx,
Sridhar.That's just how Response.End() works, it throws a ThreadAbortExxception.
You can't doing anything wrong, but you may. You'll either need to handle
(catch/swallow/hide) the exception or change your page so only the grid
shows and there's no need to End the request.
Karl
MY ASP.Net tutorials
http://www.openmymind.net/
http://openmymind.net/redirector.aspx?documentId=51 - Learn about AJAX!
"Sridhar" <Sridhar@.discussions.microsoft.com> wrote in message
news:92D1C4A0-006D-4DB7-87D3-86E26C8D0FD9@.microsoft.com...
> Hi,
> I have written a function to export the datagrid data to excel. In that
> function I was calling HttpContext.Current.Response.End() at the end. If I
> am
> doing this, I am getting an exception message "Thread was being aborted".
> If
> I don't do this then it is exporting the whole data instead of just the
> datagrid. I am not knowing what might be the problem. Please let me know
> if
> you have any idea
> Thnx,
> Sridhar.

Thread aborted when doing HttpContext.Current.Response.End

Hi,

I have written a function to export the datagrid data to excel. In that
function I was calling HttpContext.Current.Response.End() at the end. If I am
doing this, I am getting an exception message "Thread was being aborted". If
I don't do this then it is exporting the whole data instead of just the
datagrid. I am not knowing what might be the problem. Please let me know if
you have any idea

Thnx,
Sridhar.That's just how Response.End() works, it throws a ThreadAbortExxception.
You can't doing anything wrong, but you may. You'll either need to handle
(catch/swallow/hide) the exception or change your page so only the grid
shows and there's no need to End the request.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
http://openmymind.net/redirector.aspx?documentId=51 - Learn about AJAX!

"Sridhar" <Sridhar@.discussions.microsoft.com> wrote in message
news:92D1C4A0-006D-4DB7-87D3-86E26C8D0FD9@.microsoft.com...
> Hi,
> I have written a function to export the datagrid data to excel. In that
> function I was calling HttpContext.Current.Response.End() at the end. If I
> am
> doing this, I am getting an exception message "Thread was being aborted".
> If
> I don't do this then it is exporting the whole data instead of just the
> datagrid. I am not knowing what might be the problem. Please let me know
> if
> you have any idea
> Thnx,
> Sridhar.

Tuesday, March 13, 2012

Thread was being aborted error message

Hi all, I have a user control which raises an event to the parent page when
a person clicks on a link in a datagrid.
In the event handler inside the parent page I construct a url to redirect to
containing information sent from the datagrid.
It all works fine on my local machine but when I send it to the live server
I receive "The thread was being aborted"
Doing some googling suggested that I use
Response.Redirect("./myurl.aspx?ID=" + variable,false);
to allow the current thread to continue executing.
This stops the error but what I am now finding is that the redirect does not
have the querystring attributes attached to it..
e.g. instead of looking like this...
http://www.website.com/myurl.aspx?ID=5
it looks like
http://www.website.com/myurl.aspx
It's like the redirect *never* happens...
Help appreciated
Thanks
MarkPut your Response.Redirect back to the way it was, without the false
parameter.
Then wrap it in a Try/Catch statement to eat the error that's raised from
the redirect.
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Jimi" <dontspam@.me.com> wrote in message
news:uls70dBXGHA.1352@.TK2MSFTNGP05.phx.gbl...
> Hi all, I have a user control which raises an event to the parent page
> when a person clicks on a link in a datagrid.
> In the event handler inside the parent page I construct a url to redirect
> to containing information sent from the datagrid.
> It all works fine on my local machine but when I send it to the live
> server I receive "The thread was being aborted"
> Doing some googling suggested that I use
> Response.Redirect("./myurl.aspx?ID=" + variable,false);
> to allow the current thread to continue executing.
> This stops the error but what I am now finding is that the redirect does
> not have the querystring attributes attached to it..
> e.g. instead of looking like this...
> http://www.website.com/myurl.aspx?ID=5
> it looks like
> http://www.website.com/myurl.aspx
>
> It's like the redirect *never* happens...
> Help appreciated
> Thanks
> Mark
>
>
Hi Steve, you mean like this?
try
{
Response.Redirect("./myurl.aspx?ID=" + variable);
}catch (Exception ex)
{
}
I have seen other people say take the Response.Redirect("./myurl.aspx?ID=" +
variable,false) out of the try catch block...
I understand why this is hapenning but cannot understand how to fix it...
Thanks again Steve..
Cheers
Mark
"Steve C. Orr [MVP, MCSD]" <Steve@.Orr.net> wrote in message
news:eaqxRZEXGHA.3660@.TK2MSFTNGP04.phx.gbl...
> Put your Response.Redirect back to the way it was, without the false
> parameter.
> Then wrap it in a Try/Catch statement to eat the error that's raised from
> the redirect.
> --
> I hope this helps,
> Steve C. Orr, MCSD, MVP
> http://SteveOrr.net
>
> "Jimi" <dontspam@.me.com> wrote in message
> news:uls70dBXGHA.1352@.TK2MSFTNGP05.phx.gbl...
>
Yes, that's what I'm suggesting. Does it work for you?
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Jimi" <dontspam@.me.com> wrote in message
news:efW%23QfEXGHA.4324@.TK2MSFTNGP03.phx.gbl...
> Hi Steve, you mean like this?
> try
> {
> Response.Redirect("./myurl.aspx?ID=" + variable);
> }catch (Exception ex)
> {
> }
> I have seen other people say take the Response.Redirect("./myurl.aspx?ID="
> + variable,false) out of the try catch block...
> I understand why this is hapenning but cannot understand how to fix it...
> Thanks again Steve..
> Cheers
> Mark
> "Steve C. Orr [MVP, MCSD]" <Steve@.Orr.net> wrote in message
> news:eaqxRZEXGHA.3660@.TK2MSFTNGP04.phx.gbl...
>
Hi Steve, no unfortunately not.
I did a try catch and caught the exception like so:
catch (Exception ex)
Output of ex.Message was Thread was being aborted.
and ex.Source = mscorlib
Thanks again for your help
Cheers
Mark
"Steve C. Orr [MVP, MCSD]" <Steve@.Orr.net> wrote in message
news:OlCNUwFXGHA.3848@.TK2MSFTNGP05.phx.gbl...
> Yes, that's what I'm suggesting. Does it work for you?
> --
> I hope this helps,
> Steve C. Orr, MCSD, MVP
> http://SteveOrr.net
>
> "Jimi" <dontspam@.me.com> wrote in message
> news:efW%23QfEXGHA.4324@.TK2MSFTNGP03.phx.gbl...
>
Hi all, in the end due to time constraints I used a JavaScript redirect and
now it all works fine.
Thanks for your help Steve :)
Cheers
Mark
"Jimi" <dontspam@.me.com> wrote in message
news:uq2px$FXGHA.752@.TK2MSFTNGP02.phx.gbl...
> Hi Steve, no unfortunately not.
> I did a try catch and caught the exception like so:
> catch (Exception ex)
> Output of ex.Message was Thread was being aborted.
> and ex.Source = mscorlib
> Thanks again for your help
> Cheers
> Mark
>
>
> "Steve C. Orr [MVP, MCSD]" <Steve@.Orr.net> wrote in message
> news:OlCNUwFXGHA.3848@.TK2MSFTNGP05.phx.gbl...
>

Thread was being aborted error message

Hi all, I have a user control which raises an event to the parent page when
a person clicks on a link in a datagrid.

In the event handler inside the parent page I construct a url to redirect to
containing information sent from the datagrid.

It all works fine on my local machine but when I send it to the live server
I receive "The thread was being aborted"

Doing some googling suggested that I use

Response.Redirect("./myurl.aspx?ID=" + variable,false);

to allow the current thread to continue executing.

This stops the error but what I am now finding is that the redirect does not
have the querystring attributes attached to it..

e.g. instead of looking like this...

http://www.website.com/myurl.aspx?ID=5

it looks like

http://www.website.com/myurl.aspx

It's like the redirect *never* happens...

Help appreciated
Thanks
MarkPut your Response.Redirect back to the way it was, without the false
parameter.
Then wrap it in a Try/Catch statement to eat the error that's raised from
the redirect.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net

"Jimi" <dontspam@.me.com> wrote in message
news:uls70dBXGHA.1352@.TK2MSFTNGP05.phx.gbl...
> Hi all, I have a user control which raises an event to the parent page
> when a person clicks on a link in a datagrid.
> In the event handler inside the parent page I construct a url to redirect
> to containing information sent from the datagrid.
> It all works fine on my local machine but when I send it to the live
> server I receive "The thread was being aborted"
> Doing some googling suggested that I use
> Response.Redirect("./myurl.aspx?ID=" + variable,false);
> to allow the current thread to continue executing.
> This stops the error but what I am now finding is that the redirect does
> not have the querystring attributes attached to it..
> e.g. instead of looking like this...
> http://www.website.com/myurl.aspx?ID=5
> it looks like
> http://www.website.com/myurl.aspx
>
> It's like the redirect *never* happens...
> Help appreciated
> Thanks
> Mark
Hi Steve, you mean like this?

try
{
Response.Redirect("./myurl.aspx?ID=" + variable);

}catch (Exception ex)
{

}

I have seen other people say take the Response.Redirect("./myurl.aspx?ID=" +
variable,false) out of the try catch block...
I understand why this is hapenning but cannot understand how to fix it...

Thanks again Steve..
Cheers
Mark

"Steve C. Orr [MVP, MCSD]" <Steve@.Orr.net> wrote in message
news:eaqxRZEXGHA.3660@.TK2MSFTNGP04.phx.gbl...
> Put your Response.Redirect back to the way it was, without the false
> parameter.
> Then wrap it in a Try/Catch statement to eat the error that's raised from
> the redirect.
> --
> I hope this helps,
> Steve C. Orr, MCSD, MVP
> http://SteveOrr.net
>
> "Jimi" <dontspam@.me.com> wrote in message
> news:uls70dBXGHA.1352@.TK2MSFTNGP05.phx.gbl...
>> Hi all, I have a user control which raises an event to the parent page
>> when a person clicks on a link in a datagrid.
>>
>> In the event handler inside the parent page I construct a url to redirect
>> to containing information sent from the datagrid.
>>
>> It all works fine on my local machine but when I send it to the live
>> server I receive "The thread was being aborted"
>>
>> Doing some googling suggested that I use
>>
>> Response.Redirect("./myurl.aspx?ID=" + variable,false);
>>
>> to allow the current thread to continue executing.
>>
>> This stops the error but what I am now finding is that the redirect does
>> not have the querystring attributes attached to it..
>>
>> e.g. instead of looking like this...
>>
>> http://www.website.com/myurl.aspx?ID=5
>>
>> it looks like
>>
>> http://www.website.com/myurl.aspx
>>
>>
>> It's like the redirect *never* happens...
>>
>> Help appreciated
>> Thanks
>> Mark
>>
>>
>>
Yes, that's what I'm suggesting. Does it work for you?

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net

"Jimi" <dontspam@.me.com> wrote in message
news:efW%23QfEXGHA.4324@.TK2MSFTNGP03.phx.gbl...
> Hi Steve, you mean like this?
> try
> {
> Response.Redirect("./myurl.aspx?ID=" + variable);
> }catch (Exception ex)
> {
> }
> I have seen other people say take the Response.Redirect("./myurl.aspx?ID="
> + variable,false) out of the try catch block...
> I understand why this is hapenning but cannot understand how to fix it...
> Thanks again Steve..
> Cheers
> Mark
> "Steve C. Orr [MVP, MCSD]" <Steve@.Orr.net> wrote in message
> news:eaqxRZEXGHA.3660@.TK2MSFTNGP04.phx.gbl...
>> Put your Response.Redirect back to the way it was, without the false
>> parameter.
>> Then wrap it in a Try/Catch statement to eat the error that's raised from
>> the redirect.
>>
>> --
>> I hope this helps,
>> Steve C. Orr, MCSD, MVP
>> http://SteveOrr.net
>>
>>
>>
>> "Jimi" <dontspam@.me.com> wrote in message
>> news:uls70dBXGHA.1352@.TK2MSFTNGP05.phx.gbl...
>>> Hi all, I have a user control which raises an event to the parent page
>>> when a person clicks on a link in a datagrid.
>>>
>>> In the event handler inside the parent page I construct a url to
>>> redirect to containing information sent from the datagrid.
>>>
>>> It all works fine on my local machine but when I send it to the live
>>> server I receive "The thread was being aborted"
>>>
>>> Doing some googling suggested that I use
>>>
>>> Response.Redirect("./myurl.aspx?ID=" + variable,false);
>>>
>>> to allow the current thread to continue executing.
>>>
>>> This stops the error but what I am now finding is that the redirect does
>>> not have the querystring attributes attached to it..
>>>
>>> e.g. instead of looking like this...
>>>
>>> http://www.website.com/myurl.aspx?ID=5
>>>
>>> it looks like
>>>
>>> http://www.website.com/myurl.aspx
>>>
>>>
>>> It's like the redirect *never* happens...
>>>
>>> Help appreciated
>>> Thanks
>>> Mark
>>>
>>>
>>>
>>
>>
Hi Steve, no unfortunately not.

I did a try catch and caught the exception like so:

catch (Exception ex)

Output of ex.Message was Thread was being aborted.
and ex.Source = mscorlib

Thanks again for your help
Cheers
Mark

"Steve C. Orr [MVP, MCSD]" <Steve@.Orr.net> wrote in message
news:OlCNUwFXGHA.3848@.TK2MSFTNGP05.phx.gbl...
> Yes, that's what I'm suggesting. Does it work for you?
> --
> I hope this helps,
> Steve C. Orr, MCSD, MVP
> http://SteveOrr.net
>
> "Jimi" <dontspam@.me.com> wrote in message
> news:efW%23QfEXGHA.4324@.TK2MSFTNGP03.phx.gbl...
>> Hi Steve, you mean like this?
>>
>> try
>> {
>> Response.Redirect("./myurl.aspx?ID=" + variable);
>>
>> }catch (Exception ex)
>> {
>>
>> }
>>
>> I have seen other people say take the
>> Response.Redirect("./myurl.aspx?ID=" + variable,false) out of the try
>> catch block...
>> I understand why this is hapenning but cannot understand how to fix it...
>>
>> Thanks again Steve..
>> Cheers
>> Mark
>>
>> "Steve C. Orr [MVP, MCSD]" <Steve@.Orr.net> wrote in message
>> news:eaqxRZEXGHA.3660@.TK2MSFTNGP04.phx.gbl...
>>> Put your Response.Redirect back to the way it was, without the false
>>> parameter.
>>> Then wrap it in a Try/Catch statement to eat the error that's raised
>>> from the redirect.
>>>
>>> --
>>> I hope this helps,
>>> Steve C. Orr, MCSD, MVP
>>> http://SteveOrr.net
>>>
>>>
>>>
>>> "Jimi" <dontspam@.me.com> wrote in message
>>> news:uls70dBXGHA.1352@.TK2MSFTNGP05.phx.gbl...
>>>> Hi all, I have a user control which raises an event to the parent page
>>>> when a person clicks on a link in a datagrid.
>>>>
>>>> In the event handler inside the parent page I construct a url to
>>>> redirect to containing information sent from the datagrid.
>>>>
>>>> It all works fine on my local machine but when I send it to the live
>>>> server I receive "The thread was being aborted"
>>>>
>>>> Doing some googling suggested that I use
>>>>
>>>> Response.Redirect("./myurl.aspx?ID=" + variable,false);
>>>>
>>>> to allow the current thread to continue executing.
>>>>
>>>> This stops the error but what I am now finding is that the redirect
>>>> does not have the querystring attributes attached to it..
>>>>
>>>> e.g. instead of looking like this...
>>>>
>>>> http://www.website.com/myurl.aspx?ID=5
>>>>
>>>> it looks like
>>>>
>>>> http://www.website.com/myurl.aspx
>>>>
>>>>
>>>> It's like the redirect *never* happens...
>>>>
>>>> Help appreciated
>>>> Thanks
>>>> Mark
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
Hi all, in the end due to time constraints I used a JavaScript redirect and
now it all works fine.

Thanks for your help Steve :)
Cheers
Mark
"Jimi" <dontspam@.me.com> wrote in message
news:uq2px$FXGHA.752@.TK2MSFTNGP02.phx.gbl...
> Hi Steve, no unfortunately not.
> I did a try catch and caught the exception like so:
> catch (Exception ex)
> Output of ex.Message was Thread was being aborted.
> and ex.Source = mscorlib
> Thanks again for your help
> Cheers
> Mark
>
>
> "Steve C. Orr [MVP, MCSD]" <Steve@.Orr.net> wrote in message
> news:OlCNUwFXGHA.3848@.TK2MSFTNGP05.phx.gbl...
>> Yes, that's what I'm suggesting. Does it work for you?
>>
>> --
>> I hope this helps,
>> Steve C. Orr, MCSD, MVP
>> http://SteveOrr.net
>>
>>
>> "Jimi" <dontspam@.me.com> wrote in message
>> news:efW%23QfEXGHA.4324@.TK2MSFTNGP03.phx.gbl...
>>> Hi Steve, you mean like this?
>>>
>>> try
>>> {
>>> Response.Redirect("./myurl.aspx?ID=" + variable);
>>>
>>> }catch (Exception ex)
>>> {
>>>
>>> }
>>>
>>> I have seen other people say take the
>>> Response.Redirect("./myurl.aspx?ID=" + variable,false) out of the try
>>> catch block...
>>> I understand why this is hapenning but cannot understand how to fix
>>> it...
>>>
>>> Thanks again Steve..
>>> Cheers
>>> Mark
>>>
>>> "Steve C. Orr [MVP, MCSD]" <Steve@.Orr.net> wrote in message
>>> news:eaqxRZEXGHA.3660@.TK2MSFTNGP04.phx.gbl...
>>>> Put your Response.Redirect back to the way it was, without the false
>>>> parameter.
>>>> Then wrap it in a Try/Catch statement to eat the error that's raised
>>>> from the redirect.
>>>>
>>>> --
>>>> I hope this helps,
>>>> Steve C. Orr, MCSD, MVP
>>>> http://SteveOrr.net
>>>>
>>>>
>>>>
>>>> "Jimi" <dontspam@.me.com> wrote in message
>>>> news:uls70dBXGHA.1352@.TK2MSFTNGP05.phx.gbl...
>>>>> Hi all, I have a user control which raises an event to the parent page
>>>>> when a person clicks on a link in a datagrid.
>>>>>
>>>>> In the event handler inside the parent page I construct a url to
>>>>> redirect to containing information sent from the datagrid.
>>>>>
>>>>> It all works fine on my local machine but when I send it to the live
>>>>> server I receive "The thread was being aborted"
>>>>>
>>>>> Doing some googling suggested that I use
>>>>>
>>>>> Response.Redirect("./myurl.aspx?ID=" + variable,false);
>>>>>
>>>>> to allow the current thread to continue executing.
>>>>>
>>>>> This stops the error but what I am now finding is that the redirect
>>>>> does not have the querystring attributes attached to it..
>>>>>
>>>>> e.g. instead of looking like this...
>>>>>
>>>>> http://www.website.com/myurl.aspx?ID=5
>>>>>
>>>>> it looks like
>>>>>
>>>>> http://www.website.com/myurl.aspx
>>>>>
>>>>>
>>>>> It's like the redirect *never* happens...
>>>>>
>>>>> Help appreciated
>>>>> Thanks
>>>>> Mark
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>