Thanks, Ken. It works great!
Art
"Ken Cox [Microsoft MVP]" wrote:
> Hi Art,
>
> An ASP.NET page always posts back to itself, so that's the issue you're
> encountering. Setting the action page doesn't help.
>
> Try this to pass a value from one control to a second page:
>
> 1. Create a new page called btntrsfr.aspx and drop a Button and Textbox on
> it.
> 2. Use the following code for Button1's Click event:
>
> Private Sub Button1_Click _
> (ByVal sender As System.Object, _
> ByVal e As System.EventArgs) Handles Button1.Click
> Context.Items("txtValue") = TextBox1.Text
> Server.Transfer("targetpg.aspx")
> End Sub
>
> 3. Create the target page called targetpg.aspx .
> 4. Add a label control to the page.
> 5. Use the following code for the page's Load event:
>
> Label1.Text = CType(Context.Items("txtValue"), String)
>
> You should be able to type something in the text of btntrsfr.aspx, click the
> button and see the text show up in the label of targetpg.aspx.
>
> Let us know if this helps?
>
> Ken
> Microsoft MVP [ASP.NET]
> Toronto
>
> "Art Cabot" <> wrote in message
> news:9F9DFD61-20D0-498A-8161-...
> > ASP.NET Newbie Question:
> > I have buttons (<asp:button) on my page that I want to just open another
> > page (including some arguments from the original page), just like would
> > normally happen with the "action=" on a form. I can't seem to get it to
> > stop
> > posting back, the HTML source always shows "action=original page",
> > regardless
> > of what page I set the "action =" to.
> >
> > Am I missing something really obvious here?
> > --
> > Art Cabot
> > Strickland Technical Services, Inc.
> > Augusta, Georgia
>
>
|