Re: move between pages



Try ignoring the error or playing with the 2nd (endResponse) parameter as
documented here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwebhttpresponseclassredirecttopic2.asp

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


"JIM.H." <JIMH@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:032F6F50-FC13-4E02-928E-AEB122CD1527@xxxxxxxxxxxxxxxx
> Hello,
> I have;
> string strName = this.Context.Items["name"].ToString();
> in page_load in WebForm2.aspx. It works fine when loading, I need to close
> this page and return back to first page so I have a close button with
> Response.Redirect("MyPage.aspx");
> When I click I get "Object reference not set to an instance of an object."
> at tle line I mentioned above. What should I do?
> Thanks,
> Jim.
>
>
> "Steve C. Orr [MVP, MCSD]" wrote:
>
>> Here's a nice, simple way to pass values from one page to another:
>> (VB.NET code)
>>
>> 'Add data to the context object before transferring
>> Context.Items("myParameter") = x
>> Server.Transfer("WebForm2.aspx")
>>
>> Then, in WebForm2.aspx:
>>
>> 'Grab data from the context property
>> Dim x as Integer = CType(Context.Items("myParameter"),Integer)
>>
>> Of course there are a number of ways to pass values from one page to
>> another, such as using the querystring, cookies, session,
>> context, saving to a temporary table in the database between each page,
>> etc.
>> You'll have to decide which technique is best for your application.
>> Here are several good articles on the subject to help you decide.
>> http://msdn.microsoft.com/msdnmag/issues/03/04/ASPNETUserState/default.aspx
>>
>> http://www.aspalliance.com/kenc/passval.aspx
>>
>> http://www.dotnetbips.com/displayarticle.aspx?id=79
>>
>> --
>> I hope this helps,
>> Steve C. Orr, MCSD, MVP
>> http://SteveOrr.net
>>
>>
>> "JIM.H." <JIMH@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> news:30CC4B38-AD1F-43AF-8EF8-A37889BE39FF@xxxxxxxxxxxxxxxx
>> > Hello,
>> > What is the best way to move from aspx page to aspx page by passing
>> > variables. I was using session variables with Response.Redirectin both
>> > ways,
>> > it may not be the right way. Users click a button in the current page
>> > and
>> > I
>> > need pass a variable to use in the second page and when user click
>> > close I
>> > need to jump back to first page. How can I do this? Can you give me
>> > exaple
>> > please?
>> > Thanks,
>> > Jim.
>> >
>>
>>
>>


.


Loading