Populate text box on a different web form

Hello All

I have a button and a textbox on my Default aspx page, (Using VB),  when i click it i want to open my page customers.aspx and populate textbox1 with the details from the textbox on my default page,

Can anyone point me in the right direction please

thanks

gibbo

 

0
gibbo1715
4/25/2007 6:08:08 AM
asp.net.web-forms 93655 articles. 6 followers. Follow

4 Replies
1034 Views

Similar Articles

[PageSpeed] 41

You can use the session variables to save the textbox text of the Default page and retrieve it from the customers page

// To Save the value of the textbox on the Default page use the below code

Session("Textbox") = TextBox1.Text

// To retrieve it from customers page and set it as the text for another textbox use the below code

TextBox2.Text = Session("TextBox")

Check below link to have a good idea of how to send data between webforms.

http://www.dotnetbips.com/articles/displayarticledetails.aspx?articleid=79

HC


Haissam Abdul Malak
MCAD.NET
| Blog |
0
Haissam
4/25/2007 6:20:47 AM

Thankyou for the quick reply, can I put this code within my aspx.vb code on both pages then?

thanks

Paul

0
gibbo1715
4/25/2007 6:38:03 AM

Hi,

 

You have two options here. One is session variable as mentioned in above post. But it is overkill. If you are not going to access the textbox value in any other pages and is not a sensitive data like password, then you can use request variables.

 

Take following url as sample.

 

http://forums.asp.net/AddPost.aspx?PostID=1680922

 

Here we are passing PostID value to AddPost.aspx from some other page. It is very simple. On redirect url just add a variable and its value i.e. value of textbox on your default page.

 

Request.redirect(“~/mypage.aspx?myVar=”+ txtValue.Text)

 

On my page you can access the variable like

 

txtValDisplay.Text = Request(“myVar”)

 

 

Don’t forget to mark this as answer if this post helps you

 

Hamlin Stephen

 

0
hamlin
4/25/2007 6:47:29 AM

Hello,

Another way is

Partial Class PostTo
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim script As String = "<script language=javascript>window.showModalDialog('FindTextBox.aspx?value=" + TextBox1.Text + "');</script>"

        Page.RegisterStartupScript("javascript", script)

    End Sub
End Class

And in another page

Using TextBox1.Text=Request.QueryString("value")

Hope it helps,

Jessica


Jessica Cao
Sincerely,
Microsoft Online Community Support


“Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”
0
Jessica
4/27/2007 3:19:04 AM
Reply:

Similar Artilces:

Load Text box of one web form with selected list item of list box of another web form
one help please Problem is i have two web forms  1.  ForiegnkeyTest.aspx  2. foroginkeytable.aspx   step 1 1 ForiegnkeyTest.aspx one web form <head runat="server"><script language="javascript" type="text/javascript">   function popWin()   {         var confirmWin = null;      confirmWin = window.open('foroginkeytable.aspx','anycontent',   'width=455,height=435,status');   }  </script> &...

can someone one give me difference between web form and mobile web form and which or where or when i'm using the forms?
thanks Marc Hi Marc, Based on my understanding, you want to know the differences between the ASP.NET web application and ASP.NET mobile web application. If I have misunderstood you, please feel free to let me know. The ASP.NET forms are used to develop the ASP.NET pages for desktop browsers and The ASP.NET mobile forms are used to develop the ASP.NET pages for mobile device browsers. When we create the ASP.NET mobile web forms pages, we can use nearly all the features of ASP.NET. But there are a couple of compatibility issues: Error Handling and Reporting. Tracing. Using Redi...

Open web page in IE and populate fields on the form from my web form
To the dot net Knights.  Many humble thanks in advance from a dot net surf. We have an vb application that opens multiple instances of IE object, each to different web pages.  It then takes information from the current record in the app, populates fields on each of the web pages, and them submits the forms.  We are then able to look at the resulting web pages and quickly get the info we're looking for.This prevents us from having to manually navigate to each web site, enter the same information and then wait for the page to open.  If there is ...

