Ask a Question related to ASP.NET General, Design and Development.
-
Alex #1
ASP:TextBox
I am a newbie to ASP.NET...
What I was trying to do... but yet to succeed in...
I am building a customer info database... and on default,
I want to display the customer's basic information in the
TextBox on Page_Load... but, also allow user to update the
information
For example: Street1 of the home address
ASP:TextBox id=dbStreet1 value=<%=litDbStreet1%>
but also allow update all within the same form on the same
text box to do the following...
ASP:TextBox id=dbStreet1 runat=server
I tried everything I know... but not works...
Please advise
thanks
Alex
Alex Guest
-
TextBox Value
I have TextBox column in datagrid. I would like to update database with values when user click on button (outside datagrid). Dim cell As... -
textbox
i would like modify font texybox in verdana in onpage_load textbox.font=? -
New TextBox value ignored
I am using a datagrid and using an edit template to update one of the rows. The code below comes from the Update method that I have written. The... -
runat="server"....a simple html textbox or a webform server textbox...that is the question.
I just realized that the code I inherited is using all asp.net server controls (ie. webform controls) and when I try to update textboxes on the... -
VERY STRANGE BUG? Adding a textbox control causes other textbox control to fail???
I've had this happen a few times too. I'm still not positive of what exactly causes it but all that's happening is the control that no longer... -
George Zacharias #2
Re: ASP:TextBox
Try the attribute "text" instead of "value".
The best way to do this is declare an ASP textbox in the code-behind page
and assign the value of the variable to dbStreet1.Text from the Page_Load
event.
George Zacharias.
"Alex" <alexcfwu@gwu.edu> wrote in message
news:006801c34307$06628da0$a101280a@phx.gbl...> I am a newbie to ASP.NET...
>
> What I was trying to do... but yet to succeed in...
>
> I am building a customer info database... and on default,
> I want to display the customer's basic information in the
> TextBox on Page_Load... but, also allow user to update the
> information
>
> For example: Street1 of the home address
> ASP:TextBox id=dbStreet1 value=<%=litDbStreet1%>
>
> but also allow update all within the same form on the same
> text box to do the following...
> ASP:TextBox id=dbStreet1 runat=server
>
> I tried everything I know... but not works...
>
> Please advise
> thanks
> Alex
George Zacharias Guest
-
Alex #3
Re: ASP:TextBox
Hi,
This is what I did...
Page_Load()
dbStreet1.Text = "whatever st"
Update_Text()
SQL update cmd ==> "update ..... dbstreet1='" &
dbStreet1.Text "' where <match critera>=<match this>"
Inside the HTML Main Body
<form method=post>
<ASP:TextBox id=dbStreet1 value=dbStreet1.Text
runat=server/>
</form>
It works on initial load.. where it takes the info from
DB... but the update doesn't seem to regonize the new value
Any clue?
thanks
Alexcode-behind page>-----Original Message-----
>Try the attribute "text" instead of "value".
>
>The best way to do this is declare an ASP textbox in thefrom the Page_Load>and assign the value of the variable to dbStreet1.Textdefault,>event.
>
>George Zacharias.
>
>"Alex" <alexcfwu@gwu.edu> wrote in message
>news:006801c34307$06628da0$a101280a@phx.gbl...>> I am a newbie to ASP.NET...
>>
>> What I was trying to do... but yet to succeed in...
>>
>> I am building a customer info database... and onthe>> I want to display the customer's basic information inthe>> TextBox on Page_Load... but, also allow user to updatesame>> information
>>
>> For example: Street1 of the home address
>> ASP:TextBox id=dbStreet1 value=<%=litDbStreet1%>
>>
>> but also allow update all within the same form on the>>> text box to do the following...
>> ASP:TextBox id=dbStreet1 runat=server
>>
>> I tried everything I know... but not works...
>>
>> Please advise
>> thanks
>> Alex
>
>.
>Alex Guest
-
Alex #4
Re: ASP:TextBox
Hi,
This is what I did...
Page_Load()
dbStreet1.Text = "whatever st"
Update_Text()
SQL update cmd ==> "update ..... dbstreet1='" &
dbStreet1.Text "' where <match critera>=<match this>"
Inside the HTML Main Body
<form method=post>
<ASP:TextBox id=dbStreet1 value=dbStreet1.Text
runat=server/>
</form>
It works on initial load.. where it takes the info from
DB... but the update doesn't seem to regonize the new value
Any clue?
thanks
Alexcode-behind page>-----Original Message-----
>Try the attribute "text" instead of "value".
>
>The best way to do this is declare an ASP textbox in thefrom the Page_Load>and assign the value of the variable to dbStreet1.Textdefault,>event.
>
>George Zacharias.
>
>"Alex" <alexcfwu@gwu.edu> wrote in message
>news:006801c34307$06628da0$a101280a@phx.gbl...>> I am a newbie to ASP.NET...
>>
>> What I was trying to do... but yet to succeed in...
>>
>> I am building a customer info database... and onthe>> I want to display the customer's basic information inthe>> TextBox on Page_Load... but, also allow user to updatesame>> information
>>
>> For example: Street1 of the home address
>> ASP:TextBox id=dbStreet1 value=<%=litDbStreet1%>
>>
>> but also allow update all within the same form on the>>> text box to do the following...
>> ASP:TextBox id=dbStreet1 runat=server
>>
>> I tried everything I know... but not works...
>>
>> Please advise
>> thanks
>> Alex
>
>.
>Alex Guest
-
David Waz... #5
Re: ASP:TextBox
Alex,
You have to read some fundamental books on ASPX programming - that's #1.
There are bunches and bunches of inexpensive, quick, easy books on the
subject.
The Page_load event fires on every trip to your page, so you are overwriting
the data changed on the site with the Page_Load event assignments.
.... so, your fresh, new values are trampled on when you post back to
update...
events fired in this order:
Init
Load viewstate
Process postback data (this is where your new data gets back to the
application)
Load (this is were you lose the data, and the original values are put back)
Send postback Change
Postback events
pre-render
save view state
render
dispose
unload
Learn it, love it, live it! :-)
"Alex" <alexcfwu@gwu.edu> wrote in message
news:006801c34307$06628da0$a101280a@phx.gbl...> I am a newbie to ASP.NET...
>
> What I was trying to do... but yet to succeed in...
>
> I am building a customer info database... and on default,
> I want to display the customer's basic information in the
> TextBox on Page_Load... but, also allow user to update the
> information
>
> For example: Street1 of the home address
> ASP:TextBox id=dbStreet1 value=<%=litDbStreet1%>
>
> but also allow update all within the same form on the same
> text box to do the following...
> ASP:TextBox id=dbStreet1 runat=server
>
> I tried everything I know... but not works...
>
> Please advise
> thanks
> Alex
David Waz... Guest
-
Alex #6
Re: ASP:TextBox
Dave,
Many thanks...
The sequence of load instructions solve my problem...
Basically I have everything else done right... Except, not
checking explicitly for POST during Page_Load...
I was basically counting on the even handler to trigger
the event..
Thank you
Alexprogramming - that's #1.>-----Original Message-----
>Alex,
>
>You have to read some fundamental books on ASPXbooks on the>There are bunches and bunches of inexpensive, quick, easyyou are overwriting>subject.
>
>The Page_load event fires on every trip to your page, soassignments.>the data changed on the site with the Page_Load eventpost back to>.... so, your fresh, new values are trampled on when youback to the>update...
>
>events fired in this order:
>
>Init
>Load viewstate
>Process postback data (this is where your new data getsvalues are put back)>application)
>Load (this is were you lose the data, and the originaldefault,>Send postback Change
>Postback events
>pre-render
>save view state
>render
>dispose
>unload
>
>Learn it, love it, live it! :-)
>
>"Alex" <alexcfwu@gwu.edu> wrote in message
>news:006801c34307$06628da0$a101280a@phx.gbl...>> I am a newbie to ASP.NET...
>>
>> What I was trying to do... but yet to succeed in...
>>
>> I am building a customer info database... and onthe>> I want to display the customer's basic information inthe>> TextBox on Page_Load... but, also allow user to updatesame>> information
>>
>> For example: Street1 of the home address
>> ASP:TextBox id=dbStreet1 value=<%=litDbStreet1%>
>>
>> but also allow update all within the same form on the>>> text box to do the following...
>> ASP:TextBox id=dbStreet1 runat=server
>>
>> I tried everything I know... but not works...
>>
>> Please advise
>> thanks
>> Alex
>
>.
>Alex Guest
-
Leonard #7
Re: ASP:TextBox
This event sequence, indeed, is discussed in several
ASP.NET with varying degrees of clarity. The major theme
in most books is to use the "if (!IsPostBack)..." logic to
get around the overwriting of variables in the viewstate.
However, I am observing a difference in behavior between
the asp:label control (where everything seems to work as I
expect and state is preserved via the viewstate) and the
asp:textbox where the state is not preserved in the
viewstate. What is happening here? I think Alex and I
are hitting the same problem.
Also, the instance of the asp:textbox seems not to have
been created in the init and when it is referenced in the
Page_Load an exception is thrown because the object isn't
there!
What is happening with the asp:textbox?programming - that's #1.>-----Original Message-----
>Alex,
>
>You have to read some fundamental books on ASPXbooks on the>There are bunches and bunches of inexpensive, quick, easyyou are overwriting>subject.
>
>The Page_load event fires on every trip to your page, soassignments.>the data changed on the site with the Page_Load eventpost back to>.... so, your fresh, new values are trampled on when youback to the>update...
>
>events fired in this order:
>
>Init
>Load viewstate
>Process postback data (this is where your new data getsvalues are put back)>application)
>Load (this is were you lose the data, and the originaldefault,>Send postback Change
>Postback events
>pre-render
>save view state
>render
>dispose
>unload
>
>Learn it, love it, live it! :-)
>
>"Alex" <alexcfwu@gwu.edu> wrote in message
>news:006801c34307$06628da0$a101280a@phx.gbl...>> I am a newbie to ASP.NET...
>>
>> What I was trying to do... but yet to succeed in...
>>
>> I am building a customer info database... and onthe>> I want to display the customer's basic information inthe>> TextBox on Page_Load... but, also allow user to updatesame>> information
>>
>> For example: Street1 of the home address
>> ASP:TextBox id=dbStreet1 value=<%=litDbStreet1%>
>>
>> but also allow update all within the same form on the>>> text box to do the following...
>> ASP:TextBox id=dbStreet1 runat=server
>>
>> I tried everything I know... but not works...
>>
>> Please advise
>> thanks
>> Alex
>
>.
>Leonard Guest



Reply With Quote

