problem with get value from textbox after get it value in load page

hi every one

 i have problem with my web site

when i get textbox value in load page

 

and Changed textbox

the page do not take last value .   it take value in load page

 

this is code:

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

 

TextBox1.Text = "aa"

End Sub

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)

MsgBox(TextBox1.Text)

End Sub

 

when i press button

message write "aa" while i changed the textbox

 

please if enyone knowen help me

 

-1
mrmyself
9/13/2008 8:35:03 PM
asp.net.web-forms 93655 articles. 3 followers. Follow

3 Replies
855 Views

Similar Articles

[PageSpeed] 43

 Hi

This code 

TextBox1.Text = "aa"

will be called every time you submit the page , but it must be called just the first time the page is loaded , so add this if 

If Not IsPostBack

TextBox1.Text = "aa"

end if 

 

 


Regards,

Anas Ghanem.


Note:Please Don't hesitate to click "Report Abuse" link if you noticed something wrong on the forums (like duplicate ,Off-topic,offensive,or any post that violates the website "TERMS OF USE"). -- Thanks!

1
anas
9/13/2008 9:41:21 PM

Hi ,

Your code worked well with me , are you sure no another code that changes the value of TextBox1.Text ?

 


myLabel.Text = "Just \"Mark my post As Answer\" , if it helps you";
1
Dr_no
9/13/2008 11:59:58 PM

hi

mr anas thank you very very much this is  what i need

and its work perfectly

 

dr_no

thank you for ansering me

 

 

1
mrmyself
9/14/2008 3:31:44 AM
Reply:

Similar Artilces:

How to get the HREF value of the Anchor tag in a web page using the web browser control in vb.net
Hi Friends,               i have a webserver control in my application.i load the web browser control on a button click using the below code Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click                AxWebBrowser1.Navigate("http://www.rateitall.com/i-322335-.aspx", False) End sub once the page is loaded in the browser i want the <a> HREF value in that page.For example if that page has ...

How to set value that get from the other web page for TextBox when insert into database ?
Hi,   I want to insert into database a record , one textbox value get from use input, the other 2 get from the web page. how I should write the code? here is the code: --------------------------VB   Response.Redirect("~/TE/Print test.aspx?id=" & DetailsView1.DataKey("ID") & "&designer_id=" & Staff.IdByLogin(User.Identity.Name)) form this I get id and designer_id in TE/Print test.aspx. ----------------------------ASPX  <asp:FormView ID="FormView2" runat="server" DataKeyNames="ID&...