Web forms and mobile web forms
Hey everyone, I am looking to develope a web site that depending on the device connecting to it, it will display a certain page. In this case im looking to create a web and wap version of the same project. I have the Web forms version finished using ASP.NET and C# and I am wondering how to create the mobile web form and incorporate it in the project. In the project folder, can I just add a mobile web??? But what about displaying device specific pages?? Cheers -Dudach Yes, you can add mobile web forms and controls to your Web Application project. No problem. For device/br...

How to Make Web Forms from other Web Forms
In putting together an ASP.NET application for a biz application, we have come to the point where there are three different types of basic forms which have, for the most part, been perfected. Now its is a matter of cloning those forms for various uses and modifying or adding code to suit the particular need. Copy and paste works OK, but there is a lot of changing of certain words, etc. Is there a way in ASP.NET to take these basic forms, turn them into classes or templates, create forms from them, then add or overwrite code? ? (Anybody who is a Vis Fox Pro programmer would know imme...

For interrupting.web form Resized by position of the div : if div can't dispaly all (such as only top part , then web form heithten the heght),resize the web form
Web Form Resized by position of the div : if div can't dispaly all (such as only top part , then web form heithten the heght),resize the web form ! Because of my pool English, if you can't see , I will explain more ! ThanksGambler is the real life I guess you mean when form grows it also grow parent div element. This is normal. If you want div to stay fixed size and rather clip the form and maybe show a scrollbar, look at overflow property in CSS.Thanks------------------------------------------------------------This posting is provided "AS IS" with no warranties, and confers no ...

Include web form inside web form
I tried to include an aspx file in a asp.net web form. However, all the web controls (textbox, button) in the included page are not displayed when called. <Form id="Form1" method="post" runat="server"> <%   Response.writeFile("subPage.aspx"); %> <asp:button id="btnPrev" runat="server" text="Previous"></asp:button> </Form> There are some <asp:textbox> controls in the subPage.aspx file, the file itself works fine, but when it is included in the main page, all the controls are not displayed. Please assist. Thanks   u should u...

How to fire events in other web form from other web form ?
Suppose that I have A and B web form. I want to trigger B web form's Page_Load event from A web form. How can I do that ? Thanks in advanced WilbertWilbert Bujn Create a public method in B that call the load method : public void Load(object sender, System.EventArgs e) { Page_Load(sender, e) ; } In the page_load of A, instanciate a B object and then call the function B myB = new B() ; myB.Load() ; Quicky Thank you quicky, it works fine. WilbertWilbert Bujn...

Web Form embedded in another Web Form
Hi,  I have programmed a Web Form which acts like a scientific calculator. I would like to embedd this calculator in the upper left hand corner of another accounting Web Form. I don't want to host the calculator on the same server as the accounting page. I.e. I want them to have distinct URLs. Classically, I would do this using frames, but is there a better way using ASP? Is there some sort of Panel which can display the webpage at a specific URL which I can just drag onto my accounting Web Form? Thanks,  P1000   Frames are the only way to embed a webform inside ano...

Web Form vs. Web Content Form
If you don't mind, I would like to know what is the difference between those two items, when I go to add a new item I see both of those and I don't know what the difference is.  A content form is for use with a masterpage. A web form is a standalone web page. If you select web content form, you will then have to specify a masterpage for it. and what is a master page used for?  Hi, a master page is used to give a constant look and theme to a site, without having to duplicate code. So basically you can put your header, menu, nav and footer on a master page. Then a...

calling a web form from another web form
I would like to know what is the best way to open a web form from another web form. I would like to call it from a button control. Thanks Well, if I've grasped your question right, there are many methods to do that: 1)Response.Redirect > To navigate to another page from code and is equal to clicking a hyperlink. I suggest this as I think it's closer to your question. 2)Server.Transfer > This ends the current web form and begins a new web form. It's usable when you want to pass some variables i.e (Label1.Text) to the next immediate page. It's not safe though and not used to send p...

