473,320 Members | 1,839 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Save button and AJAX in ASP.NET 1.1

Hi,

I'm wondering if anyone can help me with AJAX in ASP.NET 1.1. I have a very
specific feature that I would like to use it for.

I have a rather long form that the users use to enter data during a phone
call with a client. Since it's long, I put six Save buttons down the length
of the form and asked the users to save often. When they click the Save
buttons, the data is saved to a central database and a text label is changed
to say "successful" or "unsuccessful."

Since this involves a postback to the server, I turned on Smart Navigation
so that the focus would stay at the same position. I didn't want the users
to have to scroll down the length of the form every time they clicked Save.

But we're having problems with Smart Navigation.

So, my question is can I use AJAX to do the Save? I just want to send the
data to the central database without a postback. The only change to the
interface would be to return a "successful" or "unsuccessful" message. Can
anyone advise me on how to do this in 1.1?

I pasted some code below. Let me know if it would help to see the code for
the SaveData function.

Thanks!
Chris

============================

Each Save button has this behind it:

Private Sub btnSave1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnSave1.Click
If Page.IsValid Then
lblSave1.Visible = True
If SaveData() Then
lblSave1.Text = "Successfully saved."
Else
lblSave1.Text = "An error occurred. " & Session("ErrMsg")
End If
End If
End Sub

===============================
Apr 4 '06 #1
5 2628
Yes, you can use AJAX to accomplish this. You will have to write quite a bit
of javascript to accomplish this task if you have a lot of fields that need
to be saved.

Depending on how well you know JavaScript, this could be a pretty big task.

--
N. Wegner

--
Nick Wegner
MCP
"C Watson" wrote:
Hi,

I'm wondering if anyone can help me with AJAX in ASP.NET 1.1. I have a very
specific feature that I would like to use it for.

I have a rather long form that the users use to enter data during a phone
call with a client. Since it's long, I put six Save buttons down the length
of the form and asked the users to save often. When they click the Save
buttons, the data is saved to a central database and a text label is changed
to say "successful" or "unsuccessful."

Since this involves a postback to the server, I turned on Smart Navigation
so that the focus would stay at the same position. I didn't want the users
to have to scroll down the length of the form every time they clicked Save.

But we're having problems with Smart Navigation.

So, my question is can I use AJAX to do the Save? I just want to send the
data to the central database without a postback. The only change to the
interface would be to return a "successful" or "unsuccessful" message. Can
anyone advise me on how to do this in 1.1?

I pasted some code below. Let me know if it would help to see the code for
the SaveData function.

Thanks!
Chris

============================

Each Save button has this behind it:

Private Sub btnSave1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnSave1.Click
If Page.IsValid Then
lblSave1.Visible = True
If SaveData() Then
lblSave1.Text = "Successfully saved."
Else
lblSave1.Text = "An error occurred. " & Session("ErrMsg")
End If
End If
End Sub

===============================

Apr 4 '06 #2
Thanks for the heads up.

A hotfix for the SmartNav problem is mentioned in this Microsoft article:
http://support.microsoft.com/default...en-us%3B884022

The article recommends waiting for the next Microsoft Visual Studio .NET
2003 service pack that contains the hotfix.

This page has some info about the service pack:
http://msdn.microsoft.com/vstudio/su...3/default.aspx

“A customer beta period for Visual Studio 2003 SP1 begins March 24, 2006 and
will continue through April 24, 2006.”

Do you know if this means the service pack would be available to everyone
after April 24th? Or would there be a delay? I don’t really follow service
pack releases.

Thanks.
"AviationDev" wrote:
Yes, you can use AJAX to accomplish this. You will have to write quite a bit
of javascript to accomplish this task if you have a lot of fields that need
to be saved.

Depending on how well you know JavaScript, this could be a pretty big task.

--
N. Wegner

--
Nick Wegner
MCP
"C Watson" wrote:
Hi,

I'm wondering if anyone can help me with AJAX in ASP.NET 1.1. I have a very
specific feature that I would like to use it for.

