Click here to Skip to main content
15,920,030 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Datagrid template Pin
Tamimi - Code3-Dec-06 19:22
Tamimi - Code3-Dec-06 19:22 
GeneralRe: Datagrid template Pin
shereem khaleel3-Dec-06 19:33
shereem khaleel3-Dec-06 19:33 
Questionhow to make an event on a TemplateColumn Pin
rania_mansy3-Dec-06 0:17
rania_mansy3-Dec-06 0:17 
QuestionForum Required Pin
Bulky Fellow2-Dec-06 20:23
Bulky Fellow2-Dec-06 20:23 
AnswerRe: Forum Required Pin
Grapes-R-Fun3-Dec-06 9:39
Grapes-R-Fun3-Dec-06 9:39 
QuestionHow to Pass data using POST method .???????? Pin
devboycpp2-Dec-06 18:10
devboycpp2-Dec-06 18:10 
AnswerRe: How to Pass data using POST method .???????? Pin
Guffa3-Dec-06 7:05
Guffa3-Dec-06 7:05 
GeneralRe: How to Pass data using POST method .???????? Pin
Dominic Pettifer3-Dec-06 8:14
Dominic Pettifer3-Dec-06 8:14 
That's the drawback of ASP.NET - people don't learn HTML any more...


I second that, too much abstraction at times. Smile | :)

To answer the question, you could use a regular form and retrieve the posted data on the second page using Request.Form["textboxName"], as Guffa says. Alternatively, if you're using ASP.NET 2.0 you could use Cross-Page Posting instead, and keep everything with runat="server".

In your first page set the PostBackUrl property for your button like this...

<asp:TextBox runat="server" ID="txtMessage" /><br />
<asp:Button runat="server" ID="btnMyButton" PostBackUrl="SecondPage.aspx" Text="Click Me" />


...then in your SecondPage.aspx page...

protected void Page_Load(object sender, EventArgs e)<br />
{<br />
    if(this.PreviousPage != null)<br />
    {<br />
        lblSomeLabel.Text = this.PreviousPage.Request.Form["txtMessage"];<br />
    }<br />
}<br />

There's more to it though, do a search. If you're doing something relatively simple then it's probably better to use Guffa's approach.

Dominic Pettifer

Blog: www.dominicpettifer.co.uk

QuestionImage Element Qn Pin
honkie_thong2-Dec-06 17:11
honkie_thong2-Dec-06 17:11 
GeneralRe: Image Element Qn Pin
Guffa3-Dec-06 11:23
Guffa3-Dec-06 11:23 
Questiondefaultbutton problem Pin
karanba2-Dec-06 9:50
karanba2-Dec-06 9:50 
Questiondatalist with linkbutton Pin
nick neutron2-Dec-06 9:05
nick neutron2-Dec-06 9:05 
AnswerRe: datalist with linkbutton Pin
nick neutron3-Dec-06 8:54
nick neutron3-Dec-06 8:54 
QuestionManipulating Response Headers Pin
Dominic Pettifer2-Dec-06 7:29
Dominic Pettifer2-Dec-06 7:29 
AnswerRe: Manipulating Response Headers Pin
Guffa2-Dec-06 9:12
Guffa2-Dec-06 9:12 
QuestionImage in dataview problem Pin
Imran Khan Pathan2-Dec-06 2:35
Imran Khan Pathan2-Dec-06 2:35 
QuestionUploading Sql Database Pin
Ashish Porwal2-Dec-06 1:39
Ashish Porwal2-Dec-06 1:39 
AnswerRe: Uploading Sql Database Pin
jszulc2-Dec-06 1:59
jszulc2-Dec-06 1:59 
QuestionActive Report and Email Sending? Pin
Tridip Bhattacharjee2-Dec-06 1:38
professionalTridip Bhattacharjee2-Dec-06 1:38 
QuestionDropDownList Serach not showing what stored procedure displays during run Pin
jszulc2-Dec-06 1:38
jszulc2-Dec-06 1:38 
QuestionJavascript Problem Pin
monika_vasvani2-Dec-06 1:15
monika_vasvani2-Dec-06 1:15 
AnswerRe: Javascript Problem Pin
Guffa2-Dec-06 4:55
Guffa2-Dec-06 4:55 
AnswerRe: Javascript Problem Pin
K.P.Kannan2-Dec-06 13:48
K.P.Kannan2-Dec-06 13:48 
QuestionDynamic selectcommand and paging/sorting Pin
MarkLF2-Dec-06 0:29
MarkLF2-Dec-06 0:29 
QuestionData Access Pin
Shriya Kapoor1-Dec-06 23:23
Shriya Kapoor1-Dec-06 23:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.