Re: Updating Database
- From: "Dot Net Daddy" <cagriandac@xxxxxxxxx>
- Date: 14 Aug 2006 21:27:00 -0700
No, you were right. It works fine now in If Not Page.IsPostBack clause
Thanks for your help...
Dot Net Daddy wrote:
No I didn't use If Not Page.IsPostBack Then ...
but I understand what you mean, however I couldnt get it into code. I
am updating the database on Button.Click event.
Maybe copying the same code in the Button_Click into Page_Load under
If Page.IsPostback would work. But the problem is there is no way to
access the page from the address bar. I mean the page is a cross page
post back from another page. So it might cause problems.
Actually would work in practice, but on first page load it updates
itself, am I right?
Cowboy (Gregory A. Beamer) wrote:
Does the Page_Load use If Not Page.IsPostBack Then?
If not, you are resetting the form in Page_Load prior to your update button
event.
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
*************************************************
Think Outside the Box!
*************************************************
"Dot Net Daddy" <cagriandac@xxxxxxxxx> wrote in message
news:1155588127.562684.20920@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hello,
I have some textareas assigned some values which is taken from the
database on page_load. Also there is an update button.
But when I change the text and click the update button it does not
work. Actually it works, but the text I type in the textarea is not
recognized. It recognizes the assigned value on page_load, and updates
the same thing over itself.
Here is my code:
sqlDS.UpdateCommand = "UPDATE Blogs SET diaryHeader='" &
TextBox1.Text.Replace("'", "''") & "', diaryInfo='" &
TextBox2.Text.Replace("'", "''") & "', lastUpdate='" & Today.Now & "'
WHERE userName='" & User.Identity.Name & "' AND diaryDate='" &
Label4.Text & "'"
sqlDS.Update()
Label6.Text = "Great"
Thanks in advance.
.
- References:
- Updating Database
- From: Dot Net Daddy
- Re: Updating Database
- From: Cowboy \(Gregory A. Beamer\)
- Re: Updating Database
- From: Dot Net Daddy
- Updating Database
- Prev by Date: Re: IIS Web Site "Template"
- Next by Date: Sitemaps
- Previous by thread: Re: Updating Database
- Next by thread: Property values disappear on postback
- Index(es):