getting values from a web form to windows form
Hot Requirement ..... Is there any possible of getting values from a web form to windows form ????? Yes One way i to use the WebRequest and WebResponse classes of the System.Net namespace. For example:  WebRequest request = WebRequest.Create("URL of the web page); WebResponse response = request.GetResponse(); StreamReader reader = new StreamReader(response.GetResponseStream()); string content = reader.ReadLine(); ....    Reza Nassabehwww.professionalcsharp.comDon't forget to click "Mark as Answer" on the post that helped you. That way fut...

getting textbox value from one page to other page....
Hello Frinds I have a question..  I am entering one userid in the textbox I am getting info from dtabase I am displying.. this userid I am using in other aspx page so i need to use this textbox userid in that page can you tell me any one how i need to get that value from one page to other page.. ASAP thanks.. I believe you can take advantage of QueryString when Passing data from one page to another.   When you redirect to the other page, you can passthe USERID as string to the Url and get that information from there Thanks for your replay Can you give me sample code sir...

Get values of textbox with values seperated by comma
I am trying to get a better way of entering the same data over and over, my first thought was multiple textboxews but in todays world there has to be a better way, so I thoguth i couold just add one textbox to page and they can enter all batch numbers in that textbox seperated by a comma and then I could pull them and insert them individually into the sql database.  Is this a good method or should I put a link button that they refresh the page and enter  a signle one everytime.  here is the code I have to enter it all in one text box but I get all kinds of error on it.  ...

Problem with getting the value from a textbox
Hi I have a shopingcart with a gridview containing the products in the shopingcart, a textbox for changing the quantity and a button for submitting the change. The textbox first holds the current number of a product, but the user should be able to change this. How do i get hold of the value in the textbox? Here's some code: The gridview (or relevant parts of it):   <ItemTemplate> <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("Antal") %>' Width="20px"></asp:TextBox> ...

problem with getting textbox value
when i pressed button add, the following code would add a text box to datagridTextBox txtEdit = new TextBox();dgTest.Items[0].Cells[0].Controls.Add( txtEdit ); After that i pressed button delete, the following would remove the textbox from datagridTextBox txtEdit = ( TextBox ) dgTest.Items[0].Cells[0].FindControl("txtEdit");// lblTest.Text = txtEdit.TextdgTest.Items[0].Cells[0].Controls.Remove( txtEdit );What i can not understand is that it removed the textbox sucessfully that means it could find the textbox but it can't not get the text that i typed in the textboxThanks TextBox txt...

Opening an existing Form (page) and getting its value to update the existing page.
Hello there, I have made some forms (called the Setup forms), and now I have a requirement to call this forms on the Transaction page too, for instance on the transaction page I have a Dropdownlist which includes all the country name, now for instance if the country is not in the Dropdownlist, there will be a Button (Add new country) just beside the Dropdownlist, and upon clicking that button an existing form (setup countries) should appear in a Modal Dialogue and after the fields are entered and submitted the Modal Popup should disappear, Updating the Countries Dropdownlist only. I though...

Getting value from a textbox control that was filled with a value from javascript
 I have a textbox control (seen below txtMileageDollars1) that gets filled with javascript based on the number of miles a user types into another textbox (txtMileageMiles1) control.  When I post back with the submit button, the value is blank.  I've tried setting EnableViewState to false, but still cannot get a value on postback.  Does anyone have a solution?   Miles<asp:TextBox ID="txtMileageMiles1" runat="server" Width="50px"></asp:TextBox>   Total (txtMileageMiles1 * rate with javascript)<asp:TextBox...

problem with getting the value from the Child Form
Hello,    i Have one Dropdownlist and Button on my Child Window and i want to get the selectedvalue of this dropdrown in my Parents window on the click of button and also i want to closed the Child window. Here i writedown the code below. Parent Window link  <input name="txtAirportCode" type="text" runat="server" class="formStyle1b" id="txtAirportCode" /> <a href="#" onclick="window.open('Airport.aspx?text=txtAirportCode,null,'width=800,height=400,left=270,top=180')">Change Airport </a>   and in my Child Window ('Airport.aspx) <asp:DropDownList...

problem in getting edited value of a textbox
hi, I have a textbox inside a usercontrol registration.ascx. <asp:TextBox ID="email" runat="server" Width="260px"></asp:TextBox> when the user wants to edit his account then this textbox is populated with the email address that the user is using currently. the problem is that when the user edits the textbox then I am unable to get the edited value. Say the old email id is demo@abc.com and the user changed it to demo123@abc.com then when i am doing String sEmail = email.Text i am getting demo@abc.com instead of  demo123@abc.com. here i...

problem in getting edited value from a textbox
hi, when a user clicks on edit profile link i am showing the ´new registration form with the user's data filled in. The problem is that when the user edits his data and clicks on the save button i am not getting the new edited data. Instead of giving me the new data textbox.Text is giving the same old value that I am displaying. what I need to do to get the new value? <asp:TextBox ID="email" runat="server" Width="260px"></asp:TextBox> sEmail = email.Text;     tamanna06:when a user clicks on edit profile link i am showing the ...

Problem getting TextBox Value in DataList.
hai guyz, i'm having a problem getting value from TextBox in the DataList Control. My situation is, i got one "Add to Cart" button,when user press the button it will trigger the Code below (catalog.aspx.cs ).It found the textbox control but can't get the value that i entered.Any idea guyz?.catalog.aspx<form id="Form1" method="post" runat="server"> <asp:datalist id="DataList1" runat="server" GridLines="Horizontal" RepeatColumns="1" OnUpdateCommand="DataList1_Update"> <ItemTemplate> <asp:LinkButton CommandName="Update" Runat="server" ID="lnkAdd...

Problems getting values from codebehind page
Hi all, I have an asp.net page which also has a code behind page in C#. The problem is that I want to access some information from my codebehind page on my ASP.Net page. I've tried putting the information I need in brackets such as <%textBox1.Text%> but this reurns the error "CS1002: ; expected" Any help on the situation is appreciated. Doing this method (called late-binding) is considered "old school" and there now are different ways to do what you're looking for. For example, if you're trying to assign the text box's text to a lable, in your code ...

Web resources about - problem with get value from textbox after get it value in load page - asp.net.web-forms

Is–ought problem - Wikipedia, the free encyclopedia
The is–ought problem in meta-ethics as articulated by Scottish philosopher and historian David Hume (1711–76) is that many writers make claims ...

Audi says fixing diesel emission problem is simple
... Green , Audi , Porsche , Volkswagen , Emissions , Diesel , Luxury Audi believes a simple fix might be enough to solve the emissions problem ...

The FBI finally gives a clear explanation about its problems with encryption
The FBI is still banging the drum for tech firms to give it a "backdoor" to encrypted devices and this time it's offered a clear explanation ...

"I say, folks, you know, I’m sorry I did this to you, but you’ve got to get used to it. It’s one of those ...
"I’m going to win. ... You know, I’m not one of these other guys that goes down. I don’t go down. I go up." Donald Trump says get used to it ...

Trump: If GOP Does Not Stick to Our Deal ‘They’re Going to Have Problems’
Trump: If GOP Does Not Stick to Our Deal 'They're Going to Have Problems'

Social media addiction is a bigger problem than you think
Social networks are massively addictive. Most people I know check and interact on social sites constantly throughout the day. And they have no ...

Guilty verdict for Oklahoma cop in serial rape trial: A national problem
Christian Science Monitor Guilty verdict for Oklahoma cop in serial rape trial: A national problem Christian Science Monitor A former Oklahoma ...

3 and Out: Three big picture problems for the Patriots
... form Search 51° Main menu Home Celtics Patriots Red Sox Bruins Revolution More WRITERS Watch Shop NECN 3 and Out: Three big picture problems ...

In Ghana, the global problem of e-waste has local consequences
Consumers have a nasty habit of throwing out their electronics as soon as newer, shinier models become available, and they rarely ever do so ...

Ted Cruz denies questioning Donald Trump's judgment. Problem is, he did it on tape.
Did Ted Cruz question whether Donald Trump has the judgment to be president or did he not? Cruz, who has cuddled up to Trump throughout the campaign, ...

Resources last updated: 12/14/2015 11:59:22 AM