I have a rather long form that the users use to enter data during a phone
call with a client. Since it's long, I put six Save buttons down the length
of the form and asked the users to save often. When they click the Save
buttons, the data is saved to a central database and a text label is changed
to say "successful" or "unsuccessful."

Since this involves a postback to the server, I turned on Smart Navigation
so that the focus would stay at the same position. I didn't want the users
to have to scroll down the length of the form every time they clicked Save.

But we're having problems with Smart Navigation.

So, my question is can I use AJAX to do the Save? I just want to send the
data to the central database without a postback. The only change to the
interface would be to return a "successful" or "unsuccessful" message. Can
anyone advise me on how to do this in 1.1?

I pasted some code below. Let me know if it would help to see the code for
the SaveData function.

Thanks!
Chris

============================

Each Save button has this behind it:

Private Sub btnSave1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnSave1.Click
If Page.IsValid Then
lblSave1.Visible = True
If SaveData() Then
lblSave1.Text = "Successfully saved."
Else
lblSave1.Text = "An error occurred. " & Session("ErrMsg")
End If
End If
End Sub

===============================

Apr 4 '06 #3
My guess is it will be available shortly after April 24th as long as they
don't have any problems they need to fix that would take a long time.

--
Nick Wegner
MCP
"C Watson" wrote:
Thanks for the heads up.

A hotfix for the SmartNav problem is mentioned in this Microsoft article:
http://support.microsoft.com/default...en-us%3B884022

The article recommends waiting for the next Microsoft Visual Studio .NET
2003 service pack that contains the hotfix.

This page has some info about the service pack:
http://msdn.microsoft.com/vstudio/su...3/default.aspx

“A customer beta period for Visual Studio 2003 SP1 begins March 24, 2006 and
will continue through April 24, 2006.”

Do you know if this means the service pack would be available to everyone
after April 24th? Or would there be a delay? I don’t really follow service
pack releases.

Thanks.
"AviationDev" wrote:
Yes, you can use AJAX to accomplish this. You will have to write quite a bit
of javascript to accomplish this task if you have a lot of fields that need
to be saved.

Depending on how well you know JavaScript, this could be a pretty big task.

--
N. Wegner

--
Nick Wegner
MCP
"C Watson" wrote:
Hi,

I'm wondering if anyone can help me with AJAX in ASP.NET 1.1. I have a very
specific feature that I would like to use it for.

I have a rather long form that the users use to enter data during a phone
call with a client. Since it's long, I put six Save buttons down the length
of the form and asked the users to save often. When they click the Save
buttons, the data is saved to a central database and a text label is changed
to say "successful" or "unsuccessful."

Since this involves a postback to the server, I turned on Smart Navigation
so that the focus would stay at the same position. I didn't want the users
to have to scroll down the length of the form every time they clicked Save.

But we're having problems with Smart Navigation.

So, my question is can I use AJAX to do the Save? I just want to send the
data to the central database without a postback. The only change to the
interface would be to return a "successful" or "unsuccessful" message. Can
anyone advise me on how to do this in 1.1?

I pasted some code below. Let me know if it would help to see the code for
the SaveData function.

Thanks!
Chris

============================

Each Save button has this behind it:

Private Sub btnSave1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnSave1.Click
If Page.IsValid Then
lblSave1.Visible = True
If SaveData() Then
lblSave1.Text = "Successfully saved."
Else
lblSave1.Text = "An error occurred. " & Session("ErrMsg")
End If
End If
End Sub

===============================

Apr 4 '06 #4
Sorry I'm so late to the party.

But as long as you're going to allow as-you-go updates, you might as
well include what's known as the "Yellow Fade Technique" (Google it)
for the updated fields. Also, the label that reads "Successful" could
display that for, say, five seconds and then fade away. Or else toggle
to blanks or "Changed" or some other status to indicate that a Save is
needed. The toggle would happen on any keypress that makes the form
dirty.

My two cents.

Apr 21 '06 #5
while ajax will work, you can do a old fashioned post to a hidden frame:

create a hidden iframe on the page.

<iframe name=hiddenPost id =hiddenPost style="width:0;height:0;"></iframe>

a label(s) to update with satatus

<span id="savestatus1"></span>

then the save buttons

<asp:button id=save1 runat=server>

in the codebehind

save1.Attributes["onclick"] = "forms[0].target='hiddenPost';"

for the final save:

donesave.Attributes["onclick"] = "forms[0].target='_self';"

when the users click the save button, a post will be done using the hidden
frame, so the focus will not move. when your code behind get a postback from
save1, it should save the data and write the following javascript. (its best
that clear the response and only write the following code)

<script>
var el = window.parent.document.getElementById(savestatus1) ;
if (el) el.innerHTML = "Saved";
</script>

-- bruce (sqlwork.com)

"C Watson" <C Wa****@discussions.microsoft.com> wrote in message
news:AB**********************************@microsof t.com...
Hi,

I'm wondering if anyone can help me with AJAX in ASP.NET 1.1. I have a
very
specific feature that I would like to use it for.

I have a rather long form that the users use to enter data during a phone
call with a client. Since it's long, I put six Save buttons down the
length
of the form and asked the users to save often. When they click the Save
buttons, the data is saved to a central database and a text label is
changed
to say "successful" or "unsuccessful."

Since this involves a postback to the server, I turned on Smart Navigation
so that the focus would stay at the same position. I didn't want the
users
to have to scroll down the length of the form every time they clicked
Save.

But we're having problems with Smart Navigation.

So, my question is can I use AJAX to do the Save? I just want to send the
data to the central database without a postback. The only change to the
interface would be to return a "successful" or "unsuccessful" message.
Can
anyone advise me on how to do this in 1.1?

I pasted some code below. Let me know if it would help to see the code
for
the SaveData function.

Thanks!
Chris

============================

Each Save button has this behind it:

Private Sub btnSave1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnSave1.Click
If Page.IsValid Then
lblSave1.Visible = True
If SaveData() Then
lblSave1.Text = "Successfully saved."
Else
lblSave1.Text = "An error occurred. " & Session("ErrMsg")
End If
End If
End Sub

===============================

May 22 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Jimmy Jazz | last post by:
Hi, I have created a control with some buttons an alphabet. When one of these buttons are pressed it posts back and in the postback event for the button pressed a list of tems is created with a...
3
by: femin | last post by:
Hi all, I am trying to develope one web application using vb.net. i have two dropdownlist boxes.1st ddlist i am binding on page load event. The 2nd ddlist i am populating by ajax by taking the id...
1
by: jim whitaker | last post by:
I followed this tutorial, and I have it working. http://www.webpasties.com/xmlHttpRequest/ My question is this: After an AJAX form receives it's data from the server, how could i then submit...
8
by: Richard Maher | last post by:
Hi, I am in a mouseup event for button A and I'd like to disable=false button B before starting some work. Is there anyway that an event for button B can then fire before my event processing for...
5
by: KingdomHeart | last post by:
I am very newbie in ajax, so please forgive me if my question are so dump. I want to create a box where user can type a message and when they click "Save" button. That text will be save. I got the...
6
by: =?Utf-8?B?S2Fp?= | last post by:
Hi all, using AJAX Toolkit with vb.net 2.0 how could I make this "Updating..." Screen like e.g. on Codeplex when you click on the "Vote" button...
1
by: anush | last post by:
Hi, I want to create a ajax textbox where when I add some content and save it, it saves the content and also appends the username to the content. And when I clcik the edit button, I just get the...
5
by: MC | last post by:
Hi, I am googling for a script and can't seem to find code to do this. I can probably write code to save but reloading is an issue. I want to, using ajax, send all form data back to a server...
19
Frinavale
by: Frinavale | last post by:
I'm in the middle of implementing a custom Ajax enabled Server Control. At this point I need help finding the answer to an Ajax Framework question...here it goes: I have a Server Control that...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, youll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.