Difference between mobile web applications and standard web applications + mobile web forms in them ?
I have a series of existing sites, but I need to make a PPC version of them (there already is one, but it uses standard web forms). Since the code-behind looks a lot in the PC and in the PPC version, I'd like both versions to use the same files for the code. I'm left with 2 options : - either create a new mobile web application for each existing web application, and put all the code behind in .dlls which I'll call from each page ; - or, if this is possible (and I'd rather do it), simply add mobile web forms to the existing web applications and redirect at login to the appropriate ve...

VB .net Web Form will not get contents of Text Box
I have created a web form with text boxes that are bound to a DataSet/DataView.  I have created button to navigate up and down the recordset.  That all works fine. I need to have the ability to edit/add text in any of the boxes and then when clicking "Save" button, it would build an UPDATE query to send to the database. When the Save button is clicked, I have coded to DIM a string var (strSQL) to use to build the SQL command.  For some reason, it will only get the text from a text box if the data was pulled the database.  If I add/edit data, then the SQL command will ha...

Implementing .Net Form into an APS.net web form, can this be done
I am new here, but have been searching for a while, and may not have the correct lingo to find what I am looking for.  I am tasked with implementing a .exe application that was writen vb6 then converted to .net into a new website my team is developing. The idea is to put each of the 3 different forms in this .exe application of 3 different .aspx pages. I have attempted multiple things to get this into the page and even started to just rewrite it as an ASP.net web form, but even then I can't reuse any of the code since the System.Web.UI.Page doesn't inherit the sa...

Web resources about - Populate text box on a different web form - asp.net.web-forms

A.M. Links: Hillary vs. Bernie Debate Tonight, Oregon Rancher Cliven Bundy Arrested by FBI
Hillary Clinton and Bernie Sanders will face off tonight in a Democratic presidential debate in Milwaukee. The Nation : "Why Hillary Clinton ...

TripAdvisor's profit beats estimates, shares jump
(Reuters) - Travel review website operator TripAdvisor Inc reported a quarterly profit that beat analysts' estimates, as the company earned more ...

Vagrant Targeted Police In Shooting At Maryland Panera Bread — ‘You See This Stuff In Movies’
Wednesday afternoon at a Panera Bread in a small Maryland community, two officers were targeted and killed by a vagrant, marking the county’s ...

Fight the dead and fear the living in The Walking Dead: No Man’s Land
In the latest episode of The Walking Dead: No Mans Land , the official mobile game of AMCs The Walking Dead zombie-apocalyptic horror TV series ...

Poll: Majority Supports Prison and Justice Reforms
A majority of Americans believe that too many drug offenders are in prison, according to a new poll that shows strong support for the elimination ...

My robot Valentine—could you fall in love with a robot?
Imagine it's Valentine's Day and you're sitting in a restaurant across the table from your significant other, about to start a romantic dinner. ...

Video: Oregon standoff to end in surrender?
Late yesterday, the FBI moved personnel into position around the federal building occupied by the remnant of protesters at Malheur Wildlife Refuge ...

Kim Kardashian goes sheer & furry in a post-baby NYC outing: uncomfortable?
Kanye West’s NYFW Yeezy show is today, so we’ll either have those photos for you later today or maybe tomorrow, depending on when we get the ...

Star Kart: Star Wars and Mario Kart Mashup is a Thing of Beauty
YouTube Link This wonderful combination of Mario Kart and Star Wars created by Dark Pixel Digital took them much longer to make than they anticipated ...

Yellen inspires fresh rout on global stock markets
London (AFP) - World stock markets slumped Thursday, gripped by yet another fierce sell-off after a warning by Federal Reserve boss Janet Yellen ...

Resources last updated: 2/11/2016 2:39:55 PM