|
Hi,
I have a page with some info on it, including a customer details form. When the user clicks the submit button, they are redirected to a second page* (using the button postbackurl property).
On this new page i wish to recall the data the user input into the form. I know that i should use 'Requet.Form["field name"]', for this but i dont know what the field will be called. At present iam using this:
<code>Literal1.Text = Request.Form["TextBox2"];</code>
However this is not returning any text.
Please can you sgive me some idea of where im going wrong.
Many Many Thanks!
<small>*I have to do this so please dont suggest i do it differently. Thanks.</small>
|
|
|
|
|
Find any info on ViewState or Session objects
|
|
|
|
|
string sttestbox = textbox1
Session["Sessioname"] = sttestbox;
|
|
|
|
|
I cant really use sessions as i am using them for a whole load of orders etc.
Thanks for the suggestion.
|
|
|
|
|
creat an order object class.
fill the class for each order
as soon as one order is filled add the order to an ArrayList.
In the session object you can objects. So you can add an ArrayList to 1 session0bject.
In the second page cast that session object to an ArrayList and you can reach your data.
|
|
|
|
|
This is a great tip for something else I was working on. Thanks for posting it digimanus.
digimanus wrote: creat an order object class.
fill the class for each order
as soon as one order is filled add the order to an ArrayList.
In the session object you can objects. So you can add an ArrayList to 1 session0bject.
In the second page cast that session object to an ArrayList and you can reach your data.
|
|
|
|
|
Care to shed any more light, with reference to my question?
Thanks.
|
|
|
|
|
Friend ,..You can use 'request.querystring' method to call the
second page's value to other ...
|
|
|
|
|
I dont really want to use QueryString as its open to abuse.
Thanks anyway.
|
|
|
|
|
Hi dear,
Have u tried using Server.Transfer and HttpContext
just see the below exa.
there is one textbox in yr form and u want that textbox value in another page. for that do the following..
HttpContext.Current.Items("txt1") = Txt1.Text;
Server.Transfer("anotherPage.aspx");
-------------- To access data in anotherPage.aspx
string txt1 = HttpContext.Current.Items("txt1").toString();
I hope it will help u..
regards
Rana Krishnraj
|
|
|
|
|
Rana,
Thanks for the suggestion. I have 6 textboxes i need cross page access to. Will this work with all 6 textboxes?
Also do i need to dispose of the items in Context after use?
Thanks!!!
|
|
|
|
|
Hi,
Yes of-course it is possible for all 6 textboxes. for demo purpose i write the code for one textbox only, ok.
after using of Context no need to dispose them, but according to yr requirement u have to clear HttpContext.
Regards,
Rana Krishnraj
|
|
|
|
|
Hi
can anyone help me how to post two different files of different formats from one page to another page using HTTP Post.
Thanks in Advance
modified on Wednesday, April 2, 2008 1:08 AM
|
|
|
|
|
Hi
My brain isnt working today, so excuse the low knowledge!
Need to have two labels on the same line, one in the middle page, one aligned right
Can any1 help with that?
I used to align but it puts them on different lines.
thanks!
|
|
|
|
|
Your controls should be in the table
Are you maitaining any table strcuture for it ?
Could you post your html code ?
Might be width is not enough
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
<table width="100%">
<tr>
<td align="right">
<asp:Label ID="Label2" Text="Text" CssClass="FooterText" runat="server"></asp:Label>
</td>
<td align="right">
<asp:Label ID="Label1" CssClass="VersionText" runat="server" Text="Text"></asp:Label>
</td>
</tr>
</table>
Managed to make this work, not sure how though as both tds are aligned right but display center on webpage
cheers
|
|
|
|
|
If you face any problem related to alignment,
first make the border=1 for table like
<table border="1" width="100%">
<tr>
<td align="right">
<asp:Label ID="Label2" Text="Text" CssClass="FooterText" runat="server"></asp:Label>
</td>
<td align="right">
<asp:Label ID="Label1" CssClass="VersionText" runat="server" Text="Text"></asp:Label>
</td>
</tr>
</table>
Now you can see what might got wrong
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
modified on Tuesday, April 1, 2008 9:56 AM
|
|
|
|
|
Try using tables.
<table><tr>
<td ></td>
<td><asp:Label id="Label1"></asp:Label></td>
<td><asp:Label id="Label2"></asp:Label></td>
</tr>
Give width for each <td> appropriately.
|
|
|
|
|
Hi,
Apologies in advance as I am fairly new to all this.
Is it possible to auto populate a word document or word document template from ASP.NET 2.0 and also have this document emailed automatically to a user. I am able to populate a word document from a datasource using xml and xslt. I am also able to seperately email a word document as an attachment but it is the combination of creating the word document using xslt/xml and have this automatically emailed to a user that I am having difficulty with.
I'm guessing it probably can't be done and the word document would need to be saved by the user and emailed independently.
Can anyone clarify?
Thanks.
|
|
|
|
|
login page is not redirecting towards a calling url.Login page comes again though passing a proper credentials.The page which i am calling is in sub directory(fol 1) and when i am calling a page in another directory(fol 2) its working fine.when i am running from local host then everything is fine until i upload on server.
coolsatty
|
|
|
|
|
I had a similar problem in past Satty. What i figured out was that there was some sort of configuration problem on the server. When i uploaded the same thing on another server it worked fine. So, i would recommend that you upload it on some other server.
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
but there is another directory called admin in same application ,when i am calling page from admin directory it works fine.When i am calling a page from Directory 2 i get this problem. Thank u
coolsatty
|
|
|
|
|
now using dropdown and updatepanel. on the selectedindexchanged event is handled in updatepanel. depends on value of the dropdown some visisble state is changed. It's working fine. after posted these value navigating to this page by clicking the back button in the browser not working. problem is value in the dropdown is ok but the updatepanel is not working.
Thanks in Advance!
Have A Nice Day!
Murali.M
modified on Tuesday, April 1, 2008 7:26 AM
|
|
|
|
|
I think because the code has already executed on the page then when you click back you are seeing the result of that
Basically you would need to reset the page
|
|
|
|
|
use javascript to refresh the page if possible
Ashish Sehajpal
|
|
